/* ==========================================================================
   Aegis Mail — visual system (ground-up rewrite)
   One coherent design: a calm, trustworthy mail-governance client.
   - One spacing scale, one type scale, one set of tokens.
   - Teal carries action/identity; brass marks trust (protected / VIP).
   - Comfortable, balanced density. Hairline structure, soft elevation.
   - No internal overrides fighting each other.
   ========================================================================== */

/* ---- Tokens -------------------------------------------------------------- */
:root {
  /* canvas + surfaces */
  --canvas:      #eef1f4;   /* app backdrop behind panes            */
  --surface:     #ffffff;   /* reading pane, cards, raised surfaces  */
  --surface-2:   #f5f7f9;   /* sidebar + list rail                  */
  --surface-3:   #eaeef2;   /* hover / inset wells                  */

  /* ink */
  --ink:    #1b2533;
  --ink-2:  #56616f;
  --muted:  #8893a1;

  /* lines */
  --border:        #e3e8ed;
  --border-strong: #d2dae1;

  /* teal — primary action + identity */
  --accent:      #0e7d72;
  --accent-deep: #0b6359;
  --accent-ink:  #ffffff;
  --accent-soft: #e4f2f0;
  --accent-ring: #b9ddd8;

  /* brass — trust: protected, VIP, seal */
  --seal:      #a9772d;
  --seal-deep: #8a5f1f;
  --seal-soft: #f6efe0;

  /* status */
  --ok:     #1f9d6b;
  --warn:   #c4881a;
  --danger: #d6453c;
  --ok-soft:     #e4f3ec;
  --warn-soft:   #f7eedd;
  --danger-soft: #f8e6e4;

  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  /* radius */
  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(16,32,48,.05), 0 1px 1px rgba(16,32,48,.04);
  --sh-2: 0 6px 20px rgba(16,32,48,.10), 0 2px 6px rgba(16,32,48,.06);
  --sh-3: 0 24px 60px rgba(16,32,48,.22), 0 8px 24px rgba(16,32,48,.14);
  --ring: 0 0 0 3px var(--accent-ring);

  /* layout */
  --sidebar: 264px;
  --pane-list: 416px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}
@media (min-width: 1560px) { :root { --pane-list: 448px; } }

/* dark — applied explicitly, or by system preference when no theme is set */
html[data-theme="dark"] {
  --canvas:      #0c1116;
  --surface:     #151c23;
  --surface-2:   #11171d;
  --surface-3:   #1d262e;
  --ink:    #e8edf2;
  --ink-2:  #aab4bf;
  --muted:  #6e7985;
  --border:        #232c34;
  --border-strong: #303b45;
  --accent:      #2cbcaa;
  --accent-deep: #4fcfbf;
  --accent-ink:  #04201d;
  --accent-soft: #133431;
  --accent-ring: #1d4d47;
  --seal:      #d6a85c;
  --seal-deep: #e6bd78;
  --seal-soft: #2c2418;
  --ok:     #38c98c;  --ok-soft:     #122a22;
  --warn:   #e0a83c;  --warn-soft:   #2c2516;
  --danger: #f06a60;  --danger-soft: #2e1816;
  --sh-1: 0 1px 2px rgba(0,0,0,.30);
  --sh-2: 0 8px 24px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
  --sh-3: 0 28px 64px rgba(0,0,0,.60), 0 10px 28px rgba(0,0,0,.45);
}
@media (prefers-color-scheme: dark) {
  html[data-theme=""] {
    --canvas:#0c1116; --surface:#151c23; --surface-2:#11171d; --surface-3:#1d262e;
    --ink:#e8edf2; --ink-2:#aab4bf; --muted:#6e7985;
    --border:#232c34; --border-strong:#303b45;
    --accent:#2cbcaa; --accent-deep:#4fcfbf; --accent-ink:#04201d; --accent-soft:#133431; --accent-ring:#1d4d47;
    --seal:#d6a85c; --seal-deep:#e6bd78; --seal-soft:#2c2418;
    --ok:#38c98c; --ok-soft:#122a22; --warn:#e0a83c; --warn-soft:#2c2516; --danger:#f06a60; --danger-soft:#2e1816;
    --sh-1:0 1px 2px rgba(0,0,0,.30);
    --sh-2:0 8px 24px rgba(0,0,0,.45),0 2px 8px rgba(0,0,0,.35);
    --sh-3:0 28px 64px rgba(0,0,0,.60),0 10px 28px rgba(0,0,0,.45);
  }
}

