/* E-Mail-Desktop-Client der Verwaltung: dreispaltiges Layout, Nachrichtenliste, Lesebereich, Verfassen-Fenster.
   Farben: Aubergine #643182, Flieder #b394cc, Hintergrund #f4f1f6. Dunkelmodus über html[data-workspace-theme="dark"] / body[data-theme="dark"]. */
.md-shell, .md-compose, .md-dock, .md-help, .md-menu, .md-lightbox {
  --md-accent:#643182; --md-accent-strong:#4e2566; --md-accent-2:#b394cc; --md-bg:#f4f1f6; --md-surface:#ffffff; --md-soft:#faf8fc;
  --md-line:#e5deea; --md-line-strong:#d4c8dc; --md-text:#2b2432; --md-muted:#756c7c; --md-tint:#f1e9f5; --md-hover:#f7f3f9; --md-active:#ece2f2;
  --md-unread:#643182; --md-danger:#a83a3a; --md-warning:#8a6413; --md-success:#3f7654; --md-shadow:0 14px 40px rgba(60,30,80,.18);
  color:var(--md-text); font-size:13.5px;
}
html[data-workspace-theme="dark"] :is(.md-shell,.md-compose,.md-dock,.md-help,.md-menu,.md-lightbox), body[data-theme="dark"] :is(.md-shell,.md-compose,.md-dock,.md-help,.md-menu,.md-lightbox) {
  --md-accent:#b394cc; --md-accent-strong:#ddb0e6; --md-accent-2:#8a5fa8; --md-bg:#17191b; --md-surface:#222628; --md-soft:#282c2f;
  --md-line:#3b4145; --md-line-strong:#4c545a; --md-text:#ecf0ee; --md-muted:#acb8b6; --md-tint:#372b3d; --md-hover:#2c3134; --md-active:#3a2f42;
  --md-unread:#ddb0e6; --md-danger:#f19b96; --md-warning:#e9c27b; --md-success:#99d5b3; --md-shadow:0 16px 44px rgba(0,0,0,.55);
}
.md-shell *, .md-compose *, .md-help * { box-sizing:border-box; }
.md-shell { display:flex; flex-direction:column; min-height:520px; border:1px solid var(--md-line); border-radius:14px; background:var(--md-surface); overflow:hidden; box-shadow:0 1px 0 rgba(100,49,130,.04); }
.md-shell button { font:inherit; color:inherit; cursor:pointer; }
.md-shell button:disabled { opacity:.45; cursor:default; }
.md-shell svg { width:16px; height:16px; flex:0 0 auto; }
.md-shell :focus-visible { outline:2px solid var(--md-accent); outline-offset:1px; border-radius:6px; }

