/* SunnyIntramail – Oberfläche. Farben kommen aus theme.css (Hell/Dunkel, gleiche Palette wie SunnyChat). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
#app { min-height: 100%; height: 100%; }
/* Kein versehentliches Zoomen der Oberfläche durch Doppeltippen (Handy) */
html, body, button, a, input, select, textarea, label, [role="button"], [contenteditable] { touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.icon { display: inline-flex; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.pad { padding: 16px; }
.pad-s { padding: 4px 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.skip-link:focus { top: 8px; }

/* ---------- Marke ---------- */
.logo { display: block; flex: none; border-radius: 22%; }
.wordmark { font-size: 20px; letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.wm-a { font-weight: 600; }
.wm-b { font-weight: 800; color: var(--accent-text); }
.brand-row { display: flex; align-items: center; gap: 10px; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--panel-2); color: var(--text); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.accent { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.btn.accent:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; justify-content: flex-start; }
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.soft { background: var(--panel-2); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.on { color: #E0A21A; }
.icon-btn:disabled { opacity: 0.5; }

/* ---------- Formulare ---------- */
input[type=text], input[type=search], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); color: var(--text); font-size: 15px;
}
textarea { resize: vertical; min-height: 80px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field small { font-weight: 400; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-status { min-height: 1.2em; font-size: 14px; font-weight: 700; color: var(--danger-text); }
.hint-small { font-size: 12px; color: var(--muted); min-height: 0; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn-text); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; }
.switch { appearance: none; width: 50px; min-height: 0; height: 30px; flex: none; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.15s; padding: 0; border: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.segmented button { min-height: 38px; padding: 0 14px; border: none; border-radius: 9px; background: none; color: var(--muted); font-weight: 800; cursor: pointer; }
.segmented button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- Gerüst ---------- */
.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.drawer-close { display: none; }
.compose-btn { width: 100%; }
.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.nav-row { display: flex; align-items: center; gap: 2px; }
.nav-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: none; border-radius: 10px; background: none; color: var(--text); font-weight: 700; text-align: left; cursor: pointer; }
.nav-item:hover { background: var(--panel-2); }
.nav-item.current { background: var(--accent-soft); color: var(--accent-soft-text); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; color: var(--muted); }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; text-align: center; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; border-top: 1px solid var(--line); }
.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); min-height: 60px; }
.top-title { font-size: 18px; font-weight: 800; }
.menu-btn { display: none; }
.top-compose { display: none; }
.content { flex: 1; min-height: 0; overflow: hidden; outline: none; }
.dock-slot { display: inline-flex; }
.scrim { position: fixed; inset: 0; z-index: 38; background: rgba(4, 9, 18, 0.55); }
.page-pane { height: 100%; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.content-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.content-head h2 { font-size: 24px; font-weight: 800; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.card { position: relative; width: 100%; max-width: 560px; padding: 22px 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card.waiting { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 40px 32px; }
.card h1 { font-size: 26px; font-weight: 800; }
.card h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.cards .card { max-width: none; display: flex; flex-direction: column; gap: 12px; }
.plain-list { display: flex; flex-direction: column; gap: 8px; list-style: disc; padding-left: 18px; font-size: 14px; }
.meter { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; }

/* ---------- Mail: Liste + Lesen ---------- */
.mail-view { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); height: 100%; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.list-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px 16px; }
.list-head h2 { flex: 1; font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row { padding: 6px 12px 10px; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); color: var(--muted); }
.search-box input { border: none; background: none; min-height: 42px; padding: 0; }
.search-box input:focus-visible { outline: none; }
.search-box:focus-within { outline: 2px solid var(--accent); }
.rows { flex: 1; overflow-y: auto; min-height: 0; }
.row-item { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.row-item.selected { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 12px 6px 12px 14px; border: none; background: none; text-align: left; cursor: pointer; color: var(--text); }
.row-main:hover { background: var(--panel-2); }
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-top { display: flex; justify-content: space-between; gap: 8px; }
.row-from { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { font-size: 12px; color: var(--muted); flex: none; }
.row-sub { display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.row-prev { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread .row-from, .unread .row-sub { font-weight: 800; }
.unread .row-main::before { content: ''; width: 8px; height: 8px; margin-top: 16px; margin-right: -6px; border-radius: 50%; background: var(--accent-text); flex: none; order: -1; }
.count { margin-left: 6px; padding: 0 6px; border-radius: 8px; background: var(--panel-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.star-btn { width: 44px; border: none; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 14px; }
.star-btn.on { color: #E0A21A; }
.more { margin: 12px; width: calc(100% - 24px); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); text-align: center; }
.reader-empty { height: 100%; }
.reader-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.reader-tools { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.back-btn { display: none; }
.reader-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.reader-subject { font-size: 22px; font-weight: 800; margin-bottom: 6px; overflow-wrap: anywhere; }
.thread { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.msg { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.msg-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; background: none; text-align: left; cursor: pointer; color: var(--text); }
.msg-from { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; }
.msg-snip { flex-basis: 100%; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.open .msg-snip { display: none; }
.msg-body { display: none; padding: 0 14px 14px 14px; flex-direction: column; gap: 12px; }
.msg.open .msg-body { display: flex; }
.who-block { display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.who-line { display: flex; gap: 8px; flex-wrap: wrap; }
.who-label { width: 48px; color: var(--muted); font-weight: 800; flex: none; }
.who.gone { color: var(--muted); text-decoration: line-through; }
.bcc-self { color: var(--warn-text); }
.rich { overflow-wrap: anywhere; font-size: 15px; }
.rich p { margin: 0 0 8px; min-height: 1em; }
.rich blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.rich ul, .rich ol { margin: 6px 0 8px; padding-left: 24px; list-style: revert; }
.rich pre, .rich code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--panel-2); border-radius: 6px; }
.rich pre { padding: 8px 10px; white-space: pre-wrap; }
.atts h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.atts li, .att-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.msg-actions { margin-top: 4px; }
.event-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); border-left: 5px solid #E0822F; background: var(--bg); }
.event-box.cancelled { opacity: 0.7; }
.ev-when { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ev-desc { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Schreiben ---------- */
.dialog.compose-dialog { max-width: 820px; }
.compose { display: flex; flex-direction: column; gap: 10px; }
.recip-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.recip-row > .recip, .recip-row > .sub-wrap { flex: 1; min-width: 200px; }
.recip { position: relative; display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.recip-label { width: 52px; padding-top: 12px; font-size: 13px; font-weight: 800; color: var(--muted); flex: none; }
.recip-box { flex: 1; min-width: 160px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); cursor: text; min-height: 44px; }
.recip-box:focus-within { outline: 2px solid var(--accent); }
.recip-input { flex: 1; min-width: 120px; border: none !important; background: none !important; min-height: 34px !important; padding: 0 !important; }
.recip-input:focus-visible { outline: none; }
.chips { display: contents; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-x { width: 24px; height: 24px; border: none; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.suggest { position: absolute; z-index: 60; left: 60px; right: 0; top: 52px; max-height: 280px; overflow-y: auto; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: 4px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.opt[aria-selected="true"], .opt:hover { background: var(--accent-soft); }
.opt-name { display: flex; flex-direction: column; line-height: 1.2; }
.opt-name small { color: var(--muted); }
.recip .hint-small { flex-basis: 100%; padding-left: 60px; color: var(--warn-text); }
.cc-toggles { display: inline-flex; gap: 6px; padding-top: 4px; }
.sub-wrap { display: block; }
.toolbar { display: flex; gap: 2px; flex-wrap: wrap; padding: 2px; border-bottom: 1px solid var(--line); }
.editor { min-height: 220px; max-height: 50vh; overflow-y: auto; padding: 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--input); font-size: 15px; outline: none; overflow-wrap: anywhere; }
.editor:focus { outline: 2px solid var(--accent); }
.editor.small { min-height: 100px; }
.editor p { margin: 0 0 6px; }
.editor blockquote { margin: 6px 0; padding: 2px 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.editor ul, .editor ol { padding-left: 24px; list-style: revert; margin: 4px 0; }
.dropzone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; color: var(--muted); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.compose-foot { padding-top: 4px; }

/* ---------- Kalender ---------- */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cal-title { font-size: 19px; font-weight: 800; flex: 1; text-align: center; min-width: 140px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; text-align: center; padding: 4px 0; }
.cal-cell { min-height: 96px; padding: 6px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; overflow: hidden; }
.cal-cell.other { opacity: 0.5; }
.cal-cell.today { border-color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-text); }
.cal-day { font-size: 13px; font-weight: 800; }
.cal-more { font-size: 12px; color: var(--muted); }
.ev-chip { display: flex; align-items: center; gap: 3px; width: 100%; min-height: 22px; padding: 2px 6px; border: none; border-radius: 6px; background: var(--accent-soft); color: var(--accent-soft-text); font-size: 12px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev-chip.ev-ext { background: var(--panel-2); color: var(--text); border: 1px dashed var(--line-strong); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-col { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-width: 0; min-height: 120px; }
.cal-col.today { border-color: var(--accent-text); }
.cal-col-head { font-size: 13px; color: var(--muted); }
.cal-col-head b { color: var(--text); }
.ev-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border: 1px solid var(--line); border-left: 4px solid var(--accent-text); border-radius: 10px; background: var(--bg); color: var(--text); text-align: left; cursor: pointer; min-width: 0; }
.ev-card b { overflow-wrap: anywhere; }
.ev-time { font-size: 12px; color: var(--muted); font-weight: 700; }
.agenda { display: flex; flex-direction: column; gap: 14px; }
.agenda-day h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.agenda-day { display: flex; flex-direction: column; gap: 6px; }
.ev-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); border-left: 5px solid var(--accent-text); background: var(--panel); color: var(--text); text-align: left; cursor: pointer; width: 100%; }
.ev-row .grow { display: flex; flex-direction: column; min-width: 160px; }
.ev-card.ev-ext, .ev-row.ev-ext { border-left-color: #E0822F; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); }
.pill.tiny { font-size: 11px; padding: 2px 8px; }
.ext-pill { background: #D8EBFA; color: #123B63; }
:root[data-theme="dark"] .ext-pill { background: #1F3A5C; color: #A9D2F5; }
.rs-yes { background: var(--accent-soft); color: var(--accent-soft-text); }
.rs-no { background: #F5D9DA; color: #7B1D22; }
:root[data-theme="dark"] .rs-no { background: #4A1E21; color: #F5B3B6; }
.people { display: flex; flex-direction: column; gap: 6px; }
.people li { display: flex; align-items: center; gap: 10px; }

/* ---------- Avatar, Dialog, Hinweise ---------- */
.avatar { position: relative; width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 800; overflow: hidden; }
.avatar .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(4, 9, 18, 0.62); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.dialog { width: 100%; max-width: 540px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 24px 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.dialog h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 4px; }
.pick-folder { display: flex; flex-direction: column; gap: 6px; }
.toasts { position: fixed; z-index: 70; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 520px); }
.toast { padding: 12px 18px; border-radius: 14px; background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; text-align: center; transition: opacity 0.35s, transform 0.35s; }
.toast.error { border-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- App-Wechsler ---------- */
.app-switch-wrap { position: relative; display: inline-flex; }
.app-panel { position: fixed; z-index: 55; width: min(340px, calc(100vw - 16px)); padding: 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow-y: auto; }
.app-panel-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 2px 4px 10px; }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 700; text-align: center; min-width: 0; }
.app-tile:hover, .app-tile:focus-visible { background: var(--panel-2); }
.app-tile.current { background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--accent-text); }
.app-tile-icon img, .app-glyph { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.app-glyph { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 800; font-size: 18px; }
.app-tile-name { overflow-wrap: anywhere; line-height: 1.2; }
.app-tile-here { font-size: 10px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.06em; }
.app-sheet-backdrop { position: fixed; inset: 0; z-index: 54; background: rgba(4, 9, 18, 0.5); }
.dock-toggle.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- Handy ---------- */
@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform 0.2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .drawer-close, .menu-btn { display: inline-flex; }
  .compose-btn { display: none; }
  .top-compose { display: inline-flex; }
  .top-compose { padding: 0 10px; }
  .top-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .theme-toggle { display: none; } /* Hell/Dunkel gibt es auf dem Handy unter Einstellungen */
  .topbar { gap: 2px; padding: 6px 8px; }
  .mail-view { grid-template-columns: minmax(0, 1fr); }
  .mail-view .reader-pane { display: none; }
  .mail-view.reading .list-pane { display: none; }
  .mail-view.reading .reader-pane { display: flex; }
  .list-pane { border-right: none; }
  .back-btn { display: inline-flex; }
  .reader-body { padding: 12px 12px 40px; }
  .page-pane { padding: 12px; }
  .cal-cell { min-height: 56px; padding: 3px; }
  .ev-chip { font-size: 0; padding: 0; height: 6px; min-height: 6px; border-radius: 3px; }
  .ev-chip b, .ev-chip .icon { display: none; }
  .cal-week { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .backdrop { padding: 0; align-items: stretch; }
  .dialog { max-width: none; max-height: none; min-height: 100%; border-radius: 0; padding: 16px; }
  .dialog.compose-dialog { border-radius: 0; }
  .suggest { left: 0; }
  .recip-label { width: auto; padding-top: 0; flex-basis: 100%; }
  .recip .hint-small { padding-left: 0; }
  .toasts { bottom: 16px; }
  .wordmark { font-size: 18px; }
}
/* Berührungsbildschirme: Eingabefelder mindestens 16 px, sonst zoomt das Handy beim Antippen hinein */
@media (pointer: coarse) {
  input[type=text], input[type=search], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea, .editor, .recip-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