/* ---- Reset / base ------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink);
  background: var(--canvas);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }
.kbd {
  font: 600 11px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 3px 6px; background: var(--surface);
}

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn.danger, .btn-act.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--ink-2); cursor: pointer; font-size: 17px; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.link-btn {
  background: none; border: 0; padding: 0; color: var(--accent); font: inherit;
  font-weight: 600; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* ---- Forms -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 10px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.rf-input, .schedule-input { width: auto; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px;
  transition: background .2s;
}
.switch .track::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; box-shadow: var(--sh-1); transition: transform .2s var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
  display: grid; grid-template-columns: var(--sidebar) var(--pane-list) 1fr;
  height: 100vh; height: 100dvh; overflow: hidden; background: var(--canvas);
}

/* ---- Sidebar ------------------------------------------------------------ */
.sidebar {
  grid-column: 1; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.sidebar-head { padding: var(--s5) var(--s4) var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.18);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text > span:first-child { font-weight: 700; font-size: 15.5px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }

.btn-compose {
  margin: 2px var(--s4) var(--s3); width: calc(100% - 2 * var(--s4));
  padding: 12px 16px; font-size: 14.5px; box-shadow: var(--sh-1);
}

.folders { padding: 0 var(--s3); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.folder, .nav-link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 11px; border: 0; background: none; cursor: pointer;
  border-radius: var(--r-sm); color: var(--ink-2); font-size: 14px; font-weight: 550;
  text-align: left; position: relative; transition: background .14s, color .14s;
}
.folder:hover, .nav-link:hover { background: var(--surface-3); color: var(--ink); }
.folder.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 650; }
.folder.active::before {
  content: ""; position: absolute; left: -9px;
  top: 50%; transform: translateY(-50%); width: 3px; height: 20px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.f-ico, .ni { width: 20px; text-align: center; opacity: .85; font-size: 15px; flex: none; }
.f-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-count, .nav-badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2);
}
.folder.active .f-count { background: var(--accent); color: var(--accent-ink); }
.nav-badge { background: var(--accent); color: var(--accent-ink); }
.folder-add { color: var(--accent); font-weight: 600; margin-top: 2px; }
.folder-add:hover { background: var(--accent-soft); }
.folder-sub { font-size: 13.5px; color: var(--muted); }
.folder-sub .f-ico { font-size: 11px; opacity: .5; }
.folder-sub.active { color: var(--accent-deep); }

.sidebar-foot { margin-top: auto; padding: var(--s2) var(--s3) var(--s3); display: flex; flex-direction: column; gap: 2px; }