/* Werkzeugleiste */
.md-toolbar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 12px; border-bottom:1px solid var(--md-line); background:var(--md-soft); }
.md-toolbar .md-sep { width:1px; height:24px; background:var(--md-line-strong); margin:0 4px; }
.md-btn { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0 11px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--md-text); white-space:nowrap; transition:background .12s, border-color .12s; }
.md-btn:hover:not(:disabled) { background:var(--md-tint); }
.md-btn.primary { background:var(--md-accent); color:#fff; border-color:var(--md-accent); font-weight:600; }
.md-btn.primary:hover:not(:disabled) { background:var(--md-accent-strong); }
html[data-workspace-theme="dark"] .md-btn.primary { background:#643182; border-color:#8a55a8; color:#fff; }
.md-btn.outline { border-color:var(--md-line-strong); background:var(--md-surface); }
.md-btn.danger { color:var(--md-danger); }
.md-btn.icon { padding:0; width:32px; justify-content:center; }
.md-btn.active, .md-btn[aria-pressed="true"] { background:var(--md-active); color:var(--md-accent); }
.md-btn svg { width:15px; height:15px; }
.md-toolbar .md-grow { flex:1 1 auto; }
.md-search { position:relative; display:flex; align-items:center; gap:6px; min-width:260px; flex:1 1 340px; max-width:560px; min-height:34px; padding:0 8px 0 12px; border:1px solid var(--md-line-strong); border-radius:999px; background:var(--md-surface); }
.md-search:focus-within { border-color:var(--md-accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--md-accent) 16%, transparent); }
.md-search svg { color:var(--md-accent); }
.md-search input { flex:1; min-width:0; border:0; background:transparent; color:inherit; font:inherit; font-size:13.5px; padding:6px 0; outline:none; }
.md-search input::placeholder { color:var(--md-muted); }
.md-search select { border:0; background:transparent; color:var(--md-muted); font:inherit; font-size:12px; max-width:150px; }
.md-search .md-btn.icon { width:28px; min-height:28px; }
.md-search-help { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:30; padding:10px 14px; border:1px solid var(--md-line); border-radius:12px; background:var(--md-surface); box-shadow:var(--md-shadow); font-size:12.5px; color:var(--md-muted); display:none; }
.md-search:focus-within .md-search-help:not([hidden]) { display:block; }
.md-search-help code { display:inline-block; margin:2px 4px 2px 0; padding:1px 7px; border-radius:6px; background:var(--md-tint); color:var(--md-accent); font-size:12px; }

/* Körper */
.md-body { display:flex; flex:1 1 auto; min-height:0; position:relative; }
.md-folders { flex:0 0 auto; width:230px; min-width:170px; max-width:420px; overflow:auto; padding:10px 8px 16px; border-right:1px solid var(--md-line); background:var(--md-soft); }
.md-resizer { flex:0 0 6px; cursor:col-resize; position:relative; z-index:2; background:transparent; margin:0 -3px; }
.md-resizer:hover, .md-resizer.dragging { background:color-mix(in srgb, var(--md-accent) 22%, transparent); }
.md-main { flex:0 0 auto; width:380px; min-width:260px; max-width:60%; display:flex; flex-direction:column; min-height:0; }
.md-list { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; border-right:1px solid var(--md-line); background:var(--md-surface); }
.md-reader { flex:1 1 0; min-width:0; display:flex; flex-direction:column; min-height:0; background:var(--md-surface); }
.md-hresizer { display:none; }
.md-shell[data-layout="bottom"] .md-main { flex:1 1 0; width:auto !important; max-width:none; }
.md-shell[data-layout="bottom"] .md-list { flex:0 0 45%; border-right:0; border-bottom:1px solid var(--md-line); }
.md-shell[data-layout="bottom"] .md-reader { flex:1 1 0; min-height:0; }
.md-shell[data-layout="bottom"] .md-resizer.list { display:none; }
.md-shell[data-layout="bottom"] .md-hresizer { display:block; flex:0 0 6px; cursor:row-resize; margin:-3px 0; position:relative; z-index:2; }
.md-shell[data-layout="bottom"] .md-hresizer:hover { background:color-mix(in srgb, var(--md-accent) 22%, transparent); }
.md-shell[data-layout="off"] .md-main { flex:1 1 0; width:auto !important; max-width:none; }
.md-shell[data-layout="off"] .md-list { border-right:0; }
.md-shell[data-layout="off"] .md-reader, .md-shell[data-layout="off"] .md-resizer.list { display:none; }

/* Ordnerbaum */
.md-account { margin-bottom:8px; }
.md-account-head { display:flex; align-items:center; gap:6px; width:100%; padding:6px 8px; border:0; border-radius:8px; background:transparent; text-align:left; }
.md-account-head:hover { background:var(--md-tint); }
.md-account-head svg { color:var(--md-accent); transition:transform .15s; }
.md-account[data-collapsed="true"] .md-account-head svg.chev { transform:rotate(-90deg); }
.md-account-head strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12.5px; }
.md-account-head small { color:var(--md-muted); font-size:11px; }
.md-account[data-collapsed="true"] .md-folder-list { display:none; }
.md-account-head .md-count { margin-left:auto; }
.md-folder { display:flex; align-items:center; gap:8px; width:100%; min-height:32px; padding:0 8px 0 14px; border:0; border-radius:8px; background:transparent; text-align:left; color:var(--md-text); }
.md-folder:hover { background:var(--md-tint); }
.md-folder.active { background:var(--md-active); color:var(--md-accent); font-weight:600; }
.md-folder.drop-target { outline:2px dashed var(--md-accent); outline-offset:-2px; background:var(--md-tint); }
.md-folder svg { width:15px; height:15px; color:var(--md-accent-2); }
.md-folder.active svg { color:var(--md-accent); }
.md-folder span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-count { min-width:20px; height:19px; padding:0 6px; display:inline-grid; place-items:center; border-radius:10px; background:var(--md-accent); color:#fff; font-size:11px; font-weight:700; }
.md-count.soft { background:var(--md-tint); color:var(--md-accent); }
.md-folder-group { display:flex; align-items:center; justify-content:space-between; margin:10px 8px 4px 12px; font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--md-muted); }
.md-folder-group .md-btn.icon { width:22px; min-height:22px; }
.md-folder-group .md-btn.icon svg { width:13px; height:13px; }
.md-folder-row { display:flex; align-items:center; }
.md-folder-row .md-folder { flex:1; }
.md-folder-row .md-btn.icon { width:26px; min-height:26px; opacity:0; }
.md-folder-row:hover .md-btn.icon, .md-folder-row .md-btn.icon:focus-visible { opacity:1; }
.md-sync { margin:14px 10px 0; padding:10px 0 0; border-top:1px solid var(--md-line); color:var(--md-muted); font-size:11.5px; line-height:1.45; }
.md-sync i { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; background:#b8862d; }
.md-sync i.online { background:#3f7d57; }

/* Nachrichtenliste */
.md-list-head { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 10px; border-bottom:1px solid var(--md-line); background:var(--md-surface); }
.md-list-head .md-check { margin:0 4px 0 6px; }
.md-list-head .md-title { flex:1 1 auto; min-width:0; font-weight:650; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-list-head .md-title small { color:var(--md-muted); font-weight:400; font-size:12px; margin-left:6px; }
.md-chips { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:6px 10px 8px; border-bottom:1px solid var(--md-line); background:var(--md-soft); }
.md-chip { display:inline-flex; align-items:center; gap:5px; min-height:26px; padding:0 10px; border:1px solid var(--md-line-strong); border-radius:999px; background:var(--md-surface); color:var(--md-text); font-size:12px; }
.md-chip:hover { border-color:var(--md-accent); }
.md-chip.active { background:var(--md-accent); border-color:var(--md-accent); color:#fff; }
.md-chip svg { width:12px; height:12px; }
.md-chip select { border:0; background:transparent; color:inherit; font:inherit; font-size:12px; }
.md-chip.active select { color:#fff; }
.md-chip.active select option { color:#2b2432; }
.md-chip input[type="date"] { border:0; background:transparent; color:inherit; font:inherit; font-size:12px; padding:0; width:118px; }
.md-check { width:16px; height:16px; accent-color:var(--md-accent); cursor:pointer; margin:0; }
.md-rows { flex:1 1 auto; min-height:0; overflow:auto; scroll-behavior:smooth; }
.md-group { position:sticky; top:0; z-index:1; padding:5px 14px; font-size:10.5px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--md-muted); background:var(--md-soft); border-bottom:1px solid var(--md-line); }
.md-row { position:relative; display:grid; grid-template-columns:22px 36px minmax(0,1fr) 30px; column-gap:10px; align-items:start; padding:10px 10px 10px 8px; border-bottom:1px solid var(--md-line); border-left:3px solid transparent; background:var(--md-surface); cursor:default; user-select:none; }
.md-row:hover { background:var(--md-hover); }
.md-row.active { background:var(--md-active); border-left-color:var(--md-accent); }
.md-row.selected { background:color-mix(in srgb, var(--md-accent) 10%, var(--md-surface)); }
.md-row.selected.active { background:var(--md-active); }
.md-row.unread { border-left-color:var(--md-unread); }
.md-row.unread .md-row-subject, .md-row.unread .md-row-from { font-weight:700; color:var(--md-text); }
.md-row.dragging { opacity:.5; }
.md-row .md-check { margin-top:11px; margin-left:2px; opacity:.35; }
.md-row:hover .md-check, .md-row.selected .md-check, .md-shell.has-selection .md-row .md-check { opacity:1; }
.md-row-avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; background:hsl(var(--mc-hue,280) 34% 88%); color:hsl(var(--mc-hue,280) 40% 32%); font-size:12px; font-weight:700; letter-spacing:.03em; margin-top:2px; }
.md-row-avatar.user { background:var(--md-accent); color:#fff; }
.md-row-avatar.unknown { background:var(--md-tint); color:var(--md-muted); }
html[data-workspace-theme="dark"] .md-row-avatar { background:hsl(var(--mc-hue,280) 24% 32%); color:hsl(var(--mc-hue,280) 60% 88%); }
.md-row-main { min-width:0; display:grid; gap:2px; }
.md-row-top { display:flex; align-items:baseline; gap:8px; min-width:0; }
.md-row-from { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; color:var(--md-text); }
.md-row-time { flex:0 0 auto; font-size:11.5px; color:var(--md-muted); white-space:nowrap; }
.md-row.unread .md-row-time { color:var(--md-accent); font-weight:600; }
.md-row-subject { display:flex; align-items:center; gap:6px; min-width:0; font-size:13.5px; line-height:1.3; color:var(--md-text); }
.md-row-subject > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-row-subject svg { width:13px; height:13px; color:var(--md-accent); }
.md-row-preview { font-size:12.5px; color:var(--md-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-row-meta { display:flex; flex-wrap:wrap; gap:4px; margin-top:3px; }
.md-row-meta:empty { display:none; }
.md-tag { display:inline-flex; align-items:center; gap:4px; max-width:100%; padding:1px 8px; border-radius:999px; background:hsl(var(--tag-hue,280) 40% 92%); color:hsl(var(--tag-hue,280) 40% 30%); font-size:11px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html[data-workspace-theme="dark"] .md-tag { background:hsl(var(--tag-hue,280) 24% 30%); color:hsl(var(--tag-hue,280) 60% 90%); }
.md-tag.case { background:var(--md-tint); color:var(--md-accent); }
.md-tag.due { background:#fff2d6; color:#7a5510; }
.md-tag.overdue { background:#fbe3e1; color:#8f2d26; }
.md-tag.snooze { background:#e5eef7; color:#2f5a86; }
.md-tag.team { background:#e8f2ec; color:#2f5c41; }
.md-tag.thread { background:var(--md-accent); color:#fff; }
.md-tag.origin { font-size:9.5px; letter-spacing:.06em; padding:1px 6px; }
.md-tag.origin.extern { background:#fbe9d6; color:#7a4a10; }
.md-tag.origin.intern { background:#e8f2ec; color:#2f5c41; }
html[data-workspace-theme="dark"] :is(.md-tag.due,.md-tag.overdue,.md-tag.snooze,.md-tag.team,.md-tag.origin) { filter:saturate(.8) brightness(.85); }
.md-row-side { display:grid; gap:4px; justify-items:center; margin-top:6px; }
.md-star { width:26px; height:26px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:var(--md-line-strong); }
.md-star:hover { background:var(--md-tint); color:var(--md-accent); }
.md-star[aria-pressed="true"] { color:#c58a00; }
.md-star[aria-pressed="true"] svg { fill:currentColor; }
.md-star svg { width:15px; height:15px; }
.md-row.draft { border-left-color:#b8862d; }
.md-row.draft .md-row-from { color:#8b6822; }
.md-shell[data-density="compact"] .md-row { padding-top:5px; padding-bottom:5px; grid-template-columns:22px minmax(0,1fr) 30px; }
.md-shell[data-density="compact"] .md-row-avatar, .md-shell[data-density="compact"] .md-row-preview { display:none; }
.md-shell[data-density="compact"] .md-row-main { grid-template-columns:minmax(120px,32%) minmax(0,1fr); grid-template-areas:"from subject" "meta meta"; align-items:center; column-gap:10px; }
.md-shell[data-density="compact"] .md-row-top { grid-area:from; }
.md-shell[data-density="compact"] .md-row-subject { grid-area:subject; }
.md-shell[data-density="compact"] .md-row-meta { grid-area:meta; margin-top:1px; }
.md-shell[data-density="compact"] .md-row-time { display:none; }
.md-shell[data-density="compact"] .md-row-side { margin-top:0; }
.md-empty { display:grid; place-items:center; gap:8px; padding:48px 20px; text-align:center; color:var(--md-muted); }
.md-empty svg { width:36px; height:36px; color:var(--md-accent-2); }
.md-empty strong { color:var(--md-text); font-size:15px; }
.md-list-foot { display:flex; align-items:center; gap:8px; padding:6px 12px; border-top:1px solid var(--md-line); color:var(--md-muted); font-size:12px; }
.md-list-foot .md-btn { min-height:26px; padding:0 8px; font-size:12px; }
.md-list-foot .md-grow { flex:1; }

/* Massenaktionen */
.md-bulk { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 12px; border-bottom:1px solid var(--md-line); background:var(--md-tint); }
.md-bulk strong { font-size:13px; color:var(--md-accent); margin-right:6px; }

/* Lesebereich */
.md-reader-actions { display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:8px 14px; border-bottom:1px solid var(--md-line); background:var(--md-surface); position:sticky; top:0; z-index:2; }
.md-reader-scroll { flex:1 1 auto; min-height:0; overflow:auto; padding:18px 26px 32px; }
.md-reader-empty { flex:1; display:grid; place-items:center; color:var(--md-muted); text-align:center; padding:40px; }
.md-reader-empty svg { width:52px; height:52px; color:var(--md-accent-2); margin-bottom:12px; }
.md-reader-empty kbd { display:inline-block; padding:1px 7px; border:1px solid var(--md-line-strong); border-radius:6px; background:var(--md-soft); font-family:Consolas,monospace; font-size:12px; }
.md-subject { margin:0 0 12px; font-size:22px; font-weight:650; line-height:1.25; letter-spacing:-.01em; overflow-wrap:anywhere; color:var(--md-text); }
.md-subject-line { display:flex; align-items:flex-start; gap:12px; }
.md-subject-line .md-subject { flex:1; }
.md-banner { display:flex; align-items:center; gap:10px; margin:0 0 12px; padding:8px 12px; border-radius:10px; font-size:12.5px; }
.md-banner.extern { background:#fbf1e6; color:#6b4410; border:1px solid #f0d9b8; }
.md-banner.intern { background:#e9f3ed; color:#2f5c41; border:1px solid #c8e0d0; }
.md-banner.snooze { background:#e8eff7; color:#2f5a86; border:1px solid #c6d7ea; }
html[data-workspace-theme="dark"] .md-banner { filter:saturate(.7) brightness(.8); }
.md-banner svg { width:16px; height:16px; }
.md-head { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:14px; align-items:start; padding-bottom:14px; border-bottom:1px solid var(--md-line); }
.md-head-avatar { width:48px; height:48px; display:grid; place-items:center; border-radius:50%; background:hsl(var(--mc-hue,280) 40% 86%); color:hsl(var(--mc-hue,280) 40% 32%); font-size:15px; font-weight:700; }
.md-head-avatar.user { background:var(--md-accent); color:#fff; }
.md-head-avatar.unknown { background:var(--md-tint); color:var(--md-muted); }
html[data-workspace-theme="dark"] .md-head-avatar { background:hsl(var(--mc-hue,280) 24% 32%); color:hsl(var(--mc-hue,280) 60% 88%); }
.md-head-meta { min-width:0; display:grid; gap:3px; font-size:13px; color:var(--md-muted); }
.md-head-meta strong { font-size:15px; color:var(--md-text); }
.md-head-meta span { overflow-wrap:anywhere; }
.md-head-meta .mc-recipient.contact, .md-head-meta .mc-recipient.user { color:var(--md-text); font-weight:600; border-bottom:1px dotted var(--md-accent-2); cursor:help; }
.md-head-meta button.link { border:0; background:transparent; color:var(--md-accent); padding:0; font:inherit; font-size:12px; text-decoration:underline; cursor:pointer; }
.md-head-time { text-align:right; font-size:12.5px; color:var(--md-muted); white-space:nowrap; display:grid; gap:4px; justify-items:end; }
.md-sender-card { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 16px; align-items:start; margin:12px 0; padding:12px 16px; border:1px solid var(--md-line); border-radius:12px; background:linear-gradient(135deg,var(--md-soft),var(--md-surface)); }
.md-sender-card dl { display:grid; grid-template-columns:auto 1fr; gap:3px 12px; margin:6px 0 0; font-size:12.5px; }
.md-sender-card dt { color:var(--md-muted); }
.md-sender-card dd { margin:0; overflow-wrap:anywhere; }
.md-sender-card .md-kind { display:inline-block; padding:2px 9px; border-radius:999px; background:var(--md-tint); color:var(--md-accent); font-size:11px; font-weight:700; margin-left:8px; }
.md-sender-card.unknown .md-kind { background:#f6e9d6; color:#7a5510; }
.md-sender-actions { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.md-sender-actions .md-btn { justify-content:flex-start; border-color:var(--md-line-strong); background:var(--md-surface); min-height:30px; font-size:12.5px; }
.md-sender-cases { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:6px; }
.md-sender-cases .md-tag { cursor:pointer; border:0; font:inherit; font-size:11.5px; padding:3px 10px; }
.md-facts { display:flex; flex-wrap:wrap; gap:8px 18px; margin:12px 0 0; padding:10px 14px; border-radius:10px; background:var(--md-soft); font-size:12.5px; color:var(--md-muted); }
.md-facts b { color:var(--md-text); font-weight:600; }
.md-facts .md-tag { vertical-align:middle; }
.md-facts button.link { border:0; background:transparent; color:var(--md-accent); padding:0; font:inherit; font-size:12.5px; text-decoration:underline; cursor:pointer; }
.md-attachments { margin:14px 0 0; border:1px solid var(--md-line); border-radius:12px; overflow:hidden; }
.md-attachments-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 14px; background:var(--md-soft); font-size:12.5px; color:var(--md-muted); }
.md-attachments-head strong { display:inline-flex; align-items:center; gap:6px; color:var(--md-text); }
.md-attachments-head svg { width:14px; height:14px; color:var(--md-accent); }
.md-attachment-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:8px; padding:10px 12px; }
.md-attachment { display:grid; grid-template-columns:44px minmax(0,1fr); gap:10px; align-items:center; padding:8px; border:1px solid var(--md-line); border-radius:10px; background:var(--md-surface); }
.md-attachment.blocked { opacity:.7; }
.md-attachment-thumb { width:44px; height:44px; display:grid; place-items:center; border-radius:8px; background:var(--md-tint); color:var(--md-accent); overflow:hidden; cursor:pointer; border:0; padding:0; }
.md-attachment-thumb img { width:100%; height:100%; object-fit:cover; }
.md-attachment-thumb svg { width:20px; height:20px; }
.md-attachment-thumb .ext { font-size:10px; font-weight:800; letter-spacing:.05em; }
.md-attachment-body { min-width:0; display:grid; gap:2px; }
.md-attachment-body strong { font-size:12.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-attachment-body span { font-size:11.5px; color:var(--md-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-attachment-actions { display:flex; gap:4px; flex-wrap:wrap; margin-top:3px; }
.md-attachment-actions .md-btn { min-height:24px; padding:0 8px; font-size:11.5px; border-color:var(--md-line-strong); }
.md-attachment-actions .md-btn.icon { width:24px; }
.md-attachment-actions .md-btn svg { width:13px; height:13px; }
.md-body-text { margin:18px 0 0; max-width:860px; font-size:14.5px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--md-text); }
.md-body-text .quote { display:block; margin:4px 0; padding-left:12px; border-left:3px solid var(--md-accent-2); color:var(--md-muted); }
.md-body-text a { color:var(--md-accent); }
.md-thread { margin:22px 0 0; border-top:1px solid var(--md-line); padding-top:12px; }
.md-thread > h3 { margin:0 0 8px; font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--md-muted); }
.md-thread-item { border:1px solid var(--md-line); border-radius:10px; margin-bottom:8px; background:var(--md-surface); }
.md-thread-item.current { border-color:var(--md-accent-2); box-shadow:0 0 0 2px color-mix(in srgb, var(--md-accent) 12%, transparent); }
.md-thread-head { display:grid; grid-template-columns:32px minmax(0,1fr) auto; gap:10px; align-items:center; width:100%; padding:8px 12px; border:0; background:transparent; text-align:left; border-radius:10px; }
.md-thread-head:hover { background:var(--md-hover); }
.md-thread-head .md-row-avatar { width:30px; height:30px; font-size:10.5px; margin:0; }
.md-thread-head div { min-width:0; }
.md-thread-head strong { display:block; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-thread-head small { display:block; color:var(--md-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-thread-head time { font-size:11.5px; color:var(--md-muted); white-space:nowrap; }
.md-thread-body { padding:0 14px 14px 54px; font-size:13.5px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.md-thread-body .quote { display:block; padding-left:10px; border-left:3px solid var(--md-accent-2); color:var(--md-muted); }
.md-thread-item[data-open="false"] .md-thread-body { display:none; }
.md-reader-team { margin:18px 0 0; padding:12px 14px; border:1px solid var(--md-line); border-radius:12px; background:var(--md-soft); display:flex; flex-wrap:wrap; gap:10px 18px; align-items:center; font-size:12.5px; color:var(--md-muted); }
.md-reader-team b { color:var(--md-text); font-weight:600; }
.md-reader-team .md-btn { margin-left:auto; border-color:var(--md-line-strong); background:var(--md-surface); }

/* Statusleiste */
.md-status { display:flex; align-items:center; gap:14px; padding:6px 14px; border-top:1px solid var(--md-line); background:var(--md-soft); color:var(--md-muted); font-size:12px; }
.md-status .md-grow { flex:1; }
.md-status .md-btn { min-height:26px; padding:0 8px; font-size:12px; }
.md-status .md-btn svg { width:13px; height:13px; }
.md-layout-switch { display:inline-flex; border:1px solid var(--md-line-strong); border-radius:8px; overflow:hidden; }
.md-layout-switch button { min-height:26px; width:30px; display:grid; place-items:center; border:0; background:var(--md-surface); color:var(--md-muted); }
.md-layout-switch button.active { background:var(--md-accent); color:#fff; }
.md-layout-switch button svg { width:14px; height:14px; }
.md-layout-switch button + button { border-left:1px solid var(--md-line); }

/* Kontextmenü / Popover */
.md-menu { position:fixed; z-index:6000; min-width:220px; max-width:320px; padding:6px; border:1px solid var(--md-line); border-radius:12px; background:var(--md-surface); box-shadow:var(--md-shadow); font-size:13px; }
.md-menu button, .md-menu label { display:flex; align-items:center; gap:10px; width:100%; min-height:32px; padding:0 10px; border:0; border-radius:8px; background:transparent; color:var(--md-text); text-align:left; font:inherit; cursor:pointer; }
.md-menu button:hover, .md-menu label:hover { background:var(--md-tint); }
.md-menu button svg { width:15px; height:15px; color:var(--md-accent); }
.md-menu button.danger { color:var(--md-danger); }
.md-menu button.danger svg { color:var(--md-danger); }
.md-menu hr { border:0; border-top:1px solid var(--md-line); margin:6px 4px; }
.md-menu .md-menu-title { padding:6px 10px 2px; font-size:11px; letter-spacing:.1em; text-transform:uppercase; color:var(--md-muted); }
.md-menu input[type="text"], .md-menu input[type="date"], .md-menu input[type="datetime-local"] { width:100%; min-height:32px; margin:4px 0; padding:4px 10px; border:1px solid var(--md-line-strong); border-radius:8px; background:var(--md-surface); color:inherit; font:inherit; }
.md-menu .md-menu-row { display:flex; gap:6px; padding:4px; }
.md-menu .md-menu-row .md-btn { flex:1; justify-content:center; border-color:var(--md-line-strong); min-height:30px; }
.md-menu .md-menu-row .md-btn.primary { border-color:var(--md-accent); }
.md-menu .md-check { margin-right:2px; }
.md-menu .md-tag { margin-left:auto; }

/* Tastaturhilfe */
.md-help { position:fixed; inset:0; z-index:6500; display:grid; place-items:center; background:rgba(40,20,50,.45); backdrop-filter:blur(2px); }
.md-help > section { width:min(680px, calc(100vw - 32px)); max-height:calc(100vh - 40px); overflow:auto; padding:22px 26px; border-radius:16px; background:var(--md-surface); color:var(--md-text); box-shadow:var(--md-shadow); }
.md-help h2 { margin:0 0 4px; font-size:19px; }
.md-help p { margin:0 0 16px; color:var(--md-muted); font-size:13px; }
.md-help-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:6px 28px; }
.md-help-grid h3 { grid-column:1 / -1; margin:14px 0 4px; font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--md-muted); }
.md-help-grid div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:5px 0; border-bottom:1px solid var(--md-line); font-size:13px; }
.md-help kbd { display:inline-block; min-width:26px; padding:2px 7px; border:1px solid var(--md-line-strong); border-bottom-width:2px; border-radius:6px; background:var(--md-soft); font-family:Consolas,monospace; font-size:12px; text-align:center; margin-left:3px; }
.md-help footer { display:flex; justify-content:flex-end; margin-top:18px; }

/* Bildvorschau */
.md-lightbox { position:fixed; inset:0; z-index:6400; display:grid; grid-template-rows:auto 1fr; background:rgba(20,10,28,.92); color:#fff; }
.md-lightbox header { display:flex; align-items:center; gap:12px; padding:12px 18px; }
.md-lightbox header strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-lightbox header .md-btn { color:#fff; border-color:rgba(255,255,255,.3); }
.md-lightbox img { max-width:calc(100vw - 40px); max-height:calc(100vh - 90px); margin:auto; object-fit:contain; border-radius:6px; box-shadow:0 20px 60px rgba(0,0,0,.6); }

/* Verfassen-Fenster */
.md-compose-root { position:fixed; inset:0; z-index:5200; pointer-events:none; }
.md-compose { position:absolute; display:flex; flex-direction:column; width:min(760px, calc(100vw - 24px)); height:min(680px, calc(100vh - 40px)); min-width:420px; min-height:380px; border:1px solid var(--md-line-strong); border-radius:14px; background:var(--md-surface); color:var(--md-text); box-shadow:var(--md-shadow); overflow:hidden; pointer-events:auto; resize:both; }
.md-compose.maximized { inset:12px !important; width:auto !important; height:auto !important; resize:none; }
.md-compose.minimized { display:none; }
.md-compose.active { border-color:var(--md-accent-2); }
.md-compose-head { display:flex; align-items:center; gap:10px; padding:9px 12px 9px 16px; background:linear-gradient(90deg,#643182,#7b4a98); color:#fff; cursor:move; user-select:none; }
html[data-workspace-theme="dark"] .md-compose-head { background:linear-gradient(90deg,#4a2360,#643182); }
.md-compose-head svg { width:16px; height:16px; }
.md-compose-head strong { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.md-compose-head small { font-size:11.5px; opacity:.85; white-space:nowrap; }
.md-compose-head .md-btn { color:#fff; min-height:28px; width:28px; padding:0; justify-content:center; }
.md-compose-head .md-btn:hover { background:rgba(255,255,255,.18); }
.md-compose-body { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:auto; }
.md-compose-fields { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:start; border-bottom:1px solid var(--md-line); }
.md-compose-fields > label { padding:10px 0 0 16px; font-size:12.5px; color:var(--md-muted); }
.md-compose-fields > div { min-width:0; padding:5px 12px 5px 0; border-bottom:1px solid var(--md-line); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.md-compose-fields > div:last-of-type { border-bottom:0; }
.md-compose-fields select, .md-compose-fields input[type="text"] { min-height:30px; border:0; background:transparent; color:inherit; font:inherit; font-size:13.5px; padding:0 4px; flex:1; min-width:120px; outline:none; }
.md-compose-fields select { max-width:100%; }
.md-compose-fields .md-btn { min-height:26px; padding:0 8px; font-size:12px; color:var(--md-accent); }
.md-chips-field { position:relative; flex:1; display:flex; align-items:center; gap:4px; flex-wrap:wrap; min-height:32px; }
.md-chips-field input { flex:1 1 140px; min-width:120px; min-height:28px; border:0; background:transparent; color:inherit; font:inherit; font-size:13.5px; outline:none; }
.md-chip-rcpt { display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:2px 4px 2px 8px; border-radius:999px; background:var(--md-tint); color:var(--md-text); font-size:12.5px; border:1px solid transparent; }
.md-chip-rcpt.known { border-color:var(--md-accent-2); }
.md-chip-rcpt.invalid { background:#fbe3e1; color:#8f2d26; }
.md-chip-rcpt i { width:18px; height:18px; display:grid; place-items:center; border-radius:50%; background:var(--md-accent); color:#fff; font-style:normal; font-size:9px; font-weight:800; }
.md-chip-rcpt.invalid i { background:#8f2d26; }
.md-chip-rcpt span { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-chip-rcpt button { width:18px; height:18px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:inherit; padding:0; }
.md-chip-rcpt button:hover { background:rgba(0,0,0,.08); }
.md-chip-rcpt button svg { width:11px; height:11px; }
.md-suggest { position:absolute; top:100%; left:0; right:0; z-index:40; max-height:260px; overflow:auto; border:1px solid var(--md-line); border-radius:10px; background:var(--md-surface); box-shadow:var(--md-shadow); }
.md-suggest[hidden] { display:none; }
.md-suggest button { display:grid; grid-template-columns:30px minmax(0,1fr); gap:10px; align-items:center; width:100%; padding:7px 10px; border:0; border-bottom:1px solid var(--md-line); background:transparent; text-align:left; font:inherit; color:var(--md-text); }
.md-suggest button:hover, .md-suggest button.active { background:var(--md-tint); }
.md-suggest button strong { display:block; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-suggest button small { display:block; font-size:11.5px; color:var(--md-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-suggest .md-row-avatar { width:28px; height:28px; font-size:10px; margin:0; }
.md-compose-tools { display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:6px 10px; border-bottom:1px solid var(--md-line); background:var(--md-soft); }
.md-compose-tools .md-btn { min-height:28px; padding:0 8px; font-size:12.5px; }
.md-compose-tools .md-btn svg { width:14px; height:14px; }
.md-compose-tools select { min-height:28px; border:1px solid var(--md-line-strong); border-radius:8px; background:var(--md-surface); color:inherit; font:inherit; font-size:12.5px; max-width:220px; }
.md-compose textarea.md-compose-text { flex:1 1 auto; min-height:180px; width:100%; padding:14px 18px; border:0; resize:none; background:var(--md-surface); color:var(--md-text); font:inherit; font-size:14px; line-height:1.6; outline:none; }
.md-compose.md-drop-active .md-compose-body { outline:2px dashed var(--md-accent); outline-offset:-6px; background:var(--md-tint); }
.md-compose-attach { border-top:1px solid var(--md-line); padding:8px 12px; background:var(--md-soft); }
.md-compose-attach-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12.5px; color:var(--md-muted); }
.md-compose-attach-head strong { color:var(--md-text); }
.md-compose-attach-head .md-btn { min-height:26px; padding:0 8px; font-size:12px; border-color:var(--md-line-strong); background:var(--md-surface); }
.md-compose-attach-head .md-grow { flex:1; }
.md-compose-attach-head .warn { color:var(--md-danger); font-weight:600; }
.md-compose-files { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.md-compose-files:empty { display:none; }
.md-file-chip { display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:4px 6px 4px 10px; border:1px solid var(--md-line-strong); border-radius:999px; background:var(--md-surface); font-size:12.5px; }
.md-file-chip svg { width:13px; height:13px; color:var(--md-accent); }
.md-file-chip span { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-file-chip small { color:var(--md-muted); }
.md-file-chip.unapproved { border-color:#e2b76a; }
.md-file-chip button { width:20px; height:20px; display:grid; place-items:center; border:0; border-radius:50%; background:transparent; color:inherit; padding:0; }
.md-file-chip button:hover { background:var(--md-tint); }
.md-file-chip button svg { width:11px; height:11px; }
.md-compose-foot { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 12px; border-top:1px solid var(--md-line); background:var(--md-surface); }
.md-compose-foot .md-grow { flex:1; }
.md-compose-foot small { color:var(--md-muted); font-size:12px; }
.md-compose-foot label.confirm { display:flex; align-items:center; gap:8px; font-size:12.5px; color:#7a4a10; padding:4px 10px; border-radius:8px; background:#fbf1e6; }
.md-compose-foot .md-btn.primary { min-height:34px; padding:0 16px; }
.md-dock { position:fixed; right:16px; bottom:12px; z-index:5300; display:flex; gap:8px; flex-wrap:wrap-reverse; justify-content:flex-end; pointer-events:none; }
.md-dock:empty { display:none; }
.md-dock button { pointer-events:auto; display:inline-flex; align-items:center; gap:8px; min-height:38px; max-width:280px; padding:0 8px 0 14px; border:1px solid var(--md-accent-2); border-radius:10px; background:var(--md-surface); color:var(--md-text); box-shadow:0 8px 24px rgba(60,30,80,.22); font:inherit; font-size:13px; cursor:pointer; }
.md-dock button svg { width:15px; height:15px; color:var(--md-accent); }
.md-dock button span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.md-dock button i { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; margin-left:4px; }
.md-dock button i:hover { background:var(--md-tint); }
.md-dock button i svg { width:12px; height:12px; }

/* Ausklappbare Ordnerliste (Tablet) */
.md-drawer-toggle { display:none; }
@media (max-width:1100px) {
  .md-shell { font-size:13px; }
  .md-drawer-toggle { display:inline-flex; }
  .md-shell:not(.folders-open) .md-folders, .md-shell:not(.folders-open) .md-resizer.folders { display:none; }
  .md-shell.folders-open .md-folders { position:absolute; inset:0 auto 0 0; z-index:5; width:250px !important; box-shadow:var(--md-shadow); }
  .md-shell[data-layout="right"] .md-main { flex:0 0 42%; width:auto !important; }
}
@media (max-width:820px) {
  .md-shell[data-layout="right"] .md-body { flex-direction:column; }
  .md-shell[data-layout="right"] .md-main { flex:0 0 auto !important; width:auto !important; max-width:none; max-height:46vh; }
  .md-shell[data-layout="right"] .md-list { border-right:0; border-bottom:1px solid var(--md-line); }
  .md-resizer { display:none; }
  .md-toolbar .md-search { min-width:0; flex-basis:100%; order:10; }
  .md-toolbar .md-btn span.label { display:none; }
  .md-compose { inset:auto 0 0 0 !important; width:auto !important; height:min(92vh, 720px) !important; border-radius:14px 14px 0 0; resize:none; }
  .md-compose-fields { grid-template-columns:58px minmax(0,1fr); }
}
@media print {
  .md-toolbar, .md-folders, .md-list, .md-resizer, .md-status, .md-reader-actions, .md-compose-root, .md-dock { display:none !important; }
  .md-shell, .md-reader, .md-reader-scroll { border:0; overflow:visible; height:auto; }
}
