/* =========================================================
   Nrek Mail – Oberfläche
   ========================================================= */
:root {
  --accent: #0b57d0;
  --font: Roboto, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", Roboto, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --text: #1f1f1f;
  --text-2: #444746;
  --text-3: #5f6368;
  --hover: rgba(68, 71, 70, .08);
  --press: rgba(68, 71, 70, .14);
  --nav-hover: #e9eef6;
  --active: color-mix(in srgb, var(--accent) 22%, #fff);
  --compose: color-mix(in srgb, var(--accent) 24%, #fff);
  --compose-text: #001d35;
  --accent-text: var(--accent);
  --row-read: #f2f6fc;
  --row-unread: #ffffff;
  --row-selected: color-mix(in srgb, var(--accent) 16%, #fff);
  --border: #e1e3e1;
  --border-2: #c4c7c5;
  --search: #e9eef6;
  --menu: #ffffff;
  --chip: #e9eef6;
  --scrim: rgba(0, 0, 0, .4);
  --snack: #303030;
  --snack-text: #f2f2f2;
  --snack-action: #a8c7fa;
  --tooltip: #3c4043;
  --e1: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --e2: 0 1px 2px rgba(60, 64, 67, .3), 0 2px 6px 2px rgba(60, 64, 67, .15);
  --e3: 0 4px 8px 3px rgba(60, 64, 67, .15), 0 1px 3px rgba(60, 64, 67, .3);
  --row-h: 40px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-out: cubic-bezier(0, 0, 0, 1);
  --ease-in: cubic-bezier(.3, 0, 1, 1);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #111316;
  --surface: #1e1f22;
  --surface-2: #232428;
  --text: #e3e3e3;
  --text-2: #c4c7c5;
  --text-3: #9aa0a6;
  --hover: rgba(227, 227, 227, .08);
  --press: rgba(227, 227, 227, .14);
  --nav-hover: #26282c;
  --active: color-mix(in srgb, var(--accent) 42%, #1e1f22);
  --compose: color-mix(in srgb, var(--accent) 52%, #1e1f22);
  --compose-text: #ffffff;
  --accent-text: color-mix(in srgb, var(--accent) 45%, #fff);
  --row-read: #1a1b1e;
  --row-unread: #25262a;
  --row-selected: color-mix(in srgb, var(--accent) 30%, #1e1f22);
  --border: #2f3034;
  --border-2: #4a4c50;
  --search: #26282c;
  --menu: #2b2c30;
  --chip: #2b2c30;
  --scrim: rgba(0, 0, 0, .6);
  --snack: #e3e3e3;
  --snack-text: #1f1f1f;
  --snack-action: #0b57d0;
  --tooltip: #e3e3e3;
  --e1: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 3px 1px rgba(0, 0, 0, .3);
  --e2: 0 1px 2px rgba(0, 0, 0, .5), 0 2px 6px 2px rgba(0, 0, 0, .35);
  --e3: 0 4px 12px 3px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .5);
}
:root[data-density=compact] { --row-h: 32px; }
:root[data-density=comfy] { --row-h: 48px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font: 14px/1.43 var(--font); background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; transition: background-color .3s; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--accent-text); }
input, textarea, select { background: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.ic { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; display: block; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 40%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-3) 70%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Knöpfe ---------- */
.ib {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2);
  position: relative; overflow: hidden; flex-shrink: 0; transition: background-color .15s, color .15s; -webkit-tap-highlight-color: transparent;
}
.ib:hover { background: var(--hover); }
.ib:active { background: var(--press); }
.ib.sm { width: 32px; height: 32px; }
.ib.sm .ic { width: 18px; height: 18px; }
.ib.on { background: var(--active); color: var(--accent-text); }
.ib[disabled] { opacity: .38; pointer-events: none; }
.btn {
  height: 40px; padding: 0 24px; border-radius: 20px; font-weight: 500; letter-spacing: .1px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden; transition: box-shadow .2s, background-color .2s; white-space: nowrap;
}
.btn .ic { width: 18px; height: 18px; }
.btn.filled { background: var(--accent); color: #fff; }
.btn.filled:hover { box-shadow: var(--e1); }
.btn.tonal { background: var(--active); color: var(--text); }
.btn.outlined { border: 1px solid var(--border-2); color: var(--accent-text); }
.btn.outlined:hover, .btn.text:hover { background: var(--hover); }
.btn.text { color: var(--accent-text); padding: 0 12px; }
.btn.danger { background: #d93025; color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2);
  color: var(--text-2); font-weight: 500; font-size: 13px; position: relative; overflow: hidden; transition: background-color .15s;
}
.chip:hover { background: var(--hover); }
.chip .ic { width: 18px; height: 18px; }
.chip.on { background: var(--active); border-color: transparent; color: var(--text); }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .16; pointer-events: none; animation: ripple .55s var(--ease-out) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Tooltip */
#tooltip {
  position: fixed; z-index: 9000; background: var(--tooltip); color: var(--surface); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 4px;
  pointer-events: none; opacity: 0; transform: scale(.9); transition: opacity .12s, transform .12s var(--ease); white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis;
}
#tooltip.show { opacity: .94; transform: none; }

/* ---------- Ladebildschirm ---------- */
#splash { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: grid; place-items: center; transition: opacity .35s ease, visibility .35s; }
#splash.done { opacity: 0; visibility: hidden; }
.splash-inner { display: grid; justify-items: center; gap: 28px; }
.splash-logo { width: 92px; height: 92px; animation: splash-pop .6s var(--ease) both; }
.splash-bar { width: 220px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 18%, transparent); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 2px; animation: indet 1.2s var(--ease) infinite; }
.splash-name { font: 400 22px var(--font-display); color: var(--text-2); letter-spacing: -.2px; animation: fade-up .5s .15s var(--ease) both; }
@keyframes splash-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes fade-up { from { transform: translateY(8px); opacity: 0; } }
#loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 900; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
#loadbar.on { opacity: 1; }
#loadbar i { display: block; height: 100%; width: 30%; background: var(--accent); animation: indet 1s linear infinite; }

/* ---------- Logo ---------- */
.logo-mark { width: 40px; height: 40px; display: block; }

/* ---------- Kopfzeile ---------- */
.top { height: 64px; display: flex; align-items: center; padding: 8px 8px 8px 16px; gap: 4px; position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; width: 222px; padding-left: 4px; text-decoration: none; color: var(--text-2); flex-shrink: 0; }
.brand .logo-mark { width: 34px; height: 34px; }
.brand span { font: 400 22px/1 var(--font-display); letter-spacing: -.3px; color: var(--text-2); }
.search {
  flex: 1; max-width: 720px; height: 48px; border-radius: 24px; background: var(--search); display: flex; align-items: center; padding: 0 4px;
  position: relative; transition: background-color .2s, box-shadow .2s, border-radius .15s;
}
.search:focus-within, .search.open { background: var(--surface); box-shadow: var(--e1); }
.search.open { border-radius: 24px 24px 0 0; }
.search input { flex: 1; border: 0; outline: 0; height: 100%; font-size: 16px; padding: 0 4px; min-width: 0; }
.search input::placeholder { color: var(--text-2); }
.search-drop {
  position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-radius: 0 0 24px 24px; box-shadow: var(--e2); clip-path: inset(0 -20px -20px -20px);
  padding: 6px 0 12px; max-height: 70vh; overflow: auto; animation: drop .15s var(--ease);
}
.search-drop .sg { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 44px; cursor: pointer; }
.search-drop .sg:hover, .search-drop .sg.on { background: var(--hover); }
.search-drop .sg .ic { color: var(--text-3); }
.search-drop .sg .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-drop .sg .t b { font-weight: 700; }
.search-drop .sg small { color: var(--text-3); font-size: 12px; }
.search-drop .chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 16px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.search-drop .hint { color: var(--text-3); font-size: 12px; padding: 8px 20px 0; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; padding-left: 8px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; margin-left: 4px; transition: background-color .15s; }
.avatar-btn:hover { background: var(--hover); }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 500; font-size: 14px; flex-shrink: 0; user-select: none; background: var(--accent); }
.av.lg { width: 40px; height: 40px; font-size: 17px; }
.av.xl { width: 80px; height: 80px; font-size: 34px; }

/* ---------- Grundaufbau ---------- */
.shell { display: flex; height: calc(100% - 64px); }
.nav { width: 256px; flex-shrink: 0; display: flex; flex-direction: column; padding: 0 0 12px; transition: width .2s var(--ease); position: relative; z-index: 20; }
.nav-inner { display: flex; flex-direction: column; height: 100%; width: 256px; transition: width .2s var(--ease), box-shadow .2s, background-color .2s; padding-right: 16px; }
.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.nav-scroll:hover { scrollbar-color: color-mix(in srgb, var(--text-3) 40%, transparent) transparent; }
.compose-btn {
  height: 56px; margin: 8px 0 16px 8px; padding: 0 20px 0 16px; border-radius: 16px; background: var(--compose); color: var(--compose-text);
  display: inline-flex; align-items: center; gap: 12px; font-weight: 500; align-self: flex-start; position: relative; overflow: hidden; flex-shrink: 0;
  transition: box-shadow .25s var(--ease), padding .2s var(--ease), width .2s var(--ease); white-space: nowrap; box-shadow: none;
}
.compose-btn:hover { box-shadow: var(--e2); }
.compose-btn .ic { width: 24px; height: 24px; }
.ni {
  height: 32px; border-radius: 0 16px 16px 0; display: flex; align-items: center; gap: 18px; padding: 0 12px 0 26px; cursor: pointer; user-select: none;
  color: var(--text); position: relative; overflow: hidden; white-space: nowrap; transition: background-color .12s;
}
.ni:hover { background: var(--nav-hover); }
.ni.active { background: var(--active); font-weight: 700; }
.ni.active .ic { color: var(--text); }
.ni .ic { color: var(--text-2); }
.ni .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ni .cnt { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.ni.drop-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.ni .dot { width: 20px; display: grid; place-items: center; }
.ni .dot svg { width: 18px; height: 18px; }
.ni .ni-more { opacity: 0; margin-right: -6px; }
.ni:hover .ni-more { opacity: 1; }
.nav-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 26px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.nav-foot { padding: 12px 16px 0 26px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.quota { height: 4px; border-radius: 2px; background: var(--border); margin: 6px 0 4px; overflow: hidden; }
.quota i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .6s var(--ease); }

/* eingeklappt (wie Gmail: beim Überfahren ausklappen) */
.shell.collapsed .nav { width: 80px; }
.shell.collapsed .nav-inner { width: 80px; padding-right: 8px; }
.shell.collapsed .nav-inner:not(.peek) .lbl, .shell.collapsed .nav-inner:not(.peek) .cnt,
.shell.collapsed .nav-inner:not(.peek) .nav-h, .shell.collapsed .nav-inner:not(.peek) .nav-foot,
.shell.collapsed .nav-inner:not(.peek) .compose-btn span, .shell.collapsed .nav-inner:not(.peek) .ni-more { display: none; }
.shell.collapsed .nav-inner:not(.peek) .ni { width: 56px; padding: 0 0 0 18px; margin-left: 12px; border-radius: 16px; }
.shell.collapsed .nav-inner:not(.peek) .compose-btn { padding: 0; width: 56px; justify-content: center; margin-left: 12px; }
.shell.collapsed .nav-inner.peek { width: 256px; background: var(--bg); box-shadow: var(--e3); border-radius: 0 16px 16px 0; padding-right: 16px; }

/* Hauptbereich */
.main {
  flex: 1; min-width: 0; background: var(--surface); border-radius: 16px; margin: 0 0 16px; display: flex; flex-direction: column; overflow: hidden; position: relative;
  transition: background-color .3s;
}
.view { display: flex; flex-direction: column; min-height: 0; flex: 1; animation: view-in .22s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.view.slide { animation: view-slide .26s var(--ease) both; }
@keyframes view-slide { from { opacity: 0; transform: translateX(24px); } }

/* Werkzeugleiste */
.tb { height: 48px; display: flex; align-items: center; padding: 0 8px 0 4px; gap: 2px; flex-shrink: 0; }
.tb .sp { flex: 1; }
.tb .div { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.tb .range { font-size: 12px; color: var(--text-3); margin-right: 6px; white-space: nowrap; }
.tb-group { display: flex; align-items: center; gap: 2px; animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } }
.cbx { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; flex-shrink: 0; position: relative; overflow: hidden; }
.cbx:hover { background: var(--hover); }
.cb {
  width: 18px; height: 18px; border: 2px solid var(--text-3); border-radius: 2px; display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.cb svg { width: 14px; height: 14px; fill: #fff; transform: scale(0); transition: transform .15s var(--ease); }
.cb.on { background: var(--accent); border-color: var(--accent); }
.cb.on svg { transform: scale(1); }
.cb.part { background: var(--accent); border-color: var(--accent); }
.cb.part::after { content: ""; width: 10px; height: 2px; background: #fff; }
.sel-group { display: flex; align-items: center; border-radius: 20px; }
.sel-group .ib.drop { width: 20px; border-radius: 4px; margin-left: -8px; }
.sel-group .ib.drop .ic { width: 18px; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); position: relative; flex-shrink: 0; }
.tab {
  flex: 0 1 250px; min-width: 0; height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 16px; cursor: pointer; color: var(--text-2);
  font-weight: 500; position: relative; overflow: hidden; transition: color .2s, background-color .15s;
}
.tab:hover { background: var(--hover); }
.tab.on { color: var(--accent-text); }
.tab .ic { width: 20px; height: 20px; }
.tab .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; color: #fff; font-weight: 500; white-space: nowrap; animation: pop .3s var(--ease); }
.tab .sub { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ink { position: absolute; bottom: 0; height: 3px; background: var(--accent-text); border-radius: 3px 3px 0 0; transition: left .3s var(--ease), width .3s var(--ease); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } }

/* Liste */
.list { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.row {
  display: flex; align-items: center; height: var(--row-h); padding: 0 16px 0 4px; cursor: pointer; position: relative;
  background: var(--row-read); border-bottom: 1px solid var(--border); transition: box-shadow .12s, background-color .15s, height .25s var(--ease), opacity .2s;
  outline: none;
}
.row.unread { background: var(--row-unread); }
.row:hover { box-shadow: inset 1px 0 0 var(--border-2), inset -1px 0 0 var(--border-2), var(--e1); z-index: 2; }
.row.sel { background: var(--row-selected); }
.row.focus::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.row.leaving { height: 0 !important; opacity: 0; overflow: hidden; border-bottom-width: 0; }
.row.entering { animation: row-in .3s var(--ease) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(-4px); } }
.row .star, .row .imp { width: 32px; height: 32px; }
.ib.star.on, .ib.imp.on { background: transparent; }
.ib.star.on:hover, .ib.imp.on:hover { background: var(--hover); }
.row .star .ic { color: var(--text-3); }
.row .star.on .ic { color: #f4b400; animation: star-pop .35s var(--ease); }
.row .imp .ic { width: 18px; color: var(--text-3); }
.row .imp.on .ic { color: #f4b400; }
@keyframes star-pop { 0% { transform: scale(.4) rotate(-40deg); } 60% { transform: scale(1.3); } }
.row .from { width: 200px; flex-shrink: 0; padding: 0 12px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.row .from .n { color: var(--text-3); font-size: 12px; margin-left: 4px; font-weight: 400; }
.row .from .dr { color: #d93025; }
.row .mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0; overflow: hidden; white-space: nowrap; }
.row .mid .lbls { display: flex; gap: 4px; margin-right: 6px; flex-shrink: 0; }
.row .subj { color: var(--text); overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.row .snip { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 30px; }
.row .date { width: 76px; text-align: right; font-size: 12px; color: var(--text-3); flex-shrink: 0; white-space: nowrap; }
.row .clip { color: var(--text-3); width: 18px; height: 18px; margin: 0 6px; flex-shrink: 0; }
.row.unread .from, .row.unread .subj, .row.unread .date { font-weight: 700; color: var(--text); }
.row .acts { position: absolute; right: 8px; top: 0; bottom: 0; display: none; align-items: center; background: inherit; padding-left: 12px; }
.row:hover .acts { display: flex; animation: fade-in .1s; }
.row:hover .date, .row:hover .clip { visibility: hidden; }
.row .acts .ib { width: 36px; height: 36px; }
.row .atts { display: none; }
:root[data-density=comfy] .row { height: auto; min-height: var(--row-h); flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
:root[data-density=comfy] .row .atts { display: flex; gap: 8px; width: 100%; padding: 2px 0 6px 278px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: 14px; border: 1px solid var(--border-2); font-size: 13px; color: var(--text-2); max-width: 200px; background: var(--surface); }
.att-chip .ic { width: 16px; height: 16px; }
.att-chip .ic.pdf { fill: #d93025; } .att-chip .ic.img { fill: #d93025; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbl-chip { font-size: 12px; padding: 0 6px; border-radius: 4px; line-height: 18px; font-weight: 500; white-space: nowrap; }
.list-foot { padding: 16px 24px 24px; display: flex; justify-content: space-between; color: var(--text-3); font-size: 12px; gap: 16px; flex-wrap: wrap; }

/* Leere Zustände */
.empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 60px 24px; color: var(--text-2); animation: fade-up .3s var(--ease); }
.empty svg.big { width: 120px; height: 120px; margin: 0 auto 20px; display: block; }
.empty h3 { font: 400 20px var(--font-display); color: var(--text); margin-bottom: 6px; }
.empty p { color: var(--text-3); max-width: 380px; margin: 0 auto; }
.banner { display: flex; align-items: center; gap: 16px; padding: 12px 20px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--border); background: var(--surface-2); flex-shrink: 0; }
.banner .ic { color: var(--text-3); }

/* Skelett beim Laden */
.skel-row { height: var(--row-h); display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.skel { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 40%, transparent) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Unterhaltung lesen ---------- */
.thread { flex: 1; overflow-y: auto; padding: 0 0 48px; }
.th-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 8px 72px; }
.th-head h1 { font: 400 22px/1.4 var(--font-display); color: var(--text); flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; word-break: break-word; }
.th-head .lbl-chip { font-size: 12px; line-height: 20px; display: inline-flex; align-items: center; gap: 2px; }
.th-head .lbl-chip button { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; opacity: .7; }
.th-head .lbl-chip button:hover { opacity: 1; background: rgba(0,0,0,.1); }
.th-head .lbl-chip button .ic { width: 12px; height: 12px; }
.msg { margin: 0 16px 0 16px; border-bottom: 1px solid var(--border); animation: fade-in .25s; }
.msg:last-of-type { border-bottom: 0; }
.msg-h { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0 8px; cursor: pointer; }
.msg-h .av { margin-top: 2px; }
.msg-who { flex: 1; min-width: 0; }
.msg-who .nm { font-weight: 700; color: var(--text); }
.msg-who .em { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.msg-who .to { color: var(--text-3); font-size: 12px; display: inline-flex; align-items: center; gap: 2px; border-radius: 4px; }
.msg-who .to:hover { color: var(--text); }
.msg-who .to .ic { width: 16px; height: 16px; }
.msg-who .snip { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { display: flex; align-items: center; gap: 2px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.msg-meta .ib .ic { width: 20px; }
.msg-meta .star.on .ic { color: #f4b400; }
.msg.collapsed .msg-h { padding: 12px 0; }
.msg.collapsed .msg-b, .msg.collapsed .msg-meta .ib:not(.star) { display: none; }
.msg-details { margin: 4px 0 6px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-3); font-size: 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; max-width: 520px; cursor: auto; animation: drop .15s var(--ease); }
.msg-details b { color: var(--text-2); font-weight: 400; text-align: right; }
.msg-b { padding: 4px 0 20px 56px; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.msg-b .body { white-space: pre-wrap; font-size: 14px; }
.msg-b .quoted-toggle { margin-top: 8px; width: 28px; height: 18px; border-radius: 9px; background: var(--chip); display: inline-grid; place-items: center; }
.msg-b .quoted-toggle .ic { width: 18px; color: var(--text-2); }
.msg-b .quoted { color: var(--text-3); border-left: 2px solid var(--border-2); padding-left: 12px; margin-top: 8px; white-space: pre-wrap; }
.msg-atts { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0 0 56px; }
.msg-atts-h { padding: 18px 0 0 56px; color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); margin: 16px 0 0 56px; padding-left: 0; }
.att-card { width: 180px; height: 120px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .2s; background: var(--surface); }
.att-card:hover { box-shadow: var(--e2); }
.att-card .pv { flex: 1; display: grid; place-items: center; background: var(--surface-2); }
.att-card .pv .ic { width: 44px; height: 44px; }
.att-card .pv.img { background: linear-gradient(135deg, #f6d365, #fda085); }
.att-card .pv.img2 { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.att-card .pv.img3 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.att-card .pv.img .ic, .att-card .pv.img2 .ic, .att-card .pv.img3 .ic { fill: rgba(255,255,255,.85); }
.att-card .nm { padding: 8px 10px; font-size: 12px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }
.att-card .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.att-card .ov { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 8px; opacity: 0; transition: opacity .15s; color: #fff; }
.att-card:hover .ov { opacity: 1; }
.att-card .ov .ib { color: #fff; background: rgba(255,255,255,.15); width: 32px; height: 32px; }
.reply-area { padding: 8px 16px 0 72px; }
.reply-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.reply-btns .btn { height: 36px; padding: 0 18px 0 14px; color: var(--text-2); border: 1px solid var(--border-2); }
.reply-btns .btn:hover { background: var(--hover); }
.smart { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.smart button { height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid var(--accent-text); color: var(--accent-text); font-weight: 500; position: relative; overflow: hidden; transition: background-color .15s; animation: fade-up .3s var(--ease) both; }
.smart button:nth-child(2) { animation-delay: .05s; } .smart button:nth-child(3) { animation-delay: .1s; }
.smart button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Antworten direkt in der Unterhaltung */
.inline-reply { display: flex; gap: 16px; animation: fade-up .25s var(--ease); }
.inline-reply .box { flex: 1; border-radius: 8px; box-shadow: var(--e2); background: var(--surface); overflow: hidden; }
.inline-reply .rhead { display: flex; align-items: center; gap: 4px; padding: 6px 8px; color: var(--text-2); font-size: 14px; }
.inline-reply .rhead .who { flex: 1; min-width: 0; overflow: hidden; }

/* ---------- Verfassen-Fenster ---------- */
#composers { position: fixed; right: 16px; bottom: 0; z-index: 400; display: flex; align-items: flex-end; gap: 16px; pointer-events: none; flex-direction: row-reverse; }
.cw {
  width: 540px; height: 560px; max-height: calc(100vh - 80px); background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--e3), 0 8px 10px 1px rgba(0,0,0,.14);
  display: flex; flex-direction: column; pointer-events: auto; transform-origin: bottom right; animation: cw-in .3s var(--ease) both;
  transition: height .25s var(--ease), width .25s var(--ease);
}
@keyframes cw-in { from { transform: translateY(40px) scale(.96); opacity: 0; } }
.cw.closing { animation: cw-out .2s var(--ease-in) forwards; }
@keyframes cw-out { to { transform: translateY(40px) scale(.96); opacity: 0; } }
.cw.min { height: 48px; width: 280px; }
.cw.min .cw-b { display: none; }
.cw.max { position: fixed; inset: 6vh 8vw; width: auto; height: auto; max-height: none; border-radius: 16px; z-index: 500; animation: cw-max .25s var(--ease); }
@keyframes cw-max { from { transform: scale(.92); opacity: .6; } }
.cw-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 450; animation: fade-in .2s; pointer-events: auto; }
.cw-h { height: 48px; flex-shrink: 0; display: flex; align-items: center; padding: 0 8px 0 16px; background: var(--nav-hover); border-radius: 16px 16px 0 0; cursor: pointer; gap: 2px; }
.cw.max .cw-h { border-radius: 16px 16px 0 0; }
.cw-h .t { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-h .ib { width: 32px; height: 32px; border-radius: 6px; }
.cw-h .ib .ic { width: 18px; height: 18px; }
.cw-b { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cw-f { display: flex; align-items: center; gap: 8px; margin: 0 16px; border-bottom: 1px solid var(--border); min-height: 40px; color: var(--text-3); flex-wrap: wrap; padding: 2px 0; position: relative; }
.cw-f > label { font-size: 14px; }
.cw-f input { flex: 1; min-width: 120px; border: 0; outline: 0; height: 34px; color: var(--text); }
.cw-f .cc-toggle { font-size: 14px; color: var(--text-2); padding: 2px 4px; border-radius: 4px; }
.cw-f .cc-toggle:hover { text-decoration: underline; }
.rcp {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 2px; border-radius: 13px; background: var(--chip); color: var(--text); font-size: 13px;
  animation: pop .25s var(--ease); max-width: 260px;
}
.rcp .av { width: 22px; height: 22px; font-size: 11px; }
.rcp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcp.bad { background: #fce8e6; color: #b3261e; }
.rcp button { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.rcp button:hover { background: var(--hover); }
.rcp button .ic { width: 14px; height: 14px; }
.ac { position: absolute; left: 0; top: 100%; z-index: 20; background: var(--menu); border-radius: 8px; box-shadow: var(--e3); min-width: 320px; padding: 6px 0; animation: drop .12s var(--ease); }
.ac .it { display: flex; align-items: center; gap: 12px; padding: 6px 16px; cursor: pointer; }
.ac .it.on, .ac .it:hover { background: var(--hover); }
.ac .it .tx { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.ac .it small { color: var(--text-3); }
.cw-ed { flex: 1; overflow-y: auto; padding: 12px 16px; outline: 0; line-height: 1.55; color: var(--text); min-height: 80px; overflow-wrap: anywhere; }
.cw-ed:empty::before { content: attr(data-ph); color: var(--text-3); }
.cw-ed blockquote { border-left: 2px solid var(--border-2); padding-left: 12px; color: var(--text-3); margin: 8px 0; }
.cw-atts { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 6px; }
.cw-att { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 4px 4px 10px; font-size: 13px; animation: fade-up .2s var(--ease); position: relative; overflow: hidden; }
.cw-att b { font-weight: 500; color: var(--accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-att small { color: var(--text-3); }
.cw-att .prog { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); animation: up-prog .8s var(--ease) forwards; }
@keyframes up-prog { from { width: 0; } to { width: 100%; opacity: 0; } }
.fmt { display: flex; align-items: center; gap: 2px; margin: 4px 12px 0; padding: 2px 4px; border-radius: 10px; background: var(--surface-2); box-shadow: var(--e1); flex-wrap: wrap; animation: drop .15s var(--ease); }
.fmt .ib { width: 30px; height: 30px; border-radius: 6px; }
.fmt .ib .ic { width: 18px; height: 18px; }
.fmt .div { width: 1px; height: 18px; background: var(--border-2); margin: 0 4px; }
.cw-foot { display: flex; align-items: center; gap: 2px; padding: 10px 12px 12px 16px; flex-shrink: 0; }
.send-split { display: flex; margin-right: 8px; border-radius: 20px; overflow: hidden; }
.send-split .s1 { flex-shrink: 0; height: 40px; padding: 0 16px 0 22px; background: var(--accent); color: #fff; font-weight: 500; position: relative; overflow: hidden; transition: filter .15s; }
.send-split .s2 { height: 40px; width: 34px; background: var(--accent); color: #fff; display: grid; place-items: center; border-left: 1px solid rgba(255,255,255,.3); position: relative; overflow: hidden; }
.send-split .s1:hover, .send-split .s2:hover { filter: brightness(1.1); }
.send-split .ic { fill: #fff; }
.cw-foot .ib { width: 36px; height: 36px; }
.cw-foot .cw-note { font-size: 12px; color: var(--text-3); margin-left: auto; margin-right: 4px; white-space: nowrap; transition: opacity .3s; }
.cw-drop { position: absolute; inset: 48px 0 0; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 2px dashed var(--accent); border-radius: 0 0 12px 12px; display: grid; place-items: center; color: var(--accent-text); font-weight: 500; z-index: 5; }

/* ---------- Menüs, Dialoge ---------- */
#layer { position: fixed; inset: 0; z-index: 800; pointer-events: none; }
#layer > * { pointer-events: auto; }
.menu {
  position: fixed; background: var(--menu); border-radius: 8px; box-shadow: var(--e3); padding: 8px 0; min-width: 200px; max-width: 340px; max-height: 80vh; overflow-y: auto;
  animation: menu-in .14s var(--ease) both; transform-origin: var(--ox, top) var(--oy, left);
}
@keyframes menu-in { from { opacity: 0; transform: scale(.92); } }
.menu.out { animation: menu-out .1s ease forwards; }
@keyframes menu-out { to { opacity: 0; transform: scale(.96); } }
.mi { display: flex; align-items: center; gap: 14px; height: 36px; padding: 0 16px; cursor: pointer; white-space: nowrap; color: var(--text); position: relative; user-select: none; }
.mi:hover, .mi.kb { background: var(--hover); }
.mi .ic { color: var(--text-2); width: 20px; height: 20px; }
.mi .k { margin-left: auto; padding-left: 24px; color: var(--text-3); font-size: 12px; }
.mi .chk { margin-left: auto; padding-left: 16px; }
.mi .cb { width: 16px; height: 16px; }
.mi.dis { opacity: .38; pointer-events: none; }
.m-sep { height: 1px; background: var(--border); margin: 8px 0; }
.m-h { padding: 6px 16px 4px; font-size: 12px; color: var(--text-3); }
.m-search { margin: 0 12px 6px; display: flex; align-items: center; border-bottom: 1px solid var(--border-2); }
.m-search input { flex: 1; border: 0; outline: 0; height: 32px; }
.scrim { position: fixed; inset: 0; background: var(--scrim); animation: fade-in .2s; z-index: 1; }
.dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; background: var(--surface); border-radius: 28px; padding: 24px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; box-shadow: var(--e3); animation: dlg-in .25s var(--ease);
}
@keyframes dlg-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.94); } }
.dialog h2 { font: 400 24px var(--font-display); margin-bottom: 16px; }
.dialog p { color: var(--text-2); line-height: 1.5; }
.dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.field { display: block; position: relative; margin-top: 12px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border-2); border-radius: 4px; height: 56px; padding: 18px 16px 6px; outline: 0; font-size: 16px; color: var(--text); transition: border-color .15s;
}
.field textarea { height: auto; min-height: 120px; padding-top: 24px; resize: vertical; line-height: 1.5; }
.field span { position: absolute; left: 12px; top: 18px; padding: 0 4px; color: var(--text-3); font-size: 16px; pointer-events: none; transition: all .15s var(--ease); background: var(--surface); }
.field input:focus, .field textarea:focus, .field select:focus { border: 2px solid var(--accent); padding-left: 15px; }
.field input:focus + span, .field input:not(:placeholder-shown) + span, .field textarea:focus + span, .field textarea:not(:placeholder-shown) + span, .field select + span {
  top: -8px; font-size: 12px; color: var(--accent-text);
}
.field input:not(:focus) + span, .field textarea:not(:focus) + span { color: var(--text-3); }
.kbd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 32px; }
.kbd-grid div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
kbd { font: 500 12px var(--font); background: var(--chip); border-radius: 4px; padding: 2px 8px; color: var(--text); white-space: nowrap; }

/* Snackbar */
#snacks { position: fixed; left: 24px; bottom: 24px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.snack {
  min-width: 288px; max-width: 568px; min-height: 48px; background: var(--snack); color: var(--snack-text); border-radius: 4px; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 16px; box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px rgba(0,0,0,.14); animation: snack-in .25s var(--ease) both;
}
.snack.out { animation: snack-out .2s var(--ease-in) forwards; }
@keyframes snack-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes snack-out { to { opacity: 0; transform: translateY(12px); } }
.snack .t { flex: 1; padding: 6px 0; }
.snack .a { color: var(--snack-action); font-weight: 500; padding: 8px 12px; border-radius: 4px; position: relative; overflow: hidden; }
.snack .a:hover { background: rgba(255,255,255,.08); }
.snack .ib { color: var(--snack-text); width: 36px; height: 36px; }

/* Konto-Menü & Apps */
.acc { width: 400px; max-width: calc(100vw - 16px); background: var(--bg); border-radius: 28px; padding: 12px; text-align: center; }
.acc .em { color: var(--text-2); font-weight: 500; padding: 8px 0; }
.acc .av.xl { margin: 12px auto 8px; display: grid; }
.acc h3 { font: 400 22px var(--font-display); margin-bottom: 16px; }
.acc .card { background: var(--surface); border-radius: 20px; margin-top: 12px; overflow: hidden; text-align: left; padding: 6px 0; }
.acc .card .mi { height: 52px; padding: 0 24px; }
.acc .foot { font-size: 12px; color: var(--text-3); padding: 14px 0 6px; }
.apps-grid { display: grid; grid-template-columns: repeat(3, 98px); gap: 4px; padding: 16px; }
.app-t { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 10px; border-radius: 12px; cursor: pointer; font-size: 13px; position: relative; overflow: hidden; color: var(--text); }
.app-t:hover { background: var(--hover); }
.app-t i { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.app-t i .ic { width: 28px; height: 28px; fill: #fff; }

/* Schnelleinstellungen */
.qs { position: fixed; top: 64px; right: 0; bottom: 0; width: 360px; max-width: 100vw; background: var(--surface); z-index: 700; border-radius: 16px 0 0 0; box-shadow: var(--e3); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .3s var(--ease); }
.qs.open { transform: none; }
.qs-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 24px; font: 400 20px var(--font-display); }
.qs-b { overflow-y: auto; padding: 0 24px 24px; }
.qs-sec { border-top: 1px solid var(--border); padding: 16px 0; }
.qs-sec h4 { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 12px; }
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tcard { border-radius: 12px; border: 2px solid var(--border); padding: 6px; cursor: pointer; text-align: center; font-size: 12px; color: var(--text-2); transition: border-color .15s, transform .15s; }
.tcard:hover { transform: translateY(-2px); }
.tcard.on { border-color: var(--accent); color: var(--text); }
.tcard i { display: block; height: 56px; border-radius: 8px; margin-bottom: 6px; overflow: hidden; position: relative; }
.tcard.l i { background: #f6f8fc; box-shadow: inset 0 0 0 1px #e1e3e1; }
.tcard.d i { background: #111316; }
.tcard.s i { background: linear-gradient(135deg, #f6f8fc 50%, #111316 50%); box-shadow: inset 0 0 0 1px #c4c7c5; }
.tcard i::before { content: ""; position: absolute; left: 6px; top: 8px; width: 30%; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.tcard i::after { content: ""; position: absolute; left: 6px; right: 6px; top: 22px; bottom: 6px; border-radius: 6px; background: rgba(127,127,127,.18); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.sw { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s; }
.sw:hover { transform: scale(1.1); }
.sw .ic { fill: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.sw.on .ic { transform: scale(1); }
.radio { display: flex; align-items: center; gap: 14px; padding: 8px 0; cursor: pointer; }
.radio .r { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-2); display: grid; place-items: center; transition: border-color .15s; flex-shrink: 0; }
.radio .r::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .2s var(--ease); }
.radio.on .r { border-color: var(--accent); }
.radio.on .r::after { transform: scale(1); }
.radio .d { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 12px; }
.radio .dens { width: 44px; height: 28px; border-radius: 6px; border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-around; padding: 3px 5px; }
.radio .dens i { height: 2px; background: var(--border-2); border-radius: 1px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.switch .s { width: 52px; height: 32px; border-radius: 16px; border: 2px solid var(--text-3); position: relative; transition: background-color .2s, border-color .2s; flex-shrink: 0; }
.switch .s::after { content: ""; position: absolute; left: 6px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: all .2s var(--ease); }
.switch.on .s { background: var(--accent); border-color: var(--accent); }
.switch.on .s::after { left: 22px; top: 2px; width: 24px; height: 24px; background: #fff; }

/* ---------- Rechte Leiste ---------- */
.rail { width: 56px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.rail hr { width: 20px; border: 0; border-top: 1px solid var(--border-2); margin: 4px 0; }
.rail .ib .ic { width: 22px; height: 22px; }
.side { width: 0; flex-shrink: 0; overflow: hidden; transition: width .25s var(--ease), margin .25s var(--ease); }
.side.open { width: 320px; margin-left: 12px; }
.side-in { width: 320px; height: calc(100% - 16px); background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; }
.side-h { display: flex; align-items: center; padding: 12px 8px 4px 20px; gap: 4px; }
.side-h .t { flex: 1; font-size: 12px; font-weight: 500; letter-spacing: .8px; text-transform: uppercase; color: var(--text-2); }
.side-b { flex: 1; overflow-y: auto; padding: 4px 16px 16px; animation: fade-in .25s; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; font-weight: 500; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; gap: 2px; }
.cal b { color: var(--text-3); font-weight: 500; padding: 6px 0; }
.cal span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; cursor: pointer; position: relative; transition: background-color .12s; }
.cal span:hover { background: var(--hover); }
.cal span.o { color: var(--text-3); opacity: .5; }
.cal span.td { background: var(--accent); color: #fff; font-weight: 500; }
.cal span.ev::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-text); }
.cal span.td.ev::after { background: #fff; }
.evt { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; margin-top: 8px; background: var(--surface-2); animation: fade-up .25s var(--ease) both; }
.evt i { width: 4px; border-radius: 2px; }
.evt small { display: block; color: var(--text-3); }
.task { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; animation: fade-up .2s var(--ease); }
.task:hover { background: var(--hover); }
.task .tx { flex: 1; transition: color .2s; }
.task.done .tx { text-decoration: line-through; color: var(--text-3); }
.task .ib { opacity: 0; }
.task:hover .ib { opacity: 1; }
.task-add { display: flex; align-items: center; gap: 10px; padding: 8px 4px; color: var(--accent-text); font-weight: 500; }
.task-add input { flex: 1; border: 0; border-bottom: 1px solid transparent; outline: 0; padding: 4px 0; color: var(--text); }
.task-add input:focus { border-bottom-color: var(--accent); }
.note { width: 100%; min-height: 260px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; outline: 0; resize: vertical; color: var(--text); line-height: 1.5; box-shadow: var(--e1); }
.contact { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background-color .12s; }
.contact:hover { background: var(--hover); }
.contact .tx { flex: 1; min-width: 0; }
.contact small { display: block; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Einstellungsseite ---------- */
.settings { flex: 1; overflow-y: auto; }
.set-h { padding: 18px 24px 0; font: 400 22px var(--font-display); }
.set-tabs { display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid var(--border); position: relative; overflow-x: auto; }
.set-tabs .tab { flex: 0 0 auto; height: 44px; padding: 0 16px; font-size: 14px; }
.set-body { padding: 8px 24px 40px; max-width: 980px; animation: fade-in .2s; }
.set-row { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.set-row > b { font-weight: 500; }
.set-row > b small { display: block; color: var(--text-3); font-weight: 400; margin-top: 4px; }
.set-row .ctl { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.set-row .ctl .field { width: 100%; max-width: 520px; margin-top: 4px; }
.set-actions { display: flex; gap: 12px; padding: 24px 0; }
.lbl-table { width: 100%; border-collapse: collapse; }
.lbl-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.lbl-table td:first-child { display: flex; align-items: center; gap: 10px; }
.lbl-table .dotc { width: 14px; height: 14px; border-radius: 4px; }

/* Ziehen */
.drag-ghost { position: fixed; z-index: 2000; pointer-events: none; background: var(--accent); color: #fff; border-radius: 6px; padding: 6px 12px; font-weight: 500; box-shadow: var(--e3); }

/* =========================================================
   Mittlere Breite
   ========================================================= */
@media (max-width: 1100px) {
  .rail, .side { display: none; }
  .main { margin-right: 8px; }
  .row .from { width: 160px; }
}
@media (max-width: 1100px) and (min-width: 768px) {
  .shell:not(.expanded) .nav { width: 80px; }
  .shell:not(.expanded) .nav-inner { width: 80px; padding-right: 8px; }
  .shell:not(.expanded) .nav-inner:not(.peek) .lbl, .shell:not(.expanded) .nav-inner:not(.peek) .cnt,
  .shell:not(.expanded) .nav-inner:not(.peek) .nav-h, .shell:not(.expanded) .nav-inner:not(.peek) .nav-foot,
  .shell:not(.expanded) .nav-inner:not(.peek) .compose-btn span, .shell:not(.expanded) .nav-inner:not(.peek) .ni-more { display: none; }
  .shell:not(.expanded) .nav-inner:not(.peek) .ni { width: 56px; padding: 0 0 0 18px; margin-left: 12px; border-radius: 16px; }
  .shell:not(.expanded) .nav-inner:not(.peek) .compose-btn { padding: 0; width: 56px; justify-content: center; margin-left: 12px; }
  .shell:not(.expanded) .nav-inner.peek { width: 256px; background: var(--bg); box-shadow: var(--e3); border-radius: 0 16px 16px 0; padding-right: 16px; }
  .brand { width: auto; padding-right: 12px; }
  .brand span { display: none; }
  .tab .tl { font-size: 13px; }
}

/* =========================================================
   Handy
   ========================================================= */
.fab, .m-only { display: none; }
@media (max-width: 767px) {
  body { background: var(--surface); }
  .top { height: 64px; padding: 8px 12px; }
  .brand, #navToggle, .top-actions > :not(.avatar-btn), .rail, .side { display: none !important; }
  .row .snip { flex: none; white-space: nowrap; }
  .search { max-width: none; height: 48px; background: var(--search); border-radius: 24px; padding-left: 4px; }
  .search .m-menu { display: inline-grid; }
  .search .tune-btn { display: none; }
  .top-actions { position: absolute; right: 18px; top: 12px; padding: 0; z-index: 2; }
  .search { padding-right: 48px; }
  .shell { height: calc(100% - 64px); }
  .nav { position: fixed; inset: 0; width: auto; z-index: 600; pointer-events: none; padding: 0; }
  .nav::before { content: ""; position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; }
  .nav-inner { width: 300px; max-width: 85vw; background: var(--surface); transform: translateX(-102%); transition: transform .28s var(--ease); padding: 12px 12px 12px 0; border-radius: 0 16px 16px 0; box-shadow: var(--e3); }
  .shell.drawer .nav { pointer-events: auto; }
  .shell.drawer .nav::before { opacity: 1; }
  .shell.drawer .nav-inner { transform: none; }
  .nav .compose-btn { display: none; }
  .nav .m-brand { display: flex; align-items: center; gap: 8px; padding: 8px 20px 16px; font: 400 20px var(--font-display); color: var(--text-2); }
  .nav .m-brand .logo-mark { width: 28px; height: 28px; }
  .ni { height: 48px; border-radius: 0 24px 24px 0; padding-left: 24px; }
  .main { margin: 0; border-radius: 0; }
  .tb { padding: 0 4px; }
  .tabs { display: none; }
  .m-cat { display: block; padding: 10px 16px 4px; font-size: 12px; color: var(--text-3); font-weight: 500; }
  .row { height: auto !important; padding: 12px 16px; align-items: flex-start; background: var(--surface) !important; border-bottom: 0; gap: 14px; }
  .row.unread { background: var(--surface) !important; }
  .row.sel { background: var(--row-selected) !important; }
  .row:hover { box-shadow: none; }
  .row .cbx, .row .imp, .row .acts, .row .clip { display: none !important; }
  .row .m-av { display: grid; margin-top: 2px; }
  .row .m-av .av { width: 40px; height: 40px; font-size: 17px; transition: transform .25s var(--ease); }
  .row.sel .m-av .av { transform: rotateY(180deg); background: var(--accent) !important; color: transparent; }
  .row .m-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding-right: 26px; }
  .row .m-top { margin-right: -26px; }
  .row .m-top { display: flex; align-items: baseline; gap: 8px; }
  .row .from { width: auto; flex: 1; padding: 0; font-size: 16px; color: var(--text-2); }
  .row .date { width: auto; font-size: 12px; }
  .row .mid { flex-direction: column; align-items: stretch; }
  .row .subj { font-size: 14px; color: var(--text-2); }
  .row .snip { font-size: 14px; }
  .row .mid .lbls { display: none; }
  .row .star { position: absolute; right: 8px; bottom: 6px; }
  .row.unread .from, .row.unread .subj { color: var(--text); }
  .row:hover .date { visibility: visible; }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 300; height: 56px; border-radius: 16px; background: var(--compose); color: var(--compose-text);
    align-items: center; gap: 12px; padding: 0 20px 0 16px; font-weight: 500; box-shadow: var(--e3); transition: padding .25s var(--ease), gap .25s var(--ease), transform .25s var(--ease);
    overflow: hidden;
  }
  .fab .ic { width: 24px; height: 24px; }
  .fab span { max-width: 120px; transition: max-width .25s var(--ease), opacity .2s; white-space: nowrap; }
  .fab.shrink { padding: 0 16px; gap: 0; }
  .fab.shrink span { max-width: 0; opacity: 0; }
  .fab.hide { transform: translateY(120px); }
  .th-head { padding: 16px; }
  .msg { margin: 0 4px; }
  .msg-b { padding-left: 0; }
  .msg-atts, .msg-atts-h { padding-left: 0; margin-left: 0; }
  .reply-area { padding: 8px 16px; }
  .inline-reply .av { display: none; }
  .tb .range { display: none; }
  #composers { left: 0; right: 0; }
  .cw { width: 100vw !important; height: 100% !important; max-height: none; position: fixed; inset: 0; border-radius: 0; animation: cw-mob .3s var(--ease) both; }
  @keyframes cw-mob { from { transform: translateY(100%); } }
  .cw-h { border-radius: 0; background: var(--surface); }
  .cw.min { height: 100% !important; }
  .cw-h .ib.minb, .cw-h .ib.maxb { display: none; }
  #snacks { left: 8px; right: 8px; bottom: 84px; align-items: stretch; }
  .snack { min-width: 0; max-width: none; }
  .qs { top: 0; border-radius: 0; width: 100vw; }
  .set-row { grid-template-columns: 1fr; gap: 10px; }
  .menu { max-width: calc(100vw - 16px); }
  .swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #1e8e3e; color: #fff; z-index: -1; }
  .swipe-bg .ic { fill: #fff; width: 24px; height: 24px; }
}
@media (min-width: 768px) {
  .m-only, .m-cat, .row .m-av, .m-brand { display: none !important; }
  .row .m-body, .row .m-top { display: contents; }
  .row .cbx, .row .star, .row .imp { order: 0; }
  .row .from { order: 1; } .row .mid { order: 2; } .row .clip { order: 3; } .row .date { order: 4; } .row .atts { order: 5; }
}
@media (max-width: 767px) { .row .snip .dash { display: none; } }
@media print {
  .top, .nav, .rail, .side, .tb, #composers, #snacks, .reply-area { display: none !important; }
  body, .main { overflow: visible; height: auto; background: #fff; }
  .shell { height: auto; }
}

/* HTML-Mails */
.html-wrap { margin-top: 4px; }
.mail-frame { width: 100%; border: 0; display: block; min-height: 60px; background: transparent; color-scheme: normal; }
.img-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 12px; margin-bottom: 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.img-bar .ic { width: 18px; height: 18px; color: var(--text-3); }
.img-bar .btn { height: 32px; }

/* Windows-App: eigene Fensterknöpfe */
.win-ctl { display: none; }
html.desktop .win-ctl { display: flex; align-self: flex-start; margin: -8px -8px 0 8px; height: 32px; }
html.desktop .win-ctl button { width: 46px; height: 32px; display: grid; place-items: center; color: var(--text-2); transition: background-color .1s; }
html.desktop .win-ctl button svg { width: 10px; height: 10px; }
html.desktop .win-ctl button:hover { background: var(--hover); }
html.desktop .win-ctl button.x:hover { background: #c42b1c; color: #fff; }
html.desktop .top { padding-right: 8px; user-select: none; }
html.desktop .win-bar { position: fixed; top: 0; left: 0; right: 0; height: 32px; display: flex; justify-content: flex-end; z-index: 50; }
html.desktop .win-bar .win-ctl { margin: 0; }
@media (max-width: 767px) { html.desktop .top-actions { right: 150px; } }

/* Kontowechsel */
.acc .card .acc-row { height: 60px; gap: 14px; }
.acc-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acc-tx b { font-weight: 500; color: var(--text); }
.acc-tx small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Admin-Tab ---------- */
.adm h3 { display: flex; align-items: center; gap: 10px; font: 500 18px var(--font-display); margin: 28px 0 12px; }
.adm h3:first-child { margin-top: 4px; }
.adm h3 .ic { width: 22px; height: 22px; fill: var(--text-2); }
.adm-count { background: var(--accent-soft, color-mix(in srgb, var(--accent) 14%, transparent)); color: var(--accent-text); border-radius: 12px; padding: 1px 10px; font-size: 13px; }
.adm-empty { color: var(--text-2); font-size: 14px; margin: 6px 0 4px; }
.adm-req { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border-2); border-radius: 16px; margin-bottom: 10px; background: var(--surface); animation: dlg-in .3s var(--ease) both; }
.adm-req .av { flex: none; }
.adm-tx { flex: 1; min-width: 0; }
.adm-tx small { display: block; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-addr { color: var(--text-2); }
.adm-act { display: flex; gap: 6px; flex: none; }
.adm-badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-2); color: var(--text-2); border-radius: 8px; padding: 0 8px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.adm-badge .ic { width: 14px; height: 14px; fill: currentColor; }
.adm-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.adm-row small { color: var(--text-3); margin-left: auto; }
.adm-hist summary { cursor: pointer; color: var(--accent-text); font-weight: 500; padding: 6px 0; }
.adm-table td:first-child { display: flex; align-items: center; gap: 12px; }
.adm-table td small { display: block; color: var(--text-2); font-size: 12px; }
.adm-q { width: 160px; }
.adm-q .quota { margin: 0 0 4px; }
@media (max-width: 700px) { .adm-req { flex-wrap: wrap; } .adm-act { width: 100%; justify-content: flex-end; } .adm-q { display: none; } }
.ph-prev .av { transition: transform .2s var(--ease); }
.ph-prev .av:hover { transform: scale(1.04); }
