/* Servuspost.at - Stylesheet
   Farben und Abstaende nach den Entwuerfen in design/.
   Keine externen Schriften oder Ressourcen (CSP: nur 'self'). */

:root {
    --navy-950: #0c2240;
    --navy-900: #10294a;
    --navy-850: #143259;
    --navy-800: #1a3c66;
    --navy-700: #1f4d7c;
    --brand: #1f4e7a;
    --brand-hover: #183f63;
    --blue: #1f6bd1;
    --blue-hover: #1858ad;
    --blue-50: #eef4fc;
    --blue-100: #dce9f8;
    --logo-dark: #012c4f;
    --logo-light: #004a9e;
    --at-red: #d22630;

    --text: #1a2b3c;
    --text-strong: #10243c;
    --muted: #5d6d80;
    --faint: #8a98a8;
    --border: #dfe5ec;
    --border-strong: #c9d3de;
    --bg: #f3f6fa;
    --surface: #ffffff;
    --hover: #f4f7fb;

    --success: #2c9a5c;
    --success-bg: #e6f5ec;
    --warning: #c27a12;
    --warning-bg: #fdf3e2;
    --danger: #d64045;
    --danger-bg: #fdeeee;
    --danger-border: #f5c9ca;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 36, 60, .06);
    --shadow: 0 4px 16px rgba(16, 36, 60, .08);
    --shadow-lg: 0 18px 48px rgba(16, 36, 60, .18);

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 236px;
    --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text-strong); margin: 0; line-height: 1.25; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