.account { display: flex; align-items: center; gap: 11px; margin-top: var(--s3); padding: var(--s3) 11px 0; border-top: 1px solid var(--border); padding-top: var(--s3); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: var(--accent-deep);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.account-meta { min-width: 0; display: flex; flex-direction: column; }
.account-email { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-logout { font-size: 12px; color: var(--muted); }

/* ---- List column -------------------------------------------------------- */
.list-col {
  grid-column: 2; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.topbar {
  display: flex; align-items: center; gap: var(--s4); height: 66px; flex: none;
  padding: 0 var(--s5); border-bottom: 1px solid var(--border);
  background: var(--surface-2); position: relative;
}
.sync-bar {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform: scaleX(0);
  transform-origin: left; background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.sync-bar.syncing { animation: sync 1.1s var(--ease) infinite; }
@keyframes sync { 0%{transform:scaleX(0);opacity:1} 60%{transform:scaleX(1);opacity:1} 100%{transform:scaleX(1);opacity:0} }
.menu-btn { display: none; }
.sidebar-close { display: none; }
.search { flex: 1; position: relative; display: flex; align-items: center; }
.search input {
  width: 100%; padding: 10px 40px 10px 38px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); font-size: 14px;
}
.search-ico { position: absolute; left: 14px; color: var(--muted); font-size: 16px; pointer-events: none; }
.search .kbd { position: absolute; right: 10px; }
.rt { width: 28px; display: grid; place-items: center; flex: none; }
.rt span { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); transition: .3s; }
.rt.live span { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer; font-size: 17px; flex: none;
}
.theme-toggle::before { content: "☀"; }
html[data-theme="dark"] .theme-toggle::before { content: "☾"; }
@media (prefers-color-scheme: dark) { html[data-theme=""] .theme-toggle::before { content: "☾"; } }
.theme-toggle:hover { background: var(--surface-3); color: var(--ink); }

.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s5) var(--s5) var(--s3); flex-wrap: wrap; flex: none;
}
#folderTitle, .list-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.list-tools { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.chip:hover { background: var(--surface-3); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip-toggle[aria-pressed="true"] { background: var(--seal); color: #fff; }

/* ---- Message list ------------------------------------------------------- */
.msg-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px var(--s3) var(--s7); display: flex; flex-direction: column; gap: 2px; }

.msg-card {
  display: flex; align-items: flex-start; gap: var(--s3); position: relative;
  padding: 13px 14px 13px 22px; border-radius: var(--r); cursor: pointer;
  border: 1px solid transparent; transition: background .14s, box-shadow .14s;
}
.msg-card:hover { background: var(--surface); box-shadow: var(--sh-1), inset 3px 0 0 var(--accent-ring); }
.msg-card.selected { background: var(--surface); border-color: var(--border); box-shadow: var(--sh-1), inset 3px 0 0 var(--accent); }

