@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("/fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* ---------- Farben ---------- */
:root {
  color-scheme: light;
  --desk: #DCE2EC;      /* Schreibtisch */
  --panel: #EDF1F7;     /* Leisten */
  --panel-2: #E4E9F2;
  --line: #C9D2E1;
  --text: #1B2233;
  --muted: #5A6683;
  --faint: #8691AB;
  --accent: #3D5FD9;
  --accent-soft: #D5DEFB;
  --on-accent: #FFFFFF;
  --fresh: #138A66;     /* ungelesen */
  --danger: #C9374A;
  --sheet: #FFFFFF;     /* Briefbogen */
  --sheet-ink: #1B2233;
  --sheet-muted: #5A6683;
  --sheet-line: #E3E7EF;
  --shadow-sheet: 0 1px 2px rgba(23, 32, 54, .06), 0 12px 32px -8px rgba(23, 32, 54, .18);
  --hover: rgba(61, 95, 217, .07);
  --sel: rgba(61, 95, 217, .13);
  --mark-flap: #1B2233;
  --font: "Atkinson Next", "Segoe UI", system-ui, sans-serif;
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #172036;
  --panel: #1C2640;
  --panel-2: #222E4B;
  --line: #2D3A5C;
  --text: #E5EAF5;
  --muted: #9AA6C2;
  --faint: #6F7C9C;
  --accent: #86A2FF;
  --accent-soft: #2C3B68;
  --on-accent: #0E1733;
  --fresh: #5BD8B0;
  --danger: #FF8593;
  --sheet: #FBFCFE;
  --sheet-ink: #1B2233;
  --sheet-muted: #5A6683;
  --sheet-line: #E3E7EF;
  --shadow-sheet: 0 2px 4px rgba(0, 0, 0, .25), 0 24px 48px -12px rgba(0, 0, 0, .55);
  --hover: rgba(134, 162, 255, .08);
  --sel: rgba(134, 162, 255, .16);
  --mark-flap: #FBFCFE;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--desk); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 17px; height: 17px; }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: 68px 1fr; height: 100vh; height: 100dvh; }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 14px; background: var(--desk); }
.rail .mark { width: 40px; height: 40px; margin-bottom: 18px; display: grid; place-items: center; }
.rail .mark svg { width: 34px; height: 34px; }
.rail a, .rail button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: none; position: relative; }
.rail a:hover, .rail button:hover { color: var(--text); background: var(--hover); }
.rail a.on { color: var(--accent); background: var(--sel); }
.rail .grow { flex: 1; }
.rail .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.rail [data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 52px; top: 50%; transform: translateY(-50%); background: var(--text); color: var(--desk); font-size: 13px; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 50; }
.stage { min-width: 0; height: 100%; overflow: hidden; }

/* ---------- Knöpfe & Felder ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--text); text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ghost { border-color: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--faint); font-size: 12.5px; }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--panel); outline: none; }
textarea.input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 12px; align-items: center; }
.row > .field { flex: 1; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 14px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: auto; height: 100vh; }
.auth .letter { width: min(440px, 100%); background: var(--sheet); color: var(--sheet-ink); border-radius: var(--r-l); box-shadow: var(--shadow-sheet); padding: 44px 40px 36px; position: relative; animation: unfold .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 50% 0; }
.auth .letter::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; border-radius: var(--r-l) var(--r-l) 0 0; background: linear-gradient(90deg, #3D5FD9, #57D6AE); }
@keyframes unfold { from { opacity: 0; transform: perspective(900px) rotateX(-14deg) translateY(18px); } to { opacity: 1; transform: none; } }
.auth h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin: 6px 0 6px; font-weight: 800; }
.auth p.lead { color: var(--sheet-muted); margin: 0 0 28px; }
.auth .input { background: #F3F5F9; border-color: #DCE1EA; color: var(--sheet-ink); }
.auth .field > span { color: var(--sheet-muted); }
.auth .btn.primary { width: 100%; justify-content: center; height: 46px; margin-top: 6px; background: #3D5FD9; border-color: #3D5FD9; color: #fff; }
.auth .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--sheet-muted); }
.auth .brand svg { width: 28px; height: 28px; }
.auth .foot { margin-top: 22px; font-size: 13px; color: var(--sheet-muted); }

/* ---------- Mail ---------- */
.mail { display: grid; grid-template-columns: 236px minmax(300px, 380px) 1fr; height: 100%; }
.folders { padding: 18px 10px 18px 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.folders .compose { margin: 0 6px 18px 4px; justify-content: center; height: 44px; }
.folders .acc { margin-top: 18px; padding: 0 10px 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
.folders .acc i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.folders .acc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folders a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 14.5px; min-width: 0; }
.folders a span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.folders a b { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.folders a svg { color: var(--muted); }
.folders a:hover { background: var(--hover); }
.folders a.on { background: var(--sel); font-weight: 700; }
.folders a.on svg { color: var(--accent); }
.folders a.sub { padding-left: 26px; }
.folders .err-acc { margin: 2px 12px; font-size: 12.5px; color: var(--danger); }

.list { background: var(--panel); display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-l) 0 0 var(--r-l); }
.list-head { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.list-head .title { display: flex; align-items: center; gap: 8px; }
.list-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 38px; height: 40px; background: var(--desk); border-color: transparent; }
.items { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.group { padding: 14px 10px 6px; font-size: 12.5px; font-weight: 700; color: var(--faint); }
.item { display: grid; grid-template-columns: 10px 1fr auto; column-gap: 8px; row-gap: 1px; padding: 10px 12px 11px 6px; border-radius: 12px; cursor: pointer; text-decoration: none; color: var(--text); }
.item:hover { background: var(--hover); }
.item.on { background: var(--sel); }
.item .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; grid-row: 1 / 3; }
.item.unread .dot { background: var(--fresh); }
.item .who { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .who { font-weight: 700; }
.item .when { font-size: 12.5px; color: var(--faint); align-self: center; }
.item .subj { grid-column: 2 / 4; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.item.unread .subj { color: var(--text); }
.item .subj .tag { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.item .subj svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.more { display: block; margin: 12px auto 0; }
.empty { padding: 48px 28px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 14px 0 6px; font-size: 18px; }
.empty .art { width: 72px; height: 72px; margin: 0 auto; opacity: .9; }
.loading { padding: 28px; display: grid; gap: 14px; }
.loading div { height: 46px; border-radius: 10px; background: linear-gradient(90deg, var(--panel-2), var(--hover), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.reader { overflow-y: auto; padding: 22px 28px 40px; min-width: 0; }
.reader-bar { display: flex; align-items: center; gap: 4px; max-width: 920px; margin: 0 auto 14px; }
.reader-bar .grow { flex: 1; }
.reader-bar .back { display: none; }
.sheet { max-width: 920px; margin: 0 auto; background: var(--sheet); color: var(--sheet-ink); border-radius: var(--r-l); box-shadow: var(--shadow-sheet); padding: 34px 40px 40px; animation: lay .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes lay { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet h1 { font-size: 26px; line-height: 1.22; letter-spacing: -.015em; margin: 0 0 22px; font-weight: 800; overflow-wrap: anywhere; }
.sheet .from { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--sheet-line); }
.sheet .face { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.sheet .from .who { flex: 1; min-width: 0; }
.sheet .from .who b { font-size: 15.5px; }
.sheet .from .who .addr { color: var(--sheet-muted); font-size: 14px; overflow-wrap: anywhere; }
.sheet .from .who .to { color: var(--sheet-muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.sheet .from time { color: var(--sheet-muted); font-size: 13.5px; white-space: nowrap; }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; padding: 10px 14px; border-radius: 10px; background: #F1F4FA; color: var(--sheet-muted); font-size: 13.5px; }
.notice .grow { flex: 1; min-width: 180px; }
.notice button { background: none; border: 0; color: #3D5FD9; font-weight: 700; cursor: pointer; padding: 4px 6px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.att { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border: 1px solid var(--sheet-line); border-radius: 10px; color: var(--sheet-ink); text-decoration: none; font-size: 13.5px; max-width: 280px; }
.att:hover { border-color: #3D5FD9; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att small { color: var(--sheet-muted); white-space: nowrap; }
.body-frame { width: 100%; border: 0; display: block; margin-top: 22px; min-height: 120px; background: transparent; }
.reader .placeholder { height: 100%; display: grid; place-items: center; color: var(--faint); text-align: center; }
.reader .placeholder svg { width: 120px; height: 120px; opacity: .55; }

/* ---------- Verfassen ---------- */
.compose-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: end end; padding: 20px; pointer-events: none; }
.compose-wrap.full { place-items: center; background: rgba(10, 16, 30, .35); pointer-events: auto; }
.composer { pointer-events: auto; width: min(680px, 100%); height: min(640px, calc(100dvh - 40px)); background: var(--sheet); color: var(--sheet-ink); border-radius: var(--r-l); box-shadow: 0 30px 80px -20px rgba(10, 16, 30, .55), 0 0 0 1px rgba(10, 16, 30, .06); display: flex; flex-direction: column; animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; overflow: hidden; }
.compose-wrap.full .composer { width: min(980px, 100%); height: min(820px, calc(100dvh - 40px)); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.composer header { display: flex; align-items: center; gap: 4px; padding: 12px 12px 8px 22px; }
.composer header h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 700; }
.composer .icon-btn { color: var(--sheet-muted); }
.composer .icon-btn:hover { background: #EEF1F7; color: var(--sheet-ink); }
.composer .lines { padding: 0 22px; }
.composer .ln { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--sheet-line); min-height: 44px; position: relative; }
.composer .ln label { width: 54px; color: var(--sheet-muted); font-size: 14px; flex: none; }
.composer .ln input, .composer .ln select { border: 0; outline: none; background: transparent; flex: 1; min-width: 80px; height: 40px; color: var(--sheet-ink); }
.composer .ln .toggle { background: none; border: 0; color: var(--sheet-muted); cursor: pointer; font-size: 13.5px; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; padding: 4px 0; }
.token { display: inline-flex; align-items: center; gap: 4px; background: #E8EDFB; color: #23317A; border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 13.5px; max-width: 100%; }
.token.bad { background: #FBE5E8; color: #8E1F2E; }
.token button { border: 0; background: none; cursor: pointer; color: inherit; display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.suggest { position: absolute; top: 100%; left: 54px; right: 0; background: #fff; border: 1px solid var(--sheet-line); border-radius: 10px; box-shadow: 0 12px 30px -10px rgba(10, 16, 30, .3); z-index: 5; overflow: hidden; }
.suggest div { padding: 9px 14px; cursor: pointer; font-size: 14px; }
.suggest div small { color: var(--sheet-muted); margin-left: 6px; }
.suggest div.on, .suggest div:hover { background: #EEF2FC; }
.toolbar { display: flex; gap: 2px; padding: 6px 18px; border-bottom: 1px solid var(--sheet-line); }
.toolbar button { width: 34px; height: 32px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--sheet-muted); display: grid; place-items: center; font-weight: 700; }
.toolbar button:hover { background: #EEF1F7; color: var(--sheet-ink); }
.editor { flex: 1; overflow-y: auto; padding: 18px 22px; outline: none; font-size: 15px; line-height: 1.6; color: var(--sheet-ink); }
.editor:empty::before { content: attr(data-placeholder); color: #9AA3B8; }
.editor blockquote { margin: 8px 0; padding-left: 14px; border-left: 3px solid #D3DAE8; color: #4D5874; }
.editor .sig { color: #4D5874; }
.composer footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--sheet-line); flex-wrap: wrap; }
.composer footer .grow { flex: 1; }
.composer footer .btn.primary { background: #3D5FD9; border-color: #3D5FD9; color: #fff; }
.composer footer .btn:not(.primary) { color: var(--sheet-ink); border-color: #DCE1EA; }
.composer .files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 8px; }
.composer .files .att { padding: 5px 6px 5px 10px; }
.composer.drag { box-shadow: 0 0 0 3px #3D5FD9, 0 30px 80px -20px rgba(10, 16, 30, .55); }

/* ---------- Kalender ---------- */
.cal { display: flex; flex-direction: column; height: 100%; padding: 18px 24px 20px 6px; }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0 8px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; min-width: 220px; }
.cal-head .grow { flex: 1; }
.seg { display: inline-flex; background: var(--panel); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--sheet); color: var(--sheet-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.month { flex: 1; display: grid; grid-template-rows: auto repeat(6, 1fr); background: var(--panel); border-radius: var(--r-l); overflow: hidden; min-height: 0; }
.month .dow { display: grid; grid-template-columns: repeat(7, 1fr); }
.month .dow div { padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--faint); }
.month .wk { display: grid; grid-template-columns: repeat(7, 1fr); min-height: 0; }
.day { border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px 6px 4px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.day:nth-child(7n+1) { border-left: 0; }
.day:hover { background: var(--hover); }
.day .num { font-size: 13.5px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.day.other { color: var(--faint); }
.day.today .num { background: var(--accent); color: var(--on-accent); }
.chip { font-size: 12.5px; padding: 2px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); background: color-mix(in srgb, var(--c, var(--accent)) 22%, transparent); border-left: 3px solid var(--c, var(--accent)); cursor: pointer; }
.chip:hover { filter: brightness(1.1); }
.chip.more-n { background: none; border: 0; color: var(--muted); padding-left: 4px; }
.week { flex: 1; display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-l); overflow: hidden; min-height: 0; }
.week .wh { display: grid; grid-template-columns: 58px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.week .wh div { padding: 10px 8px; font-size: 13px; color: var(--muted); }
.week .wh div b { display: block; font-size: 20px; color: var(--text); font-weight: 700; }
.week .wh div.today b { color: var(--accent); }
.week .allday { display: grid; grid-template-columns: 58px repeat(7, 1fr); border-bottom: 1px solid var(--line); min-height: 30px; }
.week .allday > div { padding: 3px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.week .allday > div:first-child { border-left: 0; font-size: 11.5px; color: var(--faint); padding: 7px 6px; }
.week .grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 58px repeat(7, 1fr); position: relative; }
.week .hours div { height: 52px; font-size: 11.5px; color: var(--faint); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.week .col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0 51px, var(--line) 51px 52px); cursor: pointer; }
.week .ev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; overflow: hidden; color: var(--text); background: color-mix(in srgb, var(--c, var(--accent)) 26%, var(--panel)); border-left: 3px solid var(--c, var(--accent)); cursor: pointer; }
.week .ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.week .now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* ---------- Kontakte & Einstellungen ---------- */
.split { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; height: 100%; }
.split > .side { background: var(--panel); border-radius: var(--r-l) 0 0 var(--r-l); display: flex; flex-direction: column; margin: 0; min-width: 0; }
.split > .main { overflow-y: auto; padding: 28px 32px 40px; }
.people .p { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; text-decoration: none; color: var(--text); }
.people .p:hover { background: var(--hover); }
.people .p.on { background: var(--sel); }
.people .p .face { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 13px; flex: none; }
.people .p div { min-width: 0; }
.people .p small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card { max-width: 720px; background: var(--sheet); color: var(--sheet-ink); border-radius: var(--r-l); box-shadow: var(--shadow-sheet); padding: 30px 34px; margin: 0 auto; }
.card h2 { margin: 0 0 20px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.card .input { background: #F3F5F9; border-color: #DCE1EA; color: var(--sheet-ink); }
.card .field > span { color: var(--sheet-muted); }
.card .hint { color: var(--sheet-muted); }
.card .btn { color: var(--sheet-ink); border-color: #DCE1EA; }
.card .btn.primary { background: #3D5FD9; border-color: #3D5FD9; color: #fff; }
.card .btn.danger { color: #C9374A; }
.card + .card { margin-top: 20px; }
.settings-nav { padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav h2 { margin: 0 12px 14px; font-size: 21px; font-weight: 800; }
.settings-nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.settings-nav a:hover { background: var(--hover); }
.settings-nav a.on { background: var(--sel); font-weight: 700; }
.acc-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--sheet-line); }
.acc-row:last-of-type { border-bottom: 0; }
.acc-row i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.acc-row div { flex: 1; min-width: 0; }
.acc-row small { color: var(--sheet-muted); display: block; }
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.providers button { height: 64px; border-radius: 12px; border: 1px solid #DCE1EA; background: #fff; cursor: pointer; font-weight: 700; color: var(--sheet-ink); text-align: left; padding: 0 16px; display: flex; flex-direction: column; justify-content: center; }
.providers button small { font-weight: 400; color: var(--sheet-muted); font-size: 12px; }
.providers button:hover { border-color: #3D5FD9; }
.providers button.on { border-color: #3D5FD9; box-shadow: 0 0 0 3px #D5DEFB; }
details.adv { margin: 4px 0 18px; }
details.adv summary { cursor: pointer; color: #3D5FD9; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.callout { padding: 12px 16px; border-radius: 10px; background: #F1F4FA; color: #46516C; font-size: 14px; margin-bottom: 18px; }
.callout.warn { background: #FFF4E0; color: #6E4B10; }
.result { display: grid; gap: 6px; margin: 4px 0 14px; font-size: 14px; }
.result .ok { color: #138A66; }
.result .no { color: #C9374A; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.theme-pick button { border: 1px solid #DCE1EA; border-radius: 12px; background: #fff; padding: 12px; cursor: pointer; text-align: left; font-weight: 600; color: var(--sheet-ink); }
.theme-pick button.on { border-color: #3D5FD9; box-shadow: 0 0 0 3px #D5DEFB; }
.theme-pick .sw { height: 56px; border-radius: 8px; margin-bottom: 10px; display: grid; place-items: center; }
.theme-pick .sw i { width: 46%; height: 60%; border-radius: 4px; background: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }

/* ---------- Dialoge & Hinweise ---------- */
.dialog-wrap { position: fixed; inset: 0; background: rgba(10, 16, 30, .45); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .18s both; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(520px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--sheet); color: var(--sheet-ink); border-radius: var(--r-l); padding: 26px 28px 22px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); animation: rise .24s cubic-bezier(.2, .8, .2, 1) both; }
.dialog h3 { margin: 0 0 18px; font-size: 20px; font-weight: 800; }
.dialog .input { background: #F3F5F9; border-color: #DCE1EA; color: var(--sheet-ink); }
.dialog .field > span { color: var(--sheet-muted); }
.dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.dialog .actions .grow { flex: 1; }
.dialog .btn { color: var(--sheet-ink); border-color: #DCE1EA; }
.dialog .btn.primary { background: #3D5FD9; border-color: #3D5FD9; color: #fff; }
.dialog .btn.danger { color: #C9374A; }
.dialog .colors { display: flex; gap: 8px; }
.dialog .colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.dialog .colors button.on { border-color: var(--sheet-ink); }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--desk); padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4); animation: rise .25s both; pointer-events: auto; display: flex; gap: 14px; align-items: center; max-width: min(560px, calc(100vw - 32px)); }
.toast.bad { background: var(--danger); color: #fff; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.mobile-only { display: none !important; }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 1180px) {
  .mail { grid-template-columns: 0 minmax(300px, 380px) 1fr; }
  .folders { position: fixed; left: 68px; top: 0; bottom: 0; width: 260px; background: var(--desk); z-index: 30; transform: translateX(-110%); transition: transform .22s; box-shadow: 10px 0 40px -10px rgba(0, 0, 0, .4); padding-left: 10px; }
  .mail.drawer .folders { transform: none; }
  .tablet-only { display: inline-grid !important; }
}
@media (min-width: 1181px) { .tablet-only { display: none !important; } }
@media (max-width: 760px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); order: 2; border-top: 1px solid var(--line); }
  .rail .mark, .rail .grow, .rail [data-tip]:hover::after { display: none; }
  .rail .theme { display: none; }
  .stage { order: 1; }
  .mail { grid-template-columns: 1fr; }
  .folders { left: 0; width: 84vw; bottom: 64px; }
  .list { border-radius: 0; }
  .reader { display: none; padding: 12px 10px 30px; }
  .mail.show-reader .list { display: none; }
  .mail.show-reader .reader { display: block; }
  .reader-bar .back { display: inline-grid; }
  .sheet { padding: 22px 18px 26px; border-radius: 12px; }
  .sheet h1 { font-size: 21px; }
  .sheet .from { flex-wrap: wrap; }
  .sheet .from time { order: 3; width: 100%; padding-left: 56px; margin-top: -6px; }
  .compose-wrap { padding: 0; }
  .composer, .compose-wrap.full .composer { width: 100%; height: 100dvh; border-radius: 0; }
  .split { grid-template-columns: 1fr; }
  .split > .side { border-radius: 0; }
  .split.detail > .side { display: none; }
  .split:not(.detail) > .main { display: none; }
  .split > .main { padding: 14px 10px 30px; }
  .card { padding: 22px 18px; }
  .cal { padding: 12px 8px; }
  .cal-head h2 { font-size: 21px; min-width: 0; flex-basis: 100%; }
  .day { padding: 3px; }
  .chip { font-size: 0; height: 6px; padding: 0; border-radius: 3px; }
  .week .wh div b { font-size: 16px; }
  .mobile-only { display: inline-grid !important; }
  .theme-pick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Download-Seite ---------- */
.dl-page .letter.dl { width: min(520px, 100%); }
.dl-page .dl-btn { display: flex; width: 100%; justify-content: center; height: 50px; font-size: 16px; text-decoration: none; background: #3D5FD9; border-color: #3D5FD9; color: #fff; }
.dl-page .dl-meta { color: var(--sheet-muted); font-size: 14px; margin: 12px 0 0; text-align: center; }
.dl-page .dl-note { margin-top: 20px; padding: 12px 16px; border-radius: 10px; background: #F1F4FA; color: #46516C; font-size: 13.5px; }
.dl-page .foot a { color: #3D5FD9; }
.auth .foot a { color: #3D5FD9; }
.card input[type=checkbox], .dialog input[type=checkbox], .card input[type=radio], .dialog input[type=radio] { color-scheme: light; accent-color: #3D5FD9; width: 16px; height: 16px; }