:focus-visible { outline: 3px solid rgba(31, 107, 209, .45); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none !important; }
.logo-mark { width: 44px; height: auto; }
.logo-text { font-size: 26px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.logo-text b { font-weight: 800; color: var(--logo-dark); letter-spacing: -.01em; }
.logo-text span { font-weight: 400; color: var(--logo-light); }
.logo-sm .logo-mark { width: 30px; }
.logo-sm .logo-text { font-size: 19px; }
.logo-lg { flex-direction: column; gap: 14px; }
.logo-lg .logo-mark { width: 96px; }
.logo-lg .logo-text { font-size: 50px; }
.logo-on-dark .logo-text b, .logo-on-dark .logo-text span { color: #fff; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 15px; line-height: 1;
    cursor: pointer; text-decoration: none !important; white-space: nowrap;
    transition: background-color .12s, border-color .12s, color .12s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 0 24px; }
.btn-block { display: flex; width: 100%; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-hover); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-outline { background: #fff; border-color: var(--border-strong); color: var(--text-strong); }
.btn-outline:hover { background: var(--hover); }
.btn-outline-brand { background: #fff; border-color: var(--brand); color: var(--brand); }
.btn-outline-brand:hover { background: var(--blue-50); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b9353a; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text-strong); }
.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 10px; border-left: 1px solid rgba(255,255,255,.25); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.hint { font-size: 13px; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 107, 209, .15);
}
.textarea { min-height: 120px; resize: vertical; }
.select {
    appearance: none; padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6d80' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 50px; }
.input-lg { min-height: 52px; font-size: 16px; }
.input-icon .toggle-password {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
}
.input-icon.has-toggle .input { padding-right: 52px; }
.input-addon { display: flex; }
.input-addon .input-icon { flex: 1; }
.input-addon .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon .addon {
    display: flex; align-items: center; padding: 0 16px;
    background: var(--bg); border: 1px solid var(--border-strong); border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-strong); font-size: 15px;
}
.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; }
.checkbox input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 22px; margin: 0; border-radius: 11px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(18px); }
.form-error { color: var(--danger); font-size: 14px; }
.input.is-invalid { border-color: var(--danger); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.divider-text { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 15px; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Hinweise ---------- */
.notice {
    display: flex; gap: 12px; padding: 16px 18px;
    background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius);
    font-size: 14px; color: var(--text);
}
.notice > .icon { color: var(--brand); margin-top: 1px; }
.notice strong { display: block; color: var(--text-strong); margin-bottom: 2px; }
.notice-success { background: var(--success-bg); border-color: #bfe3cd; }
.notice-success > .icon { color: var(--success); }
.notice-warning { background: var(--warning-bg); border-color: #f3dcb0; }
.notice-warning > .icon { color: var(--warning); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-border); }
.notice-danger > .icon { color: var(--danger); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 10px; color: var(--brand); font-size: 14px; }
.checklist li .icon { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-info { background: var(--blue-100); color: var(--blue); }
.badge-muted { background: #eef1f5; color: var(--muted); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--blue); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.dot-unread { background: var(--blue); }

/* ---------- Fortschritt / Speicher ---------- */
.progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 3px; background: #8fb5e6; }
.progress-light { background: var(--border); }
.progress-light > span { background: var(--blue); }
.progress-danger > span { background: var(--danger); }
.progress-lg { height: 10px; border-radius: 5px; }

/* ==========================================================================
   Anmelde-Layout (Login, Passwort vergessen)
   ========================================================================== */
.auth-page {
    min-height: 100vh; display: flex; flex-direction: column;
    background:
        linear-gradient(to bottom, rgba(240, 245, 250, .78) 0%, rgba(240, 245, 250, .45) 30%, rgba(240, 245, 250, 0) 50%, rgba(12, 34, 64, 0) 70%, rgba(12, 34, 64, .45) 100%),
        var(--navy-800) url("../img/background.jpg") center 40% / cover no-repeat;
}
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 56px 20px 40px; }
.auth-brand { text-align: center; margin-bottom: 40px; }
.auth-brand .tagline { margin-top: 14px; font-size: 19px; color: #2b3e52; }
.auth-card {
    width: 100%; max-width: 510px; padding: 44px 32px 34px;
    background: rgba(255,255,255,.97); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: 17px; margin: 10px 0 32px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .row-between { margin: 4px 0 28px; }
.auth-card .row-between a { font-size: 15px; font-weight: 500; color: var(--brand); }
.auth-card-sm { max-width: 400px; padding: 32px 28px 28px; }
.auth-card-sm h1 { font-size: 24px; }
.auth-card-sm .lead { font-size: 14px; margin: 8px 0 24px; }
.auth-card .center-link { display: block; text-align: center; margin-top: 18px; font-weight: 600; color: var(--brand); }
.auth-features {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0;
    margin-top: 56px; color: #fff;
}
.auth-features li { display: flex; align-items: center; gap: 14px; padding: 2px 52px; font-size: 14px; line-height: 1.4; }
.auth-features li + li { border-left: 1px solid rgba(255,255,255,.35); }
.auth-features .icon { width: 30px; height: 30px; }
.auth-features { list-style: none; padding: 0; }
.site-footer { background: rgba(14, 34, 60, .88); color: rgba(255,255,255,.85); font-size: 14px; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; padding: 26px 20px; }
.site-footer a { color: inherit; padding: 0 14px; }
.site-footer a + a { border-left: 1px solid rgba(255,255,255,.3); }
.flash { margin-bottom: 20px; }

/* ==========================================================================
   Registrierung
   ========================================================================== */
/* Willkommensseite mit Foto */
.reg-hero {
    min-height: 100vh; display: flex; flex-direction: column; padding: 40px 56px 0; color: var(--text-strong);
    background:
        linear-gradient(to bottom, rgba(240, 245, 250, .8) 0%, rgba(240, 245, 250, .5) 35%, rgba(240, 245, 250, 0) 55%, rgba(12, 34, 64, .15) 75%, rgba(12, 34, 64, .55) 100%),
        var(--navy-800) url("../img/background.jpg") 75% center / cover no-repeat;
}
.reg-hero-top { display: flex; align-items: center; justify-content: space-between; }
.reg-hero-top a.login-link { color: var(--text-strong); font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.reg-hero-body { margin-top: 14vh; max-width: 520px; }
.reg-hero h1 { font-size: 46px; letter-spacing: -.02em; }
.reg-hero .sub { font-size: 21px; margin-top: 20px; color: #22364b; }
.reg-points { list-style: none; padding: 0; margin: 64px 0 0; display: grid; gap: 22px; color: #fff; }
.reg-points li { display: flex; gap: 16px; font-size: 15px; line-height: 1.4; }
.reg-points .icon { width: 30px; height: 30px; }
.reg-points b { font-weight: 600; display: block; }
.reg-hero .cta { margin: 56px 0 48px; }
.reg-hero .cta .btn { min-width: 320px; }
.reg-hero .cta p { margin-top: 26px; color: #e6eef7; font-size: 15px; }
.reg-hero .cta p a { color: #fff; text-decoration: underline; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.reg-hero .site-footer { margin: auto -56px 0; }

/* Schritte */
.reg-steps-page { background: #f6f9fc; }
.reg-panel { position: relative; min-height: 100vh; display: flex; flex-direction: column; padding: 40px 56px 220px; overflow: hidden; }
.reg-panel::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 200px;
    background: url("../img/mountains.svg") bottom / 100% 100% no-repeat; pointer-events: none;
}
.reg-panel-top { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; width: 100%; margin: 0 auto; }
.reg-panel-top a { color: var(--text-strong); display: inline-flex; gap: 8px; align-items: center; font-size: 15px; }
.reg-content { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 56px auto 0; }
.steps { display: flex; justify-content: space-between; margin: 0 0 64px; padding: 0; position: relative; }
.steps li { list-style: none; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; font-size: 14px; color: var(--muted); text-align: center; }
.steps li::before {
    content: ""; position: absolute; top: 15px; left: calc(-50% + 30px); right: calc(50% + 30px);
    height: 2px; background: var(--border);
}
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.current::before { background: var(--brand); }
.steps .num {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong); background: #fff; font-weight: 600; color: var(--text); font-size: 14px;
}
.steps li.current .num, .steps li.done .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.steps li.current { color: var(--text-strong); font-weight: 600; }
.steps li.done { color: var(--text-strong); }
.steps .num .icon { width: 16px; height: 16px; }
.reg-content h1 { font-size: 30px; margin-bottom: 18px; }
.reg-content .lead { font-size: 17px; color: #33475c; margin-bottom: 34px; }
.reg-content .btn-lg { margin-top: 8px; }
.reg-content .notice { margin-top: 40px; }
.reg-content .checklist { margin: 4px 0 26px; padding: 18px 20px; background: #eef3f9; border-radius: var(--radius); }
.reg-content .checkbox { margin-bottom: 30px; }
.recovery-code {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    padding: 22px; margin: 8px 0 18px; background: #fff; border: 2px dashed var(--border-strong); border-radius: var(--radius);
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px; font-weight: 600; letter-spacing: .06em; color: var(--text-strong);
}
.summary { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 20px; margin-bottom: 24px; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 15px; }
.summary div + div { border-top: 1px solid var(--border); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; color: var(--text-strong); text-align: right; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }
.button-row .btn { flex: 1; }

/* ==========================================================================
   App-Layout (Webmail, Kalender, Einstellungen, Admin)
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: var(--topbar-h) minmax(0, 1fr); min-height: 100vh; height: 100vh; }
.topbar {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 24px;
    padding: 0 24px 0 0; background: #fff; border-bottom: 1px solid var(--border); z-index: 20;
}
.topbar .brand { width: var(--sidebar-w); padding-left: 22px; display: flex; align-items: center; gap: 10px; }
.topbar .menu-btn { display: none; }
.topbar-search { flex: 1; max-width: 520px; position: relative; }
.topbar-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 18px; height: 18px; }
.topbar-search input { width: 100%; height: 40px; padding: 0 14px 0 42px; border: 1px solid transparent; border-radius: 20px; background: var(--bg); }
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,107,209,.12); }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--navy-800); color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar .icon { width: 22px; height: 22px; }
.user-text { line-height: 1.25; }
.user-text b { display: block; font-size: 14px; color: var(--text-strong); font-weight: 600; }
.user-text span { font-size: 12px; color: var(--muted); }

.sidebar {
    background: var(--navy-900); color: #d7e2ef; display: flex; flex-direction: column;
    padding: 18px 14px 16px; overflow-y: auto;
}
.sidebar .compose-btn { margin: 0 4px 22px; min-height: 42px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 0 12px;
    border-radius: var(--radius-sm); color: #d7e2ef; font-size: 15px; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--navy-800); color: #fff; font-weight: 600; }
.nav a .count { margin-left: auto; }
.nav a .icon { width: 19px; height: 19px; opacity: .9; }
.nav-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 12px 8px; font-size: 14px; color: #c3d1e2; }
.nav-title button { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px; }
.sidebar-bottom { margin-top: auto; padding: 22px 8px 0; }
.storage-label { font-size: 14px; color: #d7e2ef; margin-bottom: 10px; }
.storage-row { display: flex; align-items: center; gap: 10px; }
.storage-row .progress { flex: 1; }
.storage-row a { color: #c3d1e2; display: inline-flex; }
.storage-text { font-size: 12px; color: #aebdd0; margin-top: 8px; }
.sidebar-bottom .progress-danger > span { background: var(--danger); }

.main { overflow: auto; background: var(--bg); padding: 20px; }
.main-flush { padding: 0; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 14px; }

/* Bottom-Navigation (nur Handy) */
.bottom-nav { display: none; }

/* ---------- Nachrichtenliste ---------- */
.mail-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 20px; height: 100%; }
.mail-layout.single { grid-template-columns: minmax(0, 1fr); }
.list-panel { display: flex; flex-direction: column; min-height: 0; }
.list-head { padding: 18px 20px 0; }
.list-head .row-between h1 { font-size: 20px; }
.list-head .tools { display: flex; gap: 2px; }
.tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 9px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; background: var(--blue-50); border-radius: 6px 6px 0 0; }
.tabs a:hover:not(.active) { color: var(--text-strong); }
.bulkbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.bulkbar .checkbox input { margin: 0; }
.bulkbar .spacer { flex: 1; }
.bulkbar .pager { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.messages { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.msg { display: grid; grid-template-columns: 24px 22px minmax(0, 1fr) auto; gap: 4px 10px; padding: 14px 16px 14px 12px; border-bottom: 1px solid var(--border); position: relative; }
.msg:hover { background: var(--hover); }
.msg.selected { background: var(--blue-50); }
.msg .sel { grid-row: 1 / span 3; padding-top: 2px; }
.msg .sel input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.msg .state { grid-row: 1 / span 3; padding-top: 5px; color: var(--faint); }
.msg .state .icon { width: 16px; height: 16px; }
.msg .from { font-size: 15px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .date { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.msg .subject { grid-column: 3; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .snippet { grid-column: 3; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .meta { grid-column: 4; grid-row: 2 / span 2; display: flex; justify-content: flex-end; align-items: flex-start; gap: 4px; color: var(--faint); }
.msg .meta .icon { width: 16px; height: 16px; }
.msg.unread .from, .msg.unread .subject { font-weight: 700; }
.msg a.cover { position: absolute; inset: 0; z-index: 0; }
.msg .sel, .msg .meta { position: relative; z-index: 1; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 24px; color: var(--muted); gap: 10px; height: 100%; }
.empty-state .icon { width: 48px; height: 48px; color: var(--border-strong); }
.empty-state h2 { font-size: 18px; }

/* ---------- Lesebereich ---------- */
.read-panel { display: flex; flex-direction: column; min-height: 0; }
.read-toolbar { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.read-toolbar .btn { color: var(--text); font-weight: 500; font-size: 14px; min-height: 34px; padding: 0 10px; }
.read-toolbar .spacer { flex: 1; }
.read-body { padding: 22px 28px 32px; overflow-y: auto; flex: 1; }
.read-subject { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.read-subject h1 { font-size: 22px; }
.read-subject .icon-btn { margin-left: auto; }
.sender { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }
.sender .who { flex: 1; min-width: 0; font-size: 14px; }
.sender .who b { color: var(--text-strong); font-size: 15px; }
.sender .who .addr { color: var(--muted); }
.sender .who .to { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sender .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mail-content { font-size: 15px; color: var(--text); max-width: 760px; }
.mail-content p + p { margin-top: 14px; }
.mail-quote { margin-top: 26px; padding: 4px 0 4px 18px; border-left: 3px solid var(--border); color: var(--muted); }
.mail-quote .q-head { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.mail-quote p + p { margin-top: 10px; }
.remote-images { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 20px; background: var(--warning-bg); border: 1px solid #f3dcb0; border-radius: var(--radius); font-size: 14px; }
.remote-images .icon { color: var(--warning); }
.remote-images .spacer { flex: 1; }
.attachments { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.attachment { display: flex; align-items: center; gap: 12px; min-width: 250px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.attachment .ficon { width: 36px; height: 36px; border-radius: 6px; background: var(--blue-50); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.attachment .fname { font-size: 14px; color: var(--text-strong); }
.attachment .fsize { font-size: 12px; color: var(--muted); }
.attachment .icon-btn { margin-left: auto; }

/* ---------- Verfassen ---------- */
.compose { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.compose-head { display: flex; align-items: center; gap: 4px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--border); }
.compose-head h2 { font-size: 15px; flex: 1; }
.compose-fields { padding: 0 20px; }
.compose-row { display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid var(--border); font-size: 14px; }
.compose-row label { width: 56px; color: var(--muted); flex: none; }
.compose-row input { flex: 1; border: 0; min-height: 44px; padding: 0; background: transparent; }
.compose-row input:focus { outline: none; }
.compose-row .chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 13px; background: var(--blue-50); color: var(--text-strong); font-size: 13px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; padding: 2px; }
.chip .icon { width: 14px; height: 14px; }
.compose-row .ccbcc { display: flex; gap: 12px; }
.compose-row .ccbcc a { color: var(--blue); font-size: 14px; }
.compose-row .subject-input { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; min-height: 36px; }
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.editor-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.editor-toolbar .icon-btn { width: 32px; height: 32px; color: var(--text); }
.editor-toolbar .icon-btn .icon { width: 17px; height: 17px; }
.editor-toolbar .right { margin-left: auto; }
.editor { flex: 1; padding: 18px 20px; overflow-y: auto; font-size: 15px; outline: none; }
.editor p + p { margin-top: 14px; }
.editor .signature { color: var(--muted); margin-top: 20px; }
.compose-attachments { padding: 0 20px 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.compose-attachments .attachment { min-width: 220px; }
.compose-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.compose-foot .saved { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.compose-foot .saved .icon { width: 15px; height: 15px; }

/* ---------- Status-Seiten (Fehler, Quote voll) ---------- */
.status-card { max-width: 620px; margin: 24px auto; padding: 40px 36px 30px; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.status-card.danger { background: #fff6f6; border-color: var(--danger-border); }
.status-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 20px; background: var(--danger); color: #fff; display: flex; align-items: center; justify-content: center; }
.status-icon .icon { width: 32px; height: 32px; }
.status-card h1 { font-size: 22px; margin-bottom: 12px; }
.status-card > p { color: #3b4d60; font-size: 15px; max-width: 460px; margin: 0 auto; }
.status-details { text-align: left; margin: 26px auto 0; max-width: 480px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 18px; }
.status-details div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; font-size: 14px; }
.status-details dt { color: var(--muted); }
.status-details dd { margin: 0; color: var(--text); }
.status-card .button-row { margin: 28px auto 0; max-width: 480px; }
.status-card .more { display: inline-flex; gap: 6px; align-items: center; margin-top: 20px; font-size: 14px; color: var(--text); }
.quota-bar { max-width: 480px; margin: 26px auto 0; text-align: left; }
.quota-bar .row-between { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- Einstellungen ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.settings-layout.wide { grid-template-columns: minmax(0, 1fr); }
.settings-card { padding: 24px 28px 28px; }
.settings-card h2 { font-size: 18px; margin-bottom: 20px; }
.settings-card h3 { font-size: 15px; margin: 26px 0 12px; }
.settings-card .field { max-width: 420px; }
.settings-card .field.full { max-width: none; }
.settings-card .actions { margin-top: 26px; display: flex; gap: 12px; }
.side-card { padding: 20px 22px; }
.side-card h3 { font-size: 15px; margin-bottom: 16px; }
.side-card dl { margin: 0; display: grid; gap: 14px; font-size: 14px; }
.side-card dt { color: var(--muted); font-size: 13px; }
.side-card dd { margin: 2px 0 0; color: var(--text-strong); }
.side-card .btn { margin-top: 18px; }
.settings-list { display: grid; gap: 12px; }
.settings-link { display: flex; align-items: center; gap: 18px; padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none !important; }
.settings-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.settings-link > .icon:first-child { color: var(--navy-800); width: 22px; height: 22px; }
.settings-link b { display: block; color: var(--text-strong); font-size: 15px; }
.settings-link span { font-size: 13px; color: var(--muted); }
.settings-link .icon:last-child { margin-left: auto; color: var(--faint); }
.option-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.option { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; }
.option + .option { border-top: 1px solid var(--border); }
.option b { display: block; font-size: 15px; color: var(--text-strong); font-weight: 600; }
.option span { font-size: 13px; color: var(--muted); }
.storage-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.storage-big b { font-size: 30px; color: var(--text-strong); }
.storage-big span { color: var(--muted); }
.storage-breakdown { margin-top: 22px; display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.storage-breakdown div { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 14px; }
.storage-breakdown div + div { border-top: 1px solid var(--border); }
.storage-breakdown span { color: var(--muted); }
.code-box { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 18px; font-weight: 600; letter-spacing: .05em; padding: 16px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; color: var(--text-strong); }
.danger-zone { border: 1px solid var(--danger-border); background: #fffafa; border-radius: var(--radius); padding: 20px; }
.danger-zone h3 { margin-top: 0; color: var(--danger); }
.danger-zone p { font-size: 14px; color: var(--text); margin-bottom: 16px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--text-strong); padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 13px; }
.table td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.table .num { white-space: nowrap; }
.table .status { display: inline-flex; align-items: center; gap: 8px; }
.table .mini-progress { width: 70px; height: 4px; margin-top: 6px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.pagination .current { background: var(--bg); border: 1px solid var(--border); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { display: block; font-size: 26px; color: var(--text-strong); margin-top: 6px; }
.stat small { font-size: 12px; color: var(--muted); }
.health { display: grid; gap: 0; }
.health div { display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-size: 14px; }
.health div + div { border-top: 1px solid var(--border); }
.health span:last-child { margin-left: auto; color: var(--muted); font-size: 13px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }

/* ---------- Dialog ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 36, 60, .35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(520px, 100%); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ---------- Kalender (nach design/05-kalender.png) ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.cal-title-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.cal-title-row h1 { font-size: 26px; }
.cal-title-icon { color: var(--navy-800); }
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-range { flex: 1; text-align: center; font-size: 22px; min-width: 160px; }
.btn-square { width: 40px; padding: 0; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.segmented a { padding: 9px 16px; font-size: 14px; color: var(--text); text-decoration: none; }
.segmented a + a { border-left: 1px solid var(--border-strong); }
.segmented a.active { background: var(--blue-50); color: var(--blue); font-weight: 600; }
.segmented-solid a.active { background: var(--blue); color: #fff; }
.cal-panel { overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid .dow { padding: 14px 12px; font-size: 14px; font-weight: 500; color: var(--text-strong); text-align: center; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal-grid .dow:nth-child(7) { border-right: 0; }
.cal-day { min-height: 104px; padding: 10px 8px 8px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.cal-grid .cal-day:nth-child(7n + 7) { border-right: 0; }
.cal-grid .cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day .d { font-size: 13px; color: var(--text); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; margin: -4px 0 0 -4px; }
.cal-day.other .d { color: var(--faint); }
.cal-day.today { background: var(--blue-50); }
.cal-day.today .d { background: var(--blue); color: #fff; font-weight: 600; }
.event { display: flex; align-items: center; gap: 5px; font-size: 11.5px; letter-spacing: -.01em; line-height: 1.35; color: var(--muted); text-decoration: none !important; min-width: 0; }
.event span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event time { flex: none; }
.event:hover { color: var(--text-strong); }
.dot-green { background: #2fae6a; } .dot-blue { background: var(--blue); } .dot-purple { background: #7b4fd6; } .dot-red { background: #e2474c; } .dot-orange { background: var(--warning); }
.dot-lg { width: 14px; height: 14px; border-radius: 4px; }
.cal-side { display: grid; gap: 14px; }
.mini-cal { padding: 16px 14px 10px; }
.mini-cal .row-between { margin-bottom: 8px; font-weight: 600; font-size: 15px; color: var(--text-strong); }
.mini-cal table { width: 100%; border-collapse: collapse; text-align: center; font-size: 12px; }
.mini-cal th { color: var(--muted); font-weight: 500; padding: 4px 0; }
.mini-cal td { padding: 2px 0; }
.mini-cal td span { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; }
.mini-cal td.other span { color: var(--border-strong); }
.mini-cal td.today span { background: var(--blue); color: #fff; font-weight: 600; }
.cal-box { padding: 14px 14px 12px; }
.cal-box h2 { font-size: 15px; margin-bottom: 8px; }
.cal-box h3 { font-size: 13px; margin: 12px 0 4px; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-list li { display: flex; align-items: center; justify-content: space-between; }
.cal-list .checkbox { align-items: center; font-size: 14px; gap: 8px; }
.cal-list .checkbox input { width: 16px; height: 16px; margin: 0; }
.cal-list .icon-btn { width: 28px; height: 28px; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 10px 44px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 0; font-size: 13px; }
.agenda .dot { align-self: center; }
.agenda .t { color: var(--text); }
.agenda .what b { display: block; font-weight: 500; color: var(--text-strong); }
.agenda .what span { font-size: 12px; color: var(--muted); }
.more-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 500; }

/* Wochenansicht: 08:00-18:00, 48 px pro Stunde */
.week-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); grid-template-rows: auto 528px; }
.wk-corner { border-bottom: 1px solid var(--border); }
.wk-dow { padding: 12px 6px; font-size: 12px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.wk-dow.today { background: var(--blue-50); color: var(--text-strong); font-weight: 600; }
.wk-hours { position: relative; }
.wk-hour { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.wk-hour:first-child { transform: none; }
.wk-col { position: relative; border-left: 1px solid var(--border);
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--border) 47px, var(--border) 48px); }
.wk-col.today { background-color: rgba(238, 244, 252, .6); }
.wk-event { position: absolute; left: 4px; right: 4px; padding: 4px 6px; border-radius: 4px; border-left: 3px solid; font-size: 11px; line-height: 1.3; color: var(--text-strong); overflow: hidden; text-decoration: none !important; }
.wk-event time { display: block; font-weight: 600; }
.bg-green { background: #e3f5ea; border-color: #2fae6a; } .bg-blue { background: #dfeafa; border-color: var(--blue); }
.bg-purple { background: #ece5fa; border-color: #7b4fd6; } .bg-red { background: #fbe4e5; border-color: #e2474c; }

/* Termindetails als Seitenteil */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(16, 36, 60, .25); display: flex; justify-content: flex-end; }
.drawer { width: min(400px, 100%); height: 100%; background: #fff; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 22px; }
.ev-detail-title { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.ev-detail-title h3 { font-size: 18px; }
.ev-badge { width: 40px; height: 40px; border-radius: 8px; background: var(--navy-800); color: #fff; display: flex; align-items: center; justify-content: center; }
.ev-facts { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.ev-facts li { display: flex; align-items: center; gap: 14px; }
.ev-facts .icon { color: var(--navy-800); }
.drawer h4 { font-size: 14px; color: var(--text-strong); margin-bottom: 4px; }
.ev-desc { font-size: 14px; margin-bottom: 20px; }
.ev-people { padding: 14px 16px; }
.btn-outline-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger-bg); }
.ev-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.time-range { display: flex; align-items: center; gap: 8px; }
.ev-remind { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.ev-remind .checkbox { margin-top: 12px; }
.textarea-sm { min-height: 72px; }

/* ---------- Rechtstexte / einfache Seiten ---------- */
.plain-page { max-width: 760px; margin: 40px auto; padding: 0 20px; }
.plain-page .panel { padding: 32px; }
.plain-page h1 { font-size: 26px; margin-bottom: 16px; }

/* ---------- Vorschau-Uebersicht ---------- */
.preview-index { max-width: 980px; margin: 40px auto; padding: 0 20px 60px; }
.preview-index h1 { font-size: 28px; margin: 22px 0 8px; }
.preview-index > p { color: var(--muted); margin-bottom: 28px; }
.preview-index section { margin-bottom: 28px; }
.preview-index h2 { font-size: 16px; margin-bottom: 12px; }
.preview-index ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.preview-index li a { display: block; padding: 14px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-strong); font-weight: 500; text-decoration: none; }
.preview-index li a:hover { border-color: var(--blue); }
.preview-index li a span { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.preview-banner { position: fixed; right: 12px; bottom: 12px; z-index: 100; display: flex; gap: 8px; align-items: center; padding: 6px 8px 6px 12px; background: rgba(16, 36, 60, .9); color: #fff; font-size: 12px; border-radius: 16px; }
.preview-banner a { color: #fff; text-decoration: underline; }

/* ==========================================================================
   Responsiv
   ========================================================================== */
@media (max-width: 1200px) {
    .settings-layout { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .mail-layout { grid-template-columns: minmax(0, 1fr); }
    .mail-layout .read-panel.optional { display: none; }
    .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    body { font-size: 15px; }
    .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr) auto; }
    .topbar { padding: 0 12px; gap: 8px; }
    .topbar .brand { width: auto; padding-left: 0; flex: 1; justify-content: center; }
    .topbar .menu-btn { display: inline-flex; order: -1; }
    .topbar-search { display: none; }
    .topbar .user { margin-left: 0; }
    .topbar .user-text { display: none; }
    .topbar .avatar { background: transparent; color: var(--text-strong); border: 1.5px solid var(--text-strong); width: 30px; height: 30px; }
    .sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .main { padding: 12px; }
    .main.mobile-flush { padding: 0; }
    .main.mobile-flush .panel { border-radius: 0; border-left: 0; border-right: 0; }
    .bottom-nav { display: flex; grid-column: 1; justify-content: space-around; background: #fff; border-top: 1px solid var(--border); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); text-decoration: none; min-width: 72px; }
    .bottom-nav a.active { color: var(--blue); font-weight: 600; }
    .fab { position: fixed; right: 18px; bottom: 84px; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 25; }
    .fab .icon { width: 24px; height: 24px; }
    .compose { border-radius: 0; min-height: calc(100vh - 120px); }
    .auth-features { display: none; }
    .auth-main { padding-top: 36px; }
    .logo-lg .logo-mark { width: 72px; }
    .logo-lg .logo-text { font-size: 38px; }
    .auth-card { padding: 32px 22px 26px; }
    .reg-hero { padding: 28px 24px 0; }
    .reg-hero .site-footer { margin: auto -24px 0; }
    .reg-hero h1 { font-size: 36px; }
    .reg-hero-body { margin-top: 8vh; }
    .reg-hero .cta .btn { min-width: 0; width: 100%; }
    .reg-panel { padding: 24px 20px 180px; }
    .reg-content { margin-top: 32px; }
    .steps { margin-bottom: 40px; }
    .read-body { padding: 18px; }
    .settings-card { padding: 20px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .cal-grid .dow { padding: 8px 4px; font-size: 11px; }
}
@media (min-width: 861px) {
    .fab { display: none; }
    .mobile-only { display: none !important; }
}

/* ---------- Druckansicht ---------- */
@media print {
    .topbar, .sidebar, .bottom-nav, .read-toolbar, .list-panel, .fab, .preview-banner { display: none !important; }
    .app { display: block; height: auto; }
    .main { padding: 0; overflow: visible; }
    .mail-layout { display: block; }
    .panel { border: 0; box-shadow: none; }
    body { background: #fff; }
}

/* Breiten fuer Fortschrittsbalken (Klassen statt style-Attribut, wegen CSP) */
.w-0 { width: 0%; }
.w-5 { width: 5%; }
.w-10 { width: 10%; }
.w-15 { width: 15%; }
.w-20 { width: 20%; }
.w-25 { width: 25%; }
.w-30 { width: 30%; }
.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-45 { width: 45%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-65 { width: 65%; }
.w-70 { width: 70%; }
.w-75 { width: 75%; }
.w-80 { width: 80%; }
.w-85 { width: 85%; }
.w-90 { width: 90%; }
.w-95 { width: 95%; }
.w-100 { width: 100%; }
.auth-card .invite-hint { text-align: center; margin-top: 14px; }

/* Positionen in der Wochenansicht (halbe Stunden ab 08:00) */
.top-0 { top: 2px; }
.top-1 { top: 26px; }
.top-2 { top: 50px; }
.top-3 { top: 74px; }
.top-4 { top: 98px; }
.top-5 { top: 122px; }
.top-6 { top: 146px; }
.top-7 { top: 170px; }
.top-8 { top: 194px; }
.top-9 { top: 218px; }
.top-10 { top: 242px; }
.top-11 { top: 266px; }
.top-12 { top: 290px; }
.top-13 { top: 314px; }
.top-14 { top: 338px; }
.top-15 { top: 362px; }
.top-16 { top: 386px; }
.top-17 { top: 410px; }
.top-18 { top: 434px; }
.top-19 { top: 458px; }
.top-20 { top: 482px; }
.len-1 { height: 20px; }
.len-2 { height: 44px; }
.len-3 { height: 68px; }
.len-4 { height: 92px; }
.len-5 { height: 116px; }
.len-6 { height: 140px; }
.len-7 { height: 164px; }
.len-8 { height: 188px; }

/* ---------- Ergaenzungen ---------- */
.auth-brand-row { width: 100%; max-width: 1100px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 48px; }
.back-link { color: var(--text-strong); display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.card-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.mono-input { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.list-wrap { display: flex; min-height: 0; }
.list-wrap > .panel { flex: 1; }
.status-icon-info { background: var(--navy-800); }
.hint-block { display: block; margin-bottom: 16px; }
.field-spaced { margin-top: 16px; }
.notice-spaced { margin-top: 20px; }
.settings-card-spaced { margin-top: 20px; }
.side-progress { margin-top: 8px; }
.code-box-sm { font-size: 13px; padding: 10px; margin-top: 10px; letter-spacing: 0; }
.editor-toolbar-boxed { border: 1px solid var(--border-strong); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 4px 8px; }
.textarea-attached { border-top-left-radius: 0; border-top-right-radius: 0; min-height: 140px; }
.back-settings { margin-bottom: 12px; }
.reg-recovery { margin-top: 6px; }
.reg-confirm { margin-top: 28px; }
.settings-card h3.first { margin-top: 0; }
.user-menu { width: 28px; height: 28px; }
.option > .badge { margin-left: auto; }
.option .btn { flex: none; }
@media (max-width: 1100px) {
    .optional-list { display: none; }
    .cal-layout { grid-template-columns: minmax(0, 1fr); }
    .cal-side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 860px) {
    .cal-range { order: -1; flex-basis: 100%; text-align: left; }
    .cal-day { min-height: 64px; padding: 6px 4px; }
    .cal-day .event span:last-child, .cal-day .event time { display: none; }
    .cal-day .event { gap: 0; }
    .week-grid { overflow-x: auto; grid-template-columns: 44px repeat(7, minmax(90px, 1fr)); }
    .ev-when, .ev-remind { grid-template-columns: minmax(0, 1fr); }
    .auth-brand-row { margin-bottom: 24px; }
}

@media (max-width: 860px) { .preview-banner { bottom: 76px; right: 8px; } }

/* Lesbarkeit weisser Schrift auf dem Foto */
.reg-points, .reg-hero .cta p, .auth-features { text-shadow: 0 1px 3px rgba(5, 20, 40, .55); }

/* Hinweis zum KI-generierten Hintergrundfoto, unten rechts */
.status-page, .auth-page, .reg-hero { position: relative; }
.image-credit {
    position: absolute; right: 12px; bottom: 8px; margin: 0;
    font-size: 11px; color: rgba(255, 255, 255, .85); text-shadow: 0 1px 2px rgba(5, 20, 40, .7);
    pointer-events: none;
}

/* ==========================================================================
   Fehler- und Wartungsseiten (design/08-wartung.png)
   ========================================================================== */
.status-page {
    min-height: 100vh; display: flex; flex-direction: column;
    background:
        linear-gradient(to bottom, rgba(240, 245, 250, .55) 0%, rgba(240, 245, 250, .25) 35%, rgba(240, 245, 250, 0) 60%),
        var(--navy-800) url("../img/background.jpg") center 40% / cover no-repeat;
}
.status-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 64px 20px 40px; }
.status-brand { margin-bottom: 64px; }
.status-brand .logo-mark { width: 74px; }
.status-brand .logo-text { font-size: 44px; }
.status-box {
    width: 100%; max-width: 620px; padding: 36px 40px 40px; text-align: center;
    background: rgba(255, 255, 255, .86); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.status-symbol { width: 80px; height: 80px; margin: 0 auto 18px; }
.status-glyph { width: 80px; height: 80px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #287fc9; color: #fff; }
.status-glyph .icon { width: 40px; height: 40px; stroke-width: 2.2; }
.status-box h1 { font-size: 34px; letter-spacing: -.01em; margin-bottom: 16px; }
.status-text { color: #3b4d60; font-size: 16px; line-height: 1.7; max-width: 460px; margin: 0 auto; }
.status-text p + p { margin-top: 10px; }
.status-eta { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--border); }
.status-eta-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: #3b4d60; }
.status-eta-label .icon { color: var(--brand); width: 20px; height: 20px; }
.status-eta-value { font-size: 22px; font-weight: 700; color: var(--text-strong); margin-top: 8px; }
.status-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.status-note { margin-top: 22px; font-size: 13px; color: var(--muted); }
.status-code { margin-top: 18px; font-size: 12px; color: var(--faint); }
.status-centered .status-main { justify-content: center; padding-top: 40px; padding-bottom: 80px; }
.status-footer nav { display: flex; justify-content: center; flex-wrap: wrap; padding: 22px 20px 28px; font-size: 13px; }
.status-footer a { color: #fff; padding: 0 16px; text-shadow: 0 1px 3px rgba(5, 20, 40, .6); }
.status-footer a + a { border-left: 1px solid rgba(255, 255, 255, .5); }
@media (max-width: 860px) {
    .status-main { padding-top: 36px; }
    .status-brand { margin-bottom: 32px; }
    .status-brand .logo-mark { width: 52px; }
    .status-brand .logo-text { font-size: 30px; }
    .status-box { padding: 28px 22px 30px; }
    .status-box h1 { font-size: 26px; }
    .status-text { font-size: 15px; }
    .status-text br { display: none; }
    .status-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   Handy und Touch: Bedienbarkeit
   ========================================================================== */
.ri-text { flex: 1; }
.ri-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.modal { max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-body { overflow-y: auto; }
.nav-backdrop { display: none; }

/* Grosse Tippflaechen auf Touch-Geraeten (Apple/Google empfehlen 44-48 px) */
@media (pointer: coarse) {
    .icon-btn { width: 44px; height: 44px; }
    .editor-toolbar .icon-btn { width: 40px; height: 40px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 40px; }
    .nav a { min-height: 46px; }
    .msg .sel input, .bulkbar .checkbox input { width: 22px; height: 22px; }
    .msg .sel { padding: 0; margin: -10px 0 0 -10px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
    .msg { grid-template-columns: 34px 18px minmax(0, 1fr) auto; }
    .checkbox input { width: 22px; height: 22px; }
    .switch input { width: 48px; height: 28px; border-radius: 14px; }
    .switch input::after { width: 22px; height: 22px; }
    .switch input:checked::after { transform: translateX(20px); }
    .tabs a { padding: 12px 14px; }
    .segmented a { padding: 11px 16px; }
}

@media (max-width: 860px) {
    /* iOS zoomt bei Eingabefeldern unter 16 px ungefragt in die Seite */
    .input, .select, .textarea, .topbar-search input, .compose-row input, .editor { font-size: 16px; }

    /* Seitenmenue: Hintergrund zum Schliessen */
    body.nav-open .nav-backdrop { display: block; position: fixed; inset: 56px 0 0 0; z-index: 29; background: rgba(16, 36, 60, .35); }
    body.nav-open { overflow: hidden; }

    /* Werkzeugleiste der Mail: nur Icons */
    .read-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 6px 8px; }
    .read-toolbar .tb-label { display: none; }
    .read-toolbar .btn { padding: 0 10px; }
    .read-subject { flex-wrap: wrap; gap: 8px; }
    .read-subject h1 { font-size: 20px; flex: 1 1 100%; }
    .read-subject .icon-btn { margin-left: auto; }
    .sender { flex-wrap: wrap; }
    .sender .when { flex-basis: 100%; padding-left: 58px; margin-top: -8px; }
    .remote-images { flex-direction: column; align-items: flex-start; }
    .remote-images .spacer { display: none; }
    .attachment { min-width: 0; width: 100%; }

    /* Tabellen als Karten */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--border); }
    .table-cards tr:last-child { border-bottom: 0; }
    .table-cards td { padding: 3px 0; border: 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; align-items: baseline; }
    .table-cards td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); }
    .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { content: none; }
    .table-cards td:first-child { font-weight: 600; color: var(--text-strong); grid-template-columns: minmax(0, 1fr); padding-right: 48px; }
    .table-cards td:first-child::before { display: none; }
    .table-cards td:last-child:has(.icon-btn) { position: absolute; top: 6px; right: 6px; width: auto; display: block; padding: 0; }
    .table-cards td:last-child:has(.btn) { grid-template-columns: minmax(0, 1fr); padding-top: 10px; }
    .table-cards td:last-child:has(.btn)::before { display: none; }
    .table-cards .mini-progress { width: 100%; max-width: 160px; }
    .table-foot { flex-direction: column; gap: 10px; }

    .page-head { margin-bottom: 16px; }
    .page-head .btn { width: 100%; }
    .page-head .segmented { width: 100%; overflow-x: auto; }
    .option { flex-wrap: wrap; }
    .option > div { flex: 1 1 200px; }
    .settings-card .field { max-width: none; }
    .settings-card .actions .btn, .danger-zone .btn { width: 100%; }
    .modal-foot .btn { flex: 1; }
    .drawer-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .cal-head .btn-primary { flex: 1; }
    .two-col { gap: 0; }
}
@media (max-width: 860px) {
    .table-cards td:last-child:has(.icon-btn)::before { display: none; }
}
@media (max-width: 1100px) {
    .read-toolbar { flex-wrap: nowrap; overflow-x: auto; }
    .read-toolbar .tb-label { display: none; }
    .remote-images { flex-direction: column; align-items: flex-start; }
    .remote-images .spacer { display: none; }
}