.mc-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: var(--accent-deep);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring); margin-top: 1px;
}
.mc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mc-row1 { display: flex; align-items: baseline; gap: var(--s3); }
.mc-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.mc-date { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mc-subject { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-preview {
  font-size: 13px; color: var(--muted); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; max-height: 0; transition: opacity .25s ease;
}
.mc-preview.shown { opacity: 1; max-height: 1.6em; margin-top: 1px; }
.mc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.mc-flag { position: absolute; top: 14px; right: 14px; color: var(--seal); }

.msg-card.unread::before {
  content: ""; position: absolute; left: 9px; top: 22px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent);
}
.msg-card.unread .mc-from { font-weight: 750; }
.msg-card.unread .mc-subject { color: var(--ink); font-weight: 550; }

/* threads */
.thread-head::after { content: "›"; align-self: center; margin-left: 4px; color: var(--muted); font-size: 18px; transition: transform .18s var(--ease); }
.thread-head.open::after { transform: rotate(90deg); }
.thread-count {
  position: absolute; left: 50px; top: 11px; transform: translateX(-50%);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700;
  background: var(--seal); color: #fff; box-shadow: 0 0 0 2px var(--surface-2);
}
.thread-member { margin-left: 22px; border-left: 2px solid var(--border); border-radius: 0 var(--r) var(--r) 0; }

/* enter / arrive motion (hooks set by JS) */
.msg-card.enter { animation: cardIn .32s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-card.arrived { animation: arriveGlow 1.4s var(--ease); }
@keyframes arriveGlow { 0% { box-shadow: 0 0 0 0 var(--accent); background: var(--accent-soft); } 100% { box-shadow: none; } }

.empty-note { padding: var(--s7) var(--s4); text-align: center; color: var(--muted); font-size: 14px; }
.list-foot { padding: var(--s2) var(--s5) var(--s5); }

/* skeletons */
.skeleton-list { padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.sk { height: 64px; border-radius: var(--r); background: linear-gradient(100deg, var(--surface-3) 30%, var(--surface) 50%, var(--surface-3) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Tags --------------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .01em;
  border: 1px solid transparent;
}
.tag-vip       { background: var(--seal-soft); color: var(--seal-deep); border-color: color-mix(in srgb, var(--seal) 30%, transparent); }
.tag-high      { background: var(--accent-soft); color: var(--accent-deep); }
.tag-protected { background: var(--seal-soft); color: var(--seal-deep); }
.tag-fraud     { background: var(--danger-soft); color: var(--danger); }
.tag-spam      { background: var(--warn-soft); color: var(--warn); }
.tag-suspect   { background: var(--warn-soft); color: var(--warn); }

/* ==========================================================================
   Reading pane
   ========================================================================== */
.read-col { grid-column: 3; min-height: 0; overflow-y: auto; background: var(--surface); }

.read-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--s5); padding: var(--s8) var(--s7);
}
.seal { width: 96px; height: 96px; opacity: .9; }
.seal svg { width: 100%; height: 100%; }
.empty-title { font-size: 19px; }
.read-empty p { max-width: 380px; color: var(--muted); line-height: 1.6; margin: -8px 0 4px; }

.read-back { display: none; }
.read-head { padding: var(--s6) var(--s7) var(--s4); border-bottom: 1px solid var(--border); }
.read-subject { font-size: 22px; line-height: 1.3; margin-bottom: var(--s4); }
.read-meta { display: flex; align-items: center; gap: var(--s3); }
.rm-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: var(--accent-deep);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.rm-who { min-width: 0; flex: 1; }
.rm-from { font-weight: 650; }
.rm-addr { color: var(--muted); font-size: 13px; margin-left: 6px; }
.rm-to { font-size: 13px; color: var(--muted); }
.rm-date { font-size: 13px; color: var(--muted); white-space: nowrap; }

.read-actions {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--s7);
  border-bottom: 1px solid var(--border);
}
.btn-act {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background .14s, color .14s, border-color .14s;
}
.btn-act:hover { background: var(--surface-3); color: var(--ink); }
.btn-act.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.read-reply-row { display: flex; gap: 10px; padding: var(--s4) var(--s7) 0; }
.read-content { padding: var(--s6) var(--s7) var(--s8); }
.read-content .mail-text {
  max-width: 760px; font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word;
  background: #ffffff; color: #1b2330; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--r);
}
.mail-frame { width: 100%; max-width: 760px; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }
.read-loading { display: grid; place-items: center; height: 100%; }

/* banners (spam / fraud / remote content) */
.banner { margin: 0 var(--s7) var(--s4); padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); }
.banner-head { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.banner-score { margin-left: auto; font-size: 12px; font-family: var(--mono); color: var(--muted); }
.banner-reasons { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.banner-suggest { margin-top: 8px; font-size: 13px; }
.banner.v-fraud   { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.banner.v-spam, .banner.v-suspect { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.remote-bar { display: flex; align-items: center; gap: 10px; margin: 0 var(--s7) var(--s4); padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }

/* attachments */
.attachments { margin: var(--s6) var(--s7) 0; padding-top: var(--s5); border-top: 1px solid var(--border); max-width: 760px; }
.att-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.att {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2);
  text-decoration: none; color: var(--ink); transition: background .14s, border-color .14s, box-shadow .14s;
}
.att:hover { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--sh-1); text-decoration: none; }
.att-ico { font-size: 20px; flex: none; width: 26px; text-align: center; }
.att-meta { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 12px; color: var(--muted); }
.att-unsafe { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.att-unsafe .att-name { color: var(--danger); }

/* message history trail */
.msg-trail { margin: var(--s5) var(--s7); padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.trail-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.trail-row { display: flex; align-items: baseline; gap: var(--s3); padding: 6px 0; font-size: 13px; border-top: 1px solid var(--border); }
.trail-row:first-of-type { border-top: 0; }
.trail-act { font-weight: 600; min-width: 130px; }
.trail-who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail-when { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   Compose modal
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: var(--s5); }
/* sidebar drawer scrim — hidden until the drawer is opened (mobile only) */
.scrim { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(16,28,40,.45); backdrop-filter: blur(2px); }
.scrim.show { display: block; }
.modal::before { content: ""; position: absolute; inset: 0; background: rgba(16,28,40,.45); backdrop-filter: blur(2px); }
html[data-theme="dark"] .modal::before { background: rgba(0,0,0,.6); }
.modal-card {
  position: relative; z-index: 1; width: min(680px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  animation: pop .2s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s5) var(--s6); border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: var(--s5) var(--s6); overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: var(--s4) var(--s6); border-top: 1px solid var(--border); }
.modal-foot .spacer, .modal-foot .grow { flex: 1; }

.cc-toggle-row { display: flex; gap: 12px; margin-bottom: var(--s3); }
.cc-toggle-row .link-btn { font-size: 13px; }
.cc-fields { }
.compose-field { margin-bottom: var(--s3); }

.rte { border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.rte:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.rte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rte-btn { width: 32px; height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.rte-btn:hover { background: var(--surface-3); color: var(--ink); }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rte-editor { min-height: 220px; padding: 14px; font-size: 14.5px; line-height: 1.6; outline: none; overflow-y: auto; }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }

.attach-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); font-size: 12.5px; }
.ac-size { color: var(--muted); }
.ac-x { cursor: pointer; color: var(--muted); font-weight: 700; }
.ac-x:hover { color: var(--danger); }

.schedule-box { display: flex; align-items: center; gap: 10px; margin-top: var(--s3); padding: var(--s3); background: var(--surface-2); border-radius: var(--r-sm); }
.compose-status { font-size: 13px; color: var(--muted); }
.compose-status.err { color: var(--danger); }
.compose-status.ok { color: var(--ok); }

/* send animation */
.fx-plane { position: fixed; z-index: 200; pointer-events: none; font-size: 22px; }

/* ---- Recipient autocomplete --------------------------------------------- */
.ac-menu { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--sh-2); overflow: hidden auto; max-height: 264px; }
.ac-item { display: flex; flex-direction: column; gap: 1px; padding: 9px 13px; cursor: pointer; }
.ac-item:hover, .ac-item.active { background: var(--accent-soft); }
.ac-menu .ac-name { font-weight: 600; font-size: 13.5px; }
.ac-email { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Panels (settings, dashboard, audit, rules, protected/deleted, chat...)
   ========================================================================== */
.panel-view { grid-column: 2 / -1; grid-row: 1; min-height: 0; overflow-y: auto; background: var(--canvas); display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--s7); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.panel-head h2 { font-size: 21px; letter-spacing: -0.025em; }
.panel-head .grow { flex: 1; }

.settings-body { padding: var(--s6) var(--s7) var(--s8); max-width: 860px; width: 100%; margin: 0 auto; }
.dash, .dash-grid, .stat-grid { width: 100%; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s4); padding: var(--s6) var(--s7) var(--s8); }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--sh-1); margin-bottom: var(--s4); }
.dash-card h3 { font-size: 16px; margin-bottom: 4px; }
.settings-body .dash-card:last-child { margin-bottom: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.stat-val { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.info-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4); }

/* tiny sparkline + bar rows used in dashboard */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 48px; }
.spark-bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.vbar-row { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 10px; padding: 5px 0; }
.vbar-label { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbar-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.vbar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.vbar-n { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* data tables (audit, dashboard) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.act-pill, .status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.status-pill.s-sent { background: var(--ok-soft); color: var(--ok); }

/* diagnostics */
.diag-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.diag-row:first-child { border-top: 0; }
.diag-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.diag-ok { background: var(--ok); } .diag-warn { background: var(--warn); } .diag-bad { background: var(--danger); }
.diag-name { font-weight: 600; min-width: 150px; }
.diag-detail { flex: 1; font-size: 13px; text-align: right; color: var(--muted); }

/* two-factor */
.twofa-on { display: flex; align-items: center; gap: 10px; }
.twofa-steps { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); line-height: 1.85; }
.twofa-key { display: inline-block; font: 600 16px/1.4 var(--mono); letter-spacing: .12em; background: var(--surface-2); border: 1px solid var(--border-strong); padding: 8px 12px; border-radius: var(--r-sm); margin-top: 4px; user-select: all; }

/* settings rows */
.set-row { display: flex; align-items: center; gap: var(--s4); padding: 14px 0; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: 0; }
.set-row .grow { flex: 1; }
.set-name { font-weight: 600; }
.set-sub { font-size: 13px; color: var(--muted); }
.sig { width: 100%; min-height: 90px; }
.vol-range { width: 160px; }
.rf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* rules form */
.rule-form { display: grid; gap: var(--s3); }
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.rf-full { grid-column: 1 / -1; }
.rf-check { display: flex; align-items: center; gap: 8px; }
.rf-check input { width: auto; }
.rule-tag { display: inline-flex; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 700; }

/* ==========================================================================
   Team chat
   ========================================================================== */
.chat-wrap { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; }
.chat-contacts { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); padding: var(--s3); }
.chat-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: var(--s3) 10px 6px; }
.cc-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent-ring); flex: none; }
.cc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.cc-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.chat-contacts .nav-link.active, .chat-contacts > button.active { background: var(--accent-soft); }
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.chat-thread-head { display: flex; align-items: center; gap: 10px; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); font-weight: 650; }
.chat-log { flex: 1; overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: 10px; }
.cm-bubble { max-width: 64%; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); padding: 9px 13px; border-radius: 4px 14px 14px 14px; }
.cm-bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: transparent; border-radius: 14px 4px 14px 14px; }
.cm-who { font-size: 12px; font-weight: 700; margin-bottom: 2px; color: var(--accent-deep); }
.cm-bubble.mine .cm-who { color: rgba(255,255,255,.85); }
.cm-time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cm-bubble.mine .cm-time { color: rgba(255,255,255,.7); }
.mention { background: var(--seal-soft); color: var(--seal-deep); border-radius: 5px; padding: 0 3px; font-weight: 600; }
.chat-compose { display: flex; gap: 10px; padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }
.chat-compose input { flex: 1; }
.chat-add { display: flex; gap: 8px; padding: 10px; }
.presence { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.presence.live { background: var(--ok); }
.broadcast { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-wrap { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); box-shadow: var(--sh-2); animation: toastIn .26s var(--ease) both; max-width: 360px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.ok  { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast-ico { font-size: 16px; }
.toast-msg { font-size: 13.5px; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth-shell { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-main { display: grid; place-items: center; padding: var(--s7); background: var(--canvas); }
.auth-aside { position: relative; display: grid; place-items: center; padding: var(--s7); background: linear-gradient(150deg, var(--accent-deep), var(--accent)); color: #fff; overflow: hidden; }
.auth-aside-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-aside .brand-mark { background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.auth-points { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: 14px; }
.auth-points li { display: flex; gap: 10px; line-height: 1.5; opacity: .95; }
.auth-vendor { position: absolute; bottom: var(--s6); left: var(--s7); font-size: 12px; opacity: .8; }
.auth-card { width: min(380px, 100%); }
.auth-card h2 { font-size: 24px; margin-bottom: 4px; }
.auth-fine { font-size: 12.5px; margin-top: var(--s4); text-align: center; }
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; margin-bottom: var(--s4); }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

/* ==========================================================================
   Motion + a11y floor
   ========================================================================== */
.spinner { width: 26px; height: 26px; border: 3px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bump { animation: bump .3s var(--ease); }
@keyframes bump { 50% { transform: scale(1.18); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--sidebar) 1fr; }
  .read-col { position: fixed; inset: 0; z-index: 50; transform: translateX(100%); transition: transform .26s var(--ease); }
  .read-col.open { transform: none; }
  .read-back { display: inline-flex; }
  .panel-view { grid-column: 2; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn { display: inline-grid; }
  .sidebar-close { display: inline-grid; position: absolute; top: 16px; right: 14px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .26s var(--ease); box-shadow: var(--sh-3); }
  .sidebar.open { transform: none; }
  .scrim.show { z-index: 55; }
  .list-col, .panel-view { grid-column: 1; }
  .chat-wrap { grid-template-columns: 1fr; }
  .read-head, .read-actions, .read-content, .read-reply-row, .banner, .remote-bar, .attachments, .msg-trail { padding-left: var(--s5); padding-right: var(--s5); margin-left: var(--s5); margin-right: var(--s5); }
  .read-head, .read-actions, .read-content, .read-reply-row { margin-left: 0; margin-right: 0; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* touch targets */
@media (pointer: coarse) {
  .folder, .nav-link { padding: 12px 11px; }
  .msg-card { padding: 15px 14px 15px 22px; }
  .btn-act { padding: 10px 14px; }
}

/* ---- archive capture banner (admin tamper alert) ----------------------- */
.arch-banner {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--danger); color: #fff;
  font-size: 13px; line-height: 1.4;
  box-shadow: var(--sh-1);
}
.arch-banner-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; flex: none;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: archPulse 1.8s infinite;
}
@keyframes archPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.arch-banner-msg { flex: 1; }
.arch-banner .btn {
  background: rgba(255,255,255,.16); color: #fff;
  border-color: rgba(255,255,255,.32);
}
.arch-banner .btn:hover { background: rgba(255,255,255,.26); }
.arch-banner .icon-btn { color: #fff; }
.arch-banner .icon-btn:hover { background: rgba(255,255,255,.18); }

/* ---- global busy bar -------------------------------------------------- */
.busybar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--seal));
  z-index: 200; opacity: 0; transition: width .22s ease, opacity .3s ease;
  box-shadow: 0 0 8px rgba(0,0,0,.18);
}
.busybar.on { opacity: 1; }
.busybar.done { transition: width .2s ease, opacity .36s ease .12s; }

/* ---- compose send progress -------------------------------------------- */
.compose-progress { margin: 6px 0 2px; }
.cp-track {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--border); position: relative;
}
.cp-fill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--seal));
  transition: width .25s ease;
}
.compose-progress.cp-ok  .cp-fill { background: var(--ok); }
.compose-progress.cp-err .cp-fill { background: var(--danger); }
.compose-progress.cp-indet .cp-fill {
  width: 40% !important;
  animation: cpIndet 1.05s ease-in-out infinite;
  background: linear-gradient(90deg, var(--accent), var(--seal), var(--accent));
}
@keyframes cpIndet {
  0%   { margin-left: -42%; }
  100% { margin-left: 102%; }
}
.cp-stage {
  margin-top: 6px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.compose-progress.cp-ok  .cp-stage { color: var(--ok); }
.compose-progress.cp-err .cp-stage { color: var(--danger); }

/* ---- new-mail preview banners ----------------------------------------- */
.mail-banners {
  position: fixed; top: 14px; right: 14px; z-index: 180;
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 28px)); pointer-events: none;
}
.mail-banner {
  pointer-events: auto; cursor: pointer;
  display: flex; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-2, 0 12px 28px rgba(20,30,45,.16));
  transform: translateX(24px); opacity: 0;
  transition: transform .26s var(--ease, cubic-bezier(.2,.7,.3,1)), opacity .26s ease;
}
.mail-banner.in { transform: translateX(0); opacity: 1; }
.mail-banner:hover { border-color: var(--accent-ring); }
.mb-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.mb-body { min-width: 0; flex: 1; }
.mb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mb-from { font-weight: 650; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-x {
  flex: none; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.mb-x:hover { background: var(--surface-3); color: var(--ink); }
.mb-subject { font-size: 13px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-snippet { font-size: 12px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .mail-banners { top: 8px; right: 8px; left: 8px; width: auto; }
}

/* ---- operator (break-glass) console: hide all mailbox chrome ----------- */
.app-body[data-operator="1"] .btn-compose,
.app-body[data-operator="1"] #folders,
.app-body[data-operator="1"] [data-view="chat"],
.app-body[data-operator="1"] [data-view="protected"],
.app-body[data-operator="1"] [data-view="scheduled"],
.app-body[data-operator="1"] [data-view="snoozed"],
.app-body[data-operator="1"] #listCol,
.app-body[data-operator="1"] #readCol {
  display: none !important;
}
.op-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0 0 10px; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--seal-soft); color: var(--seal-deep);
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
}
