/* ==========================================================================
   Reffinet Mail – Stylesheet im Design von panel.reffinet.com
   Mobile-first: Basis = Handy (ab 320 px), dann 600 / 768 / 900 / 1024 / 1280 px.
   CSP: keine Inline-Styles, keine externen Fonts – System-Schriften.
   Animationen nur über transform/opacity, prefers-reduced-motion wird respektiert.
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Design-Tokens                                                              */
/* -------------------------------------------------------------------------- */
:root {
    --bg: #070b16;
    --bg-card: #0e1629;
    --bg-item: #0a1220;
    --bg-hover: #15233c;
    --bg-elev: #111b31;
    --accent: #7c8cff;
    --accent2: #a78bfa;
    --teal: #2dd4bf;
    --green: #34d399;
    --red: #f87171;
    --yellow: #fbbf24;
    --blue: #60a5fa;
    --text: #f4f6fb;
    --text2: #9aabc8;
    --text3: #5d6d8a;
    --border: rgba(255, 255, 255, .08);
    --border2: rgba(255, 255, 255, .14);
    --accent-soft: rgba(124, 140, 255, .14);
    --accent-line: rgba(124, 140, 255, .22);
    --ring: 0 0 0 3px rgba(124, 140, 255, .32);
    --r-xs: 8px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --shadow-card: 0 18px 50px rgba(0, 0, 0, .35);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, .22);
    --surface-shine: inset 0 1px 0 rgba(255, 255, 255, .07);
    --grad-text: linear-gradient(90deg, #9aa8ff, #c4b5fd 45%, #5eead4);
    --grad-primary: linear-gradient(135deg, rgba(124, 140, 255, .32), rgba(167, 139, 250, .22));
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t-fast: 150ms;
    --t-mid: 220ms;
    --t-slow: 320ms;
    --tap: 44px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --topbar-h: calc(58px + var(--safe-t));
    --gutter: 14px;
    color-scheme: dark;
}

@media (min-width: 768px) {
    :root { --topbar-h: calc(68px + var(--safe-t)); --gutter: 22px; }
}
@media (orientation: landscape) and (max-height: 500px) {
    :root { --topbar-h: calc(50px + var(--safe-t)); --gutter: 12px; }
}

/* -------------------------------------------------------------------------- */
/* Basis                                                                      */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--topbar-h) + 64px);
    overflow-x: clip;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: -.011em;
    color: var(--text);
    background:
        radial-gradient(1100px 600px at -10% -10%, rgba(124, 140, 255, .16), transparent 60%),
        radial-gradient(900px 520px at 110% -5%, rgba(45, 212, 191, .10), transparent 60%),
        radial-gradient(900px 700px at 50% 120%, rgba(167, 139, 250, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    padding-top: var(--topbar-h);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(500px 300px at 85% 30%, rgba(124, 140, 255, .06), transparent 70%);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

a { color: #aab6ff; text-decoration: none; transition: color var(--t-fast) var(--ease); }
@media (hover: hover) { a:hover { color: #c7cfff; } }

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 .8em; }
code, kbd { font-family: var(--mono); font-size: .88em; color: #c7d2fe; overflow-wrap: anywhere; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
img, svg, video { max-width: 100%; }

::selection { background: rgba(124, 140, 255, .35); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: rgba(124, 140, 255, .35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(124, 140, 255, .3); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--text2); }
.small { font-size: .85rem; }
.center { text-align: center; }
.gradient, .gradient-text {
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.copy-helper { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; }
[hidden] { display: none !important; }

.skip-link {
    position: fixed; left: 12px; top: 8px; z-index: 300;
    padding: 10px 16px; border-radius: var(--r-sm);
    background: var(--accent); color: #0b1020; font-weight: 700;
    transform: translateY(-150%);
    transition: transform var(--t-mid) var(--ease);
}
.skip-link:focus { transform: translateY(var(--safe-t)); }

/* -------------------------------------------------------------------------- */
/* Topbar (Glas)                                                              */
/* -------------------------------------------------------------------------- */
.topbar {
    position: fixed; inset: 0 0 auto 0; z-index: 100;
    height: var(--topbar-h);
    padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
    background: rgba(7, 11, 22, .72);
    -webkit-backdrop-filter: blur(28px) saturate(1.55);
    backdrop-filter: blur(28px) saturate(1.55);
    box-shadow: 0 1px 0 var(--accent-line);
    view-transition-name: topbar;
}
.topbar-inner {
    height: 100%;
    display: flex; align-items: center; gap: 8px;
    padding: 0 10px;
    max-width: 1600px; margin: 0 auto;
}
.topbar-start { display: flex; align-items: center; gap: 4px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.02rem; white-space: nowrap; }
.brand strong { font-weight: 800; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px; flex: none;
    display: block; object-fit: cover; background: #000;
    border: 1px solid rgba(192, 132, 252, .38);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 6px 20px rgba(168, 85, 247, .28);
    transition: box-shadow var(--t-mid) var(--ease);
}
@media (hover: hover) {
    .brand:hover .brand-mark { box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 6px 26px rgba(168, 85, 247, .5); }
}
.brand-text { display: none; }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.topnav .account { display: none; margin-left: 6px; }
.inline-form { display: inline-flex; margin: 0; }

.topsearch {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 2px;
    height: 44px; padding: 0 4px;
    background: rgba(10, 18, 32, .8);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.topsearch:focus-within { border-color: rgba(124, 140, 255, .55); box-shadow: var(--ring); }
.topsearch input {
    flex: 1; min-width: 0; height: 100%;
    background: transparent; border: 0; color: var(--text);
    font: inherit; font-size: 16px; padding: 0 4px;
}
.topsearch input:focus { outline: none; box-shadow: none; }
.topsearch .icon-btn { width: 38px; height: 38px; }
.page-mail .topnav > a.icon-btn[href="/mail"] { display: none; }

@media (min-width: 600px) {
    .brand-text { display: inline; }
    .topbar-inner { gap: 14px; padding: 0 16px; }
}
@media (min-width: 768px) {
    .topnav .account { display: inline-flex; }
    .topsearch { max-width: 640px; margin: 0 auto; }
}
@media (max-width: 599.98px) {
    .page-mail .brand { display: none; }
    .page-mail .topnav .topnav-logout { display: none; }
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
    --btn-bg: rgba(14, 22, 41, .85);
    --btn-border: var(--border2);
    --btn-color: var(--text);
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap);
    padding: 0 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--btn-color);
    font: inherit; font-weight: 600; font-size: .92rem; letter-spacing: -.005em;
    line-height: 1.2; white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--surface-shine);
    text-decoration: none;
    user-select: none;
    touch-action: manipulation;
    transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
        background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), opacity var(--t-fast);
}
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; pointer-events: none; }
@media (hover: hover) {
    .btn:hover { transform: translateY(-1px); border-color: rgba(124, 140, 255, .55); color: var(--btn-color); box-shadow: var(--surface-shine), 0 8px 22px rgba(0, 0, 0, .25); }
}
.btn-primary { --btn-bg: var(--grad-primary); --btn-border: rgba(124, 140, 255, .5); --btn-color: #eef0ff; background: var(--grad-primary); }
@media (hover: hover) { .btn-primary:hover { border-color: rgba(167, 139, 250, .8); box-shadow: var(--surface-shine), 0 10px 26px rgba(124, 140, 255, .25); } }
.btn-danger { --btn-bg: rgba(248, 113, 113, .12); --btn-border: rgba(248, 113, 113, .4); --btn-color: #fecaca; }
@media (hover: hover) { .btn-danger:hover { border-color: rgba(248, 113, 113, .75); } }
.btn-green { --btn-bg: rgba(52, 211, 153, .12); --btn-border: rgba(52, 211, 153, .4); --btn-color: #bbf7d0; }
.btn-ghost, .btn-outline { --btn-bg: transparent; }
.btn-text { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; color: var(--text2); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-link, .link-btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 6px;
    border: 0; background: none; color: #aab6ff; font: inherit; font-size: .85rem; cursor: pointer;
}
@media (pointer: coarse) { .btn-sm, .btn-link, .link-btn { min-height: var(--tap); } }

/* Ladezustand: Spinner im Button */
.btn.is-loading { color: transparent !important; }
.btn.is-loading > * { opacity: 0; }
.btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff;
    animation: spin .7s linear infinite;
}

.icon-btn, .tool-btn {
    position: relative;
    display: inline-grid; place-items: center;
    width: var(--tap); height: var(--tap);
    padding: 0; border-radius: 12px;
    border: 1px solid transparent; background: transparent;
    color: var(--text2); cursor: pointer;
    touch-action: manipulation;
    transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease),
        color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.icon-btn .icon, .tool-btn .icon { width: 20px; height: 20px; }
.icon-btn:active, .tool-btn:active { transform: scale(.92); }
.icon-btn.is-active { color: var(--text); background: var(--accent-soft); border-color: rgba(124, 140, 255, .3); }
@media (hover: hover) {
    .icon-btn:hover, .tool-btn:hover { color: var(--text); background: rgba(124, 140, 255, .1); border-color: rgba(124, 140, 255, .22); }
    .icon-btn-danger:hover, .tool-danger:hover { color: #fecaca; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); }
}
.icon-btn:disabled, .tool-btn:disabled, .tool-btn.is-disabled { opacity: .35; cursor: default; pointer-events: none; }
.icon-btn-sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn-sm .icon { width: 17px; height: 17px; }
@media (pointer: coarse) { .icon-btn-sm { width: var(--tap); height: var(--tap); } }
.icon-btn.is-copied, .btn.is-copied { color: var(--green); }
.nav-admin { color: var(--teal); }

.link-back { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); color: var(--text2); font-size: .9rem; }
@media (hover: hover) { .link-back:hover { color: var(--text); } }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--border2); background: var(--bg-item);
    color: var(--text2); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
    touch-action: manipulation;
    transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}
.chip:active { transform: scale(.95); }
.chip.is-active { color: #eef0ff; border-color: rgba(124, 140, 255, .6); background: var(--accent-soft); }
@media (hover: hover) { .chip:hover { border-color: rgba(124, 140, 255, .5); color: var(--text); } }
@media (pointer: coarse) { .chip { min-height: var(--tap); } }

.segmented {
    display: flex; gap: 4px; padding: 4px;
    background: var(--bg-item); border: 1px solid var(--border); border-radius: 12px;
    overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.segmented::-webkit-scrollbar { display: none; }
.seg {
    flex: none; display: inline-flex; align-items: center;
    min-height: 36px; padding: 0 12px; border-radius: 9px;
    color: var(--text2); font-size: .85rem; font-weight: 600; white-space: nowrap;
    transition: background-color var(--t-fast), color var(--t-fast);
}
.seg.is-active { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .35); }
@media (hover: hover) { .seg:hover { color: var(--text); } }
@media (pointer: coarse) { .seg { min-height: 40px; } }

.tabs {
    display: flex; gap: 4px; margin: -4px -4px 14px; padding: 4px;
    overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: var(--tap); padding: 0 14px;
    color: var(--text2); font-weight: 600; font-size: .9rem; white-space: nowrap;
}
.tab::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: -5px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0); transition: transform var(--t-mid) var(--ease-out);
}
.tab.is-active { color: var(--text); }
.tab.is-active::after { transform: scaleX(1); }
@media (hover: hover) { .tab:hover { color: var(--text); } }
.tab-count {
    min-width: 22px; padding: 0 7px; border-radius: 999px;
    font-size: .75rem; line-height: 20px; text-align: center;
    background: rgba(255, 255, 255, .07); color: var(--text2);
}

/* -------------------------------------------------------------------------- */
/* Formulare                                                                  */
/* -------------------------------------------------------------------------- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="date"], input[type="url"], select, textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 10px 12px;
    font-size: 16px; /* verhindert Zoom auf iOS */
    color: var(--text);
    background: var(--bg-item);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background-color var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"] { min-width: 0; }
select {
    padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%), linear-gradient(135deg, var(--text2) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(124, 140, 255, .7); box-shadow: var(--ring); background-color: #0c1526; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
@media (hover: hover) {
    input:not(:focus):not(:disabled):hover, select:not(:focus):not(:disabled):hover, textarea:not(:focus):not(:disabled):hover { border-color: rgba(255, 255, 255, .22); }
}
input[type="number"] { -moz-appearance: textfield; }

.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 12px; align-items: end; }
.field { display: grid; gap: 6px; min-width: 0; position: relative; }
.label { font-size: .82rem; font-weight: 600; color: var(--text2); }
.field-hint, .field-status { font-size: .8rem; color: var(--text3); line-height: 1.4; }
.field-status.is-ok { color: var(--green); }
.field-status.is-error { color: var(--red); }
.field-status.is-checking { color: var(--text2); }
.name-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; animation: fade-in var(--t-mid) var(--ease-out) both; }
.name-suggest[hidden] { display: none; }
.name-suggest-label { font-size: .8rem; color: var(--text2); margin-right: 2px; }
.name-suggest-chip {
    min-height: 32px; padding: 4px 12px; border-radius: 999px; font: inherit; font-size: .85rem; font-weight: 600;
    color: #e9d5ff; background: rgba(168, 85, 247, .12); border: 1px solid rgba(192, 132, 252, .35); cursor: pointer;
    overflow-wrap: anywhere; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.name-suggest-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.name-suggest-chip:active { transform: scale(.97); }
@media (hover: hover) { .name-suggest-chip:hover { background: rgba(168, 85, 247, .24); border-color: rgba(192, 132, 252, .6); } }
.field-error {
    font-size: .8rem; color: #fca5a5; line-height: 1.4;
    animation: fade-up var(--t-mid) var(--ease-out) both;
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: rgba(248, 113, 113, .7); }
.field.is-invalid input:focus, .field.is-invalid textarea:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }
.field.is-valid input { border-color: rgba(52, 211, 153, .55); }
.field.is-unavailable input { border-color: rgba(248, 113, 113, .55); }
.field-submit { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; min-height: var(--tap); padding-top: 10px; cursor: pointer; font-size: .9rem; }
.checkbox input, .msg-check input, .check-all input, .attachment-check input {
    width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); cursor: pointer;
}
.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; flex: 1; }
.input-suffix {
    display: inline-flex; align-items: center; padding: 0 12px;
    background: rgba(255, 255, 255, .04); color: var(--text2); font-size: .88rem;
    border: 1px solid var(--border2); border-left: 0;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis;
}
.input-group:focus-within .input-suffix { border-color: rgba(124, 140, 255, .7); }
@media (min-width: 600px) {
    .form-row { display: flex; flex-wrap: wrap; }
    .form-row > .field { flex: 1 1 160px; }
    .form-row > .field-grow { flex: 3 1 240px; }
    .form-row > .field-submit { flex: 0 0 auto; }
}

.search-field {
    position: relative; display: flex; align-items: center; min-width: 0;
}
.search-field > .icon { position: absolute; left: 12px; color: var(--text3); pointer-events: none; }
.search-field input { padding-left: 38px; }
.search-field + .table-wrap, .search-field + .addr-list { margin-top: 12px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .field-grow, .toolbar .search-field { flex: 1 1 220px; }

/* Schieberegler (touch-tauglich) */
input.range {
    width: 100%; height: var(--tap); margin: 0;
    background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
    touch-action: pan-y;
}
input.range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(124, 140, 255, .55), rgba(45, 212, 191, .45)); }
input.range::-moz-range-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(124, 140, 255, .55), rgba(45, 212, 191, .45)); }
input.range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%;
    background: #eef0ff; border: 3px solid var(--accent); box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
    transition: transform var(--t-fast) var(--ease);
}
input.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #eef0ff; border: 3px solid var(--accent); }
input.range:active::-webkit-slider-thumb { transform: scale(1.15); }
input.range:focus-visible { outline: none; }
input.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }

/* -------------------------------------------------------------------------- */
/* Schalter                                                                   */
/* -------------------------------------------------------------------------- */
.switch-form { display: inline-flex; margin: 0; position: relative; }
.switch {
    display: inline-flex; align-items: center; gap: 12px;
    min-height: var(--tap); cursor: pointer; user-select: none;
    touch-action: manipulation;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
    position: relative; flex: none;
    width: 50px; height: 30px; border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--border2);
    transition: background-color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.switch-track::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(135deg, var(--accent), var(--teal));
    opacity: 0; transition: opacity var(--t-mid) var(--ease);
}
.switch-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #e6e9f5; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
    transition: transform var(--t-mid) var(--ease-out);
}
.switch input:checked + .switch-track { border-color: transparent; }
.switch input:checked + .switch-track::before { opacity: 1; }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); background: #fff; }
.switch:active .switch-thumb { transform: scale(.9); }
.switch input:checked:active + .switch-track .switch-thumb { transform: translateX(20px) scale(.9); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch input:disabled + .switch-track { opacity: .45; }
.switch-label { font-size: .92rem; color: var(--text); }
.switch-form.is-busy .switch-track::after {
    content: ""; position: absolute; inset: -5px; border-radius: 999px;
    border: 2px solid transparent; border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
.switch-stack { display: grid; gap: 4px; margin: 6px 0 12px; }

/* -------------------------------------------------------------------------- */
/* Seitenrahmen                                                               */
/* -------------------------------------------------------------------------- */
.main-page {
    width: 100%; max-width: 1180px; margin: 0 auto;
    padding: 20px calc(var(--gutter) + var(--safe-r)) calc(40px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
    animation: page-in var(--t-slow) var(--ease-out) both;
}
.footer { padding: 24px var(--gutter) calc(24px + var(--safe-b)); border-top: 1px solid var(--border); color: var(--text2); font-size: .85rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 1.5rem; }
.page-head .sub { color: var(--text2); margin: 0; max-width: 72ch; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.page-head-row { display: flex; gap: 14px; align-items: center; min-width: 0; }
.page-head-row h1 { overflow-wrap: anywhere; margin-bottom: 4px; }
@media (min-width: 768px) { .page-head h1 { font-size: 1.85rem; } .page-head { margin-bottom: 24px; } }

/* -------------------------------------------------------------------------- */
/* Karten & Raster                                                            */
/* -------------------------------------------------------------------------- */
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid { gap: 18px; } }
@media (min-width: 1024px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 > .span-2 { grid-column: 1 / -1; }
}

.card {
    position: relative;
    min-width: 0;
    padding: 16px;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 28%), var(--bg-card);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: var(--shadow-card), var(--surface-shine);
    transition: transform var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
@media (min-width: 768px) { .card { padding: 22px; } }
@media (hover: hover) {
    .card:hover { border-color: rgba(124, 140, 255, .22); }
    a.card:hover, .feature-card:hover { transform: translateY(-4px); }
}
.card-admin { border-left: 3px solid var(--teal); }
.card-danger { border-color: rgba(248, 113, 113, .22); }
.card-danger h2 { color: #fecaca; }
.card-hero {
    background:
        radial-gradient(500px 200px at 0% 0%, rgba(124, 140, 255, .18), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 30%), var(--bg-card);
}
.card-narrow { max-width: 460px; margin: 4vh auto 0; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.card-head h2 .icon { color: var(--accent); }
.card-admin .card-head h2 .icon { color: var(--teal); }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.card.is-inactive > *:not(.card-head) { opacity: .62; }
.section-title { margin: 20px 0 10px; font-size: .9rem; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; }
.split { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.empty-inline { padding: 18px; text-align: center; border: 1px dashed var(--border2); border-radius: var(--r-md); margin: 6px 0 0; }

.hero-address { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; margin-bottom: 14px; }
@media (min-width: 600px) { .hero-address { font-size: 1.35rem; } }

.stat-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat {
    display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md);
    background: var(--bg-item); border: 1px solid var(--border); color: var(--text);
    transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.stat:active { transform: scale(.98); }
@media (hover: hover) { .stat:hover { transform: translateY(-2px); border-color: rgba(124, 140, 255, .35); color: var(--text); } }
.stat .k, .sum-card .k { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3); }
.stat .v { font-size: 1.4rem; font-weight: 800; }
.stat-danger .v { color: #fca5a5; }

/* Admin: Verdächtige Aktivität */
@media (min-width: 768px) { .abuse-card .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.abuse-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.abuse-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px;
    background: var(--bg-item); border: 1px solid var(--border); border-radius: var(--r-md);
}
.abuse-item form { margin-left: auto; }
.abuse-reject { border-color: rgba(248, 113, 113, .25); }
.abuse-detail {
    flex-basis: 100%; font-family: var(--mono); font-size: .8rem; color: #fecaca;
    overflow-wrap: anywhere; white-space: normal;
}
.table tr.is-suspicious td { background: rgba(248, 113, 113, .06); }
.text-danger { color: #fca5a5; }
.compose-count { margin: 0; padding: 8px 14px 8px 78px; color: var(--text3); border-bottom: 1px solid var(--border); }
.compose-count.is-over { color: #fca5a5; font-weight: 600; }
.compose-quota { margin: 10px 14px; }
@media (max-width: 600px) { .compose-count { padding-left: 14px; } }
.quota-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.client-notice { margin: 0 0 12px; font-size: .95rem; line-height: 1.5; }
.client-notice strong { display: block; margin-bottom: 2px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.client-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .02); }
.client-box.is-locked { border-color: rgba(251, 191, 36, .28); }
.client-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .95rem; }
.client-box h3 .pill { margin-left: auto; }
.client-list { margin: 0; }
.client-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.client-row:first-child { border-top: 0; }
.client-row dt { color: var(--text3); font-size: .8rem; font-weight: 600; padding-top: 3px; }
.client-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; overflow-wrap: anywhere; }
.client-row dd small { flex-basis: 100%; color: var(--text3); }
.client-row code { font-size: .92rem; }
.client-row .btn { padding: 2px 8px; }
@media (max-width: 480px) { .client-row { grid-template-columns: minmax(0, 1fr); } }
.limit-actions { display: grid; gap: 14px; margin-top: 12px; }
.limit-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.limit-inline .field { flex: 1 1 180px; margin: 0; }
.limit-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 10px; }
.limit-stats > div { padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.limit-stats > div.is-custom { border-color: rgba(96, 165, 250, .4); background: rgba(96, 165, 250, .08); }
.limit-stats dt { font-size: .78rem; color: #9aa3b8; }
.limit-stats dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 600; }
.limit-stats dd small { display: block; font-size: .72rem; font-weight: 400; color: #bae6fd; }
.limit-sub { margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .95rem; }
.limit-custom { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-top: 10px; }
.limit-custom .field { margin: 0; }
.limit-custom-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }

.sum-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 768px) { .sum-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; } }
.sum-card {
    --bar: linear-gradient(90deg, var(--accent), var(--accent2));
    position: relative; overflow: hidden;
    display: grid; gap: 4px; padding: 14px 16px 14px;
    border-radius: var(--r-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%), var(--bg-card);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: var(--shadow-soft), var(--surface-shine);
    color: var(--text);
    transition: transform var(--t-mid) var(--ease), border-color var(--t-mid);
}
.sum-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--bar); }
.sum-card .v { font-size: 1.35rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
@media (min-width: 768px) { .sum-card .v { font-size: 1.6rem; } }
@media (hover: hover) { a.sum-card:hover { transform: translateY(-3px); border-color: rgba(124, 140, 255, .3); color: var(--text); } }
.sum-green { --bar: linear-gradient(90deg, var(--green), var(--teal)); }
.sum-red { --bar: linear-gradient(90deg, var(--red), #fb923c); }
.sum-yellow { --bar: linear-gradient(90deg, var(--yellow), #fb923c); }
.sum-teal { --bar: linear-gradient(90deg, var(--teal), var(--blue)); }

.storage-grid { display: grid; gap: 18px; }
@media (min-width: 768px) { .storage-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }

.quick-links { display: grid; gap: 8px; }
@media (min-width: 600px) { .quick-links { grid-template-columns: 1fr 1fr; } }
.quick-link {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
    border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border); color: var(--text);
    transition: transform var(--t-fast) var(--ease), border-color var(--t-fast);
}
.quick-link .icon { color: var(--teal); }
@media (hover: hover) { .quick-link:hover { transform: translateY(-2px); border-color: rgba(45, 212, 191, .4); color: var(--text); } }

.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 16px; margin: 0; }
.kv dt { color: var(--text3); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 600px) {
    .kv { grid-template-columns: max-content minmax(0, 1fr); }
    .kv dt { margin-top: 0; padding: 7px 0; }
    .kv dd { padding: 6px 0; }
}
.kv-inline { display: inline-block; margin-right: 10px; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.disclosure > summary { cursor: pointer; color: #aab6ff; min-height: var(--tap); display: flex; align-items: center; gap: 8px; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "▸"; transition: transform var(--t-fast) var(--ease); }
.disclosure[open] > summary::before { transform: rotate(90deg); }
.disclosure[open] > *:not(summary) { animation: fade-up var(--t-mid) var(--ease-out) both; }
.disclosure-card { margin-bottom: 14px; padding: 4px 14px 14px; border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border); }

/* Messbalken */
.meter-block { display: grid; gap: 8px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; color: var(--text2); font-weight: 600; }
.meter {
    position: relative; height: 10px; overflow: hidden;
    border-radius: 999px; background: rgba(255, 255, 255, .07);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}
.meter-sm { height: 6px; }
.meter-fill {
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--teal));
    transform-origin: 0 50%;
    transition: transform 700ms var(--ease-out);
}
.meter.is-warn .meter-fill { background: linear-gradient(90deg, #f59e0b, var(--yellow)); }
.meter.is-danger .meter-fill { background: linear-gradient(90deg, #ef4444, var(--red)); }
.p-0 { transform: scaleX(0); } .p-5 { transform: scaleX(.05); } .p-10 { transform: scaleX(.1); } .p-15 { transform: scaleX(.15); }
.p-20 { transform: scaleX(.2); } .p-25 { transform: scaleX(.25); } .p-30 { transform: scaleX(.3); } .p-35 { transform: scaleX(.35); }
.p-40 { transform: scaleX(.4); } .p-45 { transform: scaleX(.45); } .p-50 { transform: scaleX(.5); } .p-55 { transform: scaleX(.55); }
.p-60 { transform: scaleX(.6); } .p-65 { transform: scaleX(.65); } .p-70 { transform: scaleX(.7); } .p-75 { transform: scaleX(.75); }
.p-80 { transform: scaleX(.8); } .p-85 { transform: scaleX(.85); } .p-90 { transform: scaleX(.9); } .p-95 { transform: scaleX(.95); }
.p-100 { transform: scaleX(1); }

/* Badges / Pills */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
    color: #c7d2fe; background: var(--accent-soft); border: 1px solid rgba(124, 140, 255, .28);
}
.pill .icon { width: 14px; height: 14px; }
.pill-ok { color: #a7f3d0; background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .3); }
.pill-warn { color: #fde68a; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.pill-danger { color: #fecaca; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); }
.pill-muted { color: var(--text2); background: rgba(255, 255, 255, .05); border-color: var(--border2); }
.pill-info { color: #bae6fd; background: rgba(96, 165, 250, .12); border-color: rgba(96, 165, 250, .3); }

/* Hinweise */
.notice {
    display: block; padding: 12px 14px; margin: 10px 0;
    border-radius: var(--r-md); font-size: .9rem;
    color: #c7d2fe; background: rgba(124, 140, 255, .08); border: 1px solid rgba(124, 140, 255, .25);
}
.notice-info { color: #bae6fd; background: rgba(96, 165, 250, .08); border-color: rgba(96, 165, 250, .25); }
.notice-warn { color: #fde68a; background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .28); }
.notice-error { color: #fecaca; background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); }
.notice-ok { color: #a7f3d0; background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .28); }
.notice-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* Kopierzeile, Adresslisten */
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border); }
.copy-row-tight { padding: 0; background: none; border: 0; margin-top: 2px; }
.addr-text { font-size: .92rem; color: #dbe2ff; overflow-wrap: anywhere; min-width: 0; }
.addr-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.addr-item {
    position: relative;
    display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 10px 10px 10px 14px; border-radius: var(--r-md);
    background: var(--bg-item); border: 1px solid var(--border);
    transition: border-color var(--t-fast), opacity var(--t-mid);
}
@media (hover: hover) { .addr-item:hover { border-color: rgba(124, 140, 255, .25); } }
.addr-item.is-inactive .addr-main { opacity: .55; }
.addr-item.is-new { border-color: rgba(52, 211, 153, .45); animation: fade-up var(--t-slow) var(--ease-out) both; }
.addr-main { display: grid; gap: 2px; min-width: 0; transition: opacity var(--t-mid); }
.addr-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.addr-actions { display: flex; align-items: center; gap: 2px; }
.addr-settings { margin-top: 6px; }
.addr-settings > summary {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
    font-size: .85rem; font-weight: 600; color: var(--text2); border-radius: 8px; padding: 2px 4px;
    transition: color var(--t-fast, .15s) var(--ease, ease);
}
.addr-settings > summary::-webkit-details-marker { display: none; }
.addr-settings > summary svg { width: 15px; height: 15px; transition: transform var(--t-mid) var(--ease-out); }
.addr-settings[open] > summary { color: var(--text); }
@media (hover: hover) { .addr-settings > summary:hover { color: var(--text); } }
.addr-settings[open] > summary svg { transform: rotate(60deg); }
.addr-settings-form { display: grid; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.addr-settings-form textarea { min-height: 88px; resize: vertical; }
.addr-settings-form .form-actions { display: flex; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { .addr-settings > summary svg { transition: none; } }
.inline-edit { display: flex; gap: 6px; align-items: center; margin: 0; min-width: 0; }
.inline-edit input {
    min-height: 36px; padding: 6px 8px; border-color: transparent; background: transparent; font-size: 16px;
}
@media (min-width: 1024px) { .inline-edit input { font-size: .9rem; } }
.inline-edit input:focus { background: var(--bg); border-color: rgba(124, 140, 255, .6); }
@media (hover: hover) { .inline-edit input:not(:focus):hover { border-color: var(--border2); } }
@media (max-width: 479.98px) {
    .addr-item { grid-template-columns: minmax(0, 1fr); }
    .addr-actions { justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 6px; }
}

/* Vorschau Abwesenheit */
.mail-preview { border-radius: var(--r-md); border: 1px solid var(--border2); background: var(--bg-item); overflow: hidden; margin-bottom: 10px; }
.mail-preview-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.mail-preview-head span { overflow-wrap: anywhere; }
.mail-preview-body { padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 140px; font-size: .92rem; }
.mail-preview-body.is-empty { color: var(--text3); font-style: italic; }

/* Admin-Einstellungen */
.setting-list { display: grid; gap: 4px; }
.setting { position: relative; padding: 12px 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.setting:first-child { border-top: 0; padding-top: 0; }
.setting-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.setting-label { font-weight: 600; }
.setting .muted.small { margin: 0; }
.setting-form { max-width: 280px; }
.setting-reset { margin: 0; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; }
.pager-info { color: var(--text2); font-size: .88rem; }

/* -------------------------------------------------------------------------- */
/* Tabellen (auf schmalen Screens als Karten)                                 */
/* -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    text-align: left; padding: 11px 14px; white-space: nowrap;
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3);
    background: rgba(124, 140, 255, .07); border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color var(--t-fast); }
@media (hover: hover) { .table tbody tr:hover { background: rgba(124, 140, 255, .05); } }
.col-actions { text-align: right; white-space: nowrap; width: 1%; }
.col-actions form { display: inline-flex; }
.col-usage { min-width: 170px; }
.col-usage .meter { margin-bottom: 4px; }
.sort-link { color: var(--text3); display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.sort-link.is-sorted { color: #c7d2fe; }
@media (hover: hover) { .sort-link:hover { color: var(--text); } }
.row-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; min-height: 40px; overflow-wrap: anywhere; }
@media (hover: hover) { .row-link:hover { color: #c7d2fe; } }

@media (max-width: 767.98px) {
    .table-wrap:has(.table-cards) { border: 0; border-radius: 0; overflow: visible; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table-cards tr {
        position: relative;
        margin-bottom: 10px; padding: 10px 14px;
        border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border);
    }
    .table-cards td { position: relative; padding: 6px 0 6px 106px; border: 0; min-height: 32px; overflow-wrap: anywhere; }
    .table-cards td::before {
        content: attr(data-label);
        position: absolute; left: 0; top: 8px; width: 96px;
        font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3);
        line-height: 1.35;
    }
    .table-cards td:not([data-label])::before, .table-cards td[data-label=""]::before { content: none; }
    .table-cards td:not([data-label]), .table-cards td[data-label=""] { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 0; }
    .table-cards td.col-actions { width: 100%; justify-content: flex-end; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
    .table-cards td.col-actions:empty { display: none; }
    .table-cards .col-usage { min-width: 0; }
}
@media (min-width: 768px) {
    .table-users td[data-label="Adresse"] { min-width: 210px; overflow-wrap: anywhere; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
    .table-users .col-wide { display: none; }
}

/* -------------------------------------------------------------------------- */
/* Filterregeln (Drag & Drop mit Pointer Events)                              */
/* -------------------------------------------------------------------------- */
.rule-table { display: grid; gap: 6px; }
.rule-head {
    display: none;
    grid-template-columns: 34px 30px minmax(0, 1fr) 70px auto;
    gap: 10px; padding: 8px 12px; border-radius: 12px;
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text3);
    background: rgba(124, 140, 255, .07);
}
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rule-list.is-busy { opacity: .7; pointer-events: none; }
.rule {
    position: relative;
    border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border);
    transition: border-color var(--t-fast), box-shadow var(--t-mid), opacity var(--t-mid);
}
.rule.is-inactive .rule-text { opacity: .5; }
.rule.is-editing { border-color: rgba(124, 140, 255, .45); }
.rule-row {
    display: grid; align-items: center; gap: 4px 8px; padding: 6px 8px;
    grid-template-columns: var(--tap) minmax(0, 1fr) auto;
    grid-template-areas: "grip text switch" "actions actions actions";
}
.rule-grip {
    grid-area: grip;
    display: grid; place-items: center; width: var(--tap); height: var(--tap);
    color: var(--text3); cursor: grab; border-radius: 10px;
    touch-action: none;
}
.rule-grip:active { cursor: grabbing; color: var(--accent); }
@media (hover: hover) { .rule-grip:hover { color: var(--text); background: rgba(255, 255, 255, .05); } }
.rule-pos { display: none; color: var(--text3); font-weight: 700; font-variant-numeric: tabular-nums; }
.rule-text { grid-area: text; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; transition: opacity var(--t-mid); }
.rule-switch { grid-area: switch; }
.rule-actions { grid-area: actions; display: flex; justify-content: flex-end; gap: 2px; border-top: 1px solid var(--border); padding-top: 4px; }
.rule-actions form { display: inline-flex; margin: 0; }
.rule-edit { padding: 4px 12px 14px; border-top: 1px solid var(--border); animation: fade-up var(--t-mid) var(--ease-out) both; }
.rule.is-dragging {
    position: fixed; z-index: 150; margin: 0;
    border-color: rgba(124, 140, 255, .6);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55), var(--ring);
    pointer-events: none;
    opacity: .96;
}
.rule-placeholder {
    border-radius: var(--r-md);
    border: 2px dashed rgba(124, 140, 255, .45);
    background: rgba(124, 140, 255, .06);
    animation: fade-in var(--t-fast) var(--ease) both;
}
body.is-sorting { user-select: none; -webkit-user-select: none; cursor: grabbing; }
@media (min-width: 768px) {
    .rule-head { display: grid; }
    .rule-row { grid-template-columns: 34px 30px minmax(0, 1fr) 70px auto; grid-template-areas: "grip pos text switch actions"; padding: 6px 12px; gap: 10px; }
    .rule-grip { width: 34px; height: 40px; }
    .rule-pos { display: block; grid-area: pos; }
    .rule-actions { border: 0; padding: 0; }
}

/* -------------------------------------------------------------------------- */
/* Panel (Einstellungen / Admin)                                              */
/* -------------------------------------------------------------------------- */
.main-panel { width: 100%; }
.panel {
    width: 100%; max-width: 1400px; margin: 0 auto;
    display: grid; grid-template-columns: minmax(0, 1fr);
}
.panel-nav {
    position: sticky; top: var(--topbar-h); z-index: 50;
    background: rgba(7, 11, 22, .82);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    view-transition-name: panel-nav;
}
.panel-nav-head, .panel-nav-foot, .panel-group { display: none; }
.panel-links {
    position: relative;
    display: flex; gap: 2px;
    padding: 6px calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l));
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.panel-links::-webkit-scrollbar { display: none; }
.panel-link {
    position: relative; z-index: 1; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: var(--tap); padding: 0 14px; border-radius: 12px;
    color: var(--text2); font-weight: 600; font-size: .9rem; white-space: nowrap;
    scroll-snap-align: center;
    transition: color var(--t-fast) var(--ease);
}
.panel-link .icon { width: 18px; height: 18px; }
.panel-link.is-active { color: var(--text); }
.panel-link.is-active .icon { color: var(--accent); }
.page-panel .panel-nav[aria-label="Administration"] .panel-link.is-active .icon { color: var(--teal); }
@media (hover: hover) { .panel-link:hover { color: var(--text); } }
.panel-indicator {
    position: absolute; z-index: 0; left: 0; top: 6px; bottom: 8px;
    width: 0; border-radius: 12px;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .32);
    opacity: 0;
    transition: transform var(--t-slow) var(--ease-out), opacity var(--t-mid);
    pointer-events: none;
}
.panel-indicator::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.panel-indicator.is-ready { opacity: 1; }
.panel-indicator.no-anim { transition: opacity var(--t-mid); }
.panel-main {
    min-width: 0;
    padding: 18px calc(var(--gutter) + var(--safe-r)) calc(40px + var(--safe-b)) calc(var(--gutter) + var(--safe-l));
    animation: page-in var(--t-slow) var(--ease-out) both;
}
@media (orientation: landscape) and (max-height: 500px) {
    .panel-nav { position: relative; top: 0; }
}

@media (min-width: 900px) {
    .panel { grid-template-columns: 248px minmax(0, 1fr); gap: 0; }
    .panel-nav {
        position: sticky; top: var(--topbar-h);
        height: calc(100dvh - var(--topbar-h)); overflow-y: auto;
        display: flex; flex-direction: column;
        padding: 22px 14px 18px calc(14px + var(--safe-l));
        background: transparent; border-bottom: 0; border-right: 1px solid var(--border);
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .panel-nav-head { display: grid; gap: 6px; padding: 0 10px 16px; }
    .panel-nav-head strong { font-size: 1.05rem; }
    .panel-badge {
        justify-self: start; padding: 2px 10px; border-radius: 999px;
        font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
        color: #c7d2fe; background: var(--accent-soft); border: 1px solid rgba(124, 140, 255, .3);
    }
    .panel-nav[aria-label="Administration"] .panel-badge { color: #99f6e4; background: rgba(45, 212, 191, .12); border-color: rgba(45, 212, 191, .3); }
    .panel-links { flex-direction: column; padding: 0; overflow: visible; scroll-snap-type: none; }
    .panel-link { min-height: 42px; }
    .panel-indicator { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 0; }
    .panel-indicator::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
    .panel-nav[aria-label="Administration"] .panel-indicator { background: rgba(45, 212, 191, .1); box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .28); }
    .panel-nav[aria-label="Administration"] .panel-indicator::after { background: linear-gradient(180deg, var(--teal), var(--blue)); }
    .panel-group { display: block; margin: 14px 0 4px; padding: 0 14px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
    .panel-help .panel-link { min-height: 36px; font-size: .86rem; white-space: normal; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
    .panel-help .panel-link .icon { flex: none; width: 16px; height: 16px; }
    .panel-nav-foot { display: grid; gap: 2px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
    .panel-link-quiet { font-size: .85rem; color: var(--text3); }
    .panel-main { padding: 28px 32px 56px; }
}
@media (min-width: 1280px) { .panel-main { padding: 32px 44px 64px; } }

/* -------------------------------------------------------------------------- */
/* Toasts & Flash                                                             */
/* -------------------------------------------------------------------------- */
.toast-stack, .flash-stack {
    position: fixed; z-index: 400;
    left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r));
    bottom: calc(12px + var(--safe-b));
    display: grid; gap: 8px; justify-items: stretch;
    pointer-events: none;
}
.flash-stack { top: calc(var(--topbar-h) + 10px); bottom: auto; }
.toast, .flash {
    pointer-events: auto;
    display: flex; align-items: center; gap: 10px;
    min-height: 52px; padding: 8px 8px 8px 14px;
    border-radius: var(--r-md);
    background: rgba(17, 27, 49, .94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border2);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    font-size: .92rem;
    animation: toast-in var(--t-slow) var(--ease-out) both;
    touch-action: pan-y;
}
.flash { animation-name: flash-in; }
.toast-text, .flash > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-icon { width: 20px; height: 20px; }
.toast-success, .flash-success { border-color: rgba(52, 211, 153, .4); }
.toast-success .toast-icon { color: var(--green); }
.toast-error, .flash-error { border-color: rgba(248, 113, 113, .45); }
.toast-error .toast-icon { color: var(--red); }
.toast-info, .flash-info, .flash-warning { border-color: rgba(96, 165, 250, .4); }
.toast-info .toast-icon { color: var(--blue); }
.toast-close, .flash-close {
    display: grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 10px; background: transparent; color: var(--text2); cursor: pointer;
}
@media (hover: hover) { .toast-close:hover, .flash-close:hover { background: rgba(255, 255, 255, .07); color: var(--text); } }
.toast.is-hiding { animation: toast-out var(--t-mid) var(--ease) both; }
.flash.is-hiding { animation: flash-out var(--t-mid) var(--ease) both; }
@media (min-width: 600px) {
    .toast-stack { left: auto; right: calc(20px + var(--safe-r)); bottom: calc(20px + var(--safe-b)); width: 380px; }
    .flash-stack { left: auto; right: calc(20px + var(--safe-r)); width: 420px; }
}

/* -------------------------------------------------------------------------- */
/* Dialog                                                                     */
/* -------------------------------------------------------------------------- */
.dialog {
    padding: 0; border: 0; background: transparent; color: var(--text);
    width: 100%; max-width: 100%; max-height: 100%;
    margin: auto 0 0; /* Handy: von unten */
    overflow: visible;
}
.dialog::backdrop { background: rgba(3, 6, 14, .66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--t-mid) var(--ease); }
.dialog.is-open::backdrop { opacity: 1; }
.dialog-box {
    margin: 0;
    padding: 22px 18px calc(18px + var(--safe-b));
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 30%), var(--bg-elev);
    border: 1px solid var(--border2); border-bottom: 0;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
    transform: translateY(100%);
    transition: transform var(--t-slow) var(--ease-out);
    max-height: 90dvh; overflow-y: auto;
}
.dialog.is-open .dialog-box { transform: none; }
.dialog-icon {
    width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px;
    color: #fecaca; background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .3);
}
.dialog-title { font-size: 1.1rem; margin-bottom: 6px; }
.dialog-text { color: var(--text2); overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 18px; }
.dialog-actions .btn { width: 100%; }
@media (min-width: 600px) {
    .dialog { width: min(440px, calc(100vw - 32px)); margin: auto; }
    .dialog-box {
        padding: 24px; border-radius: var(--r-lg); border-bottom: 1px solid var(--border2);
        box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
        opacity: 0; transform: scale(.94) translateY(8px);
        transition: transform var(--t-mid) var(--ease-out), opacity var(--t-mid) var(--ease);
    }
    .dialog.is-open .dialog-box { opacity: 1; transform: none; }
    .dialog-actions { flex-direction: row; justify-content: flex-end; }
    .dialog-actions .btn { width: auto; }
}

/* -------------------------------------------------------------------------- */
/* Webmail                                                                    */
/* -------------------------------------------------------------------------- */
.main-app { width: 100%; }
.app-layout {
    display: grid; grid-template-columns: minmax(0, 1fr);
    max-width: 1600px; margin: 0 auto;
    min-height: calc(100dvh - var(--topbar-h));
}

/* Seitenleiste: Handy = Off-Canvas */
.sidebar {
    position: fixed; z-index: 120;
    top: 0; bottom: 0; left: 0;
    width: min(86vw, 300px);
    display: flex; flex-direction: column; gap: 10px;
    padding: calc(14px + var(--safe-t)) 12px calc(14px + var(--safe-b)) calc(12px + var(--safe-l));
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 30%), #0b1222;
    border-right: 1px solid var(--border2);
    box-shadow: 30px 0 60px rgba(0, 0, 0, .45);
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-104%);
    transition: transform var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow);
    visibility: hidden;
}
.sidebar.is-open { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease-out), visibility 0s; }
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 110;
    background: rgba(3, 6, 14, .6);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; transition: opacity var(--t-slow) var(--ease);
    touch-action: none;
}
.sidebar-backdrop.is-open { opacity: 1; }
body.has-drawer { overflow: hidden; }

.compose-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 50px; padding: 0 18px; border-radius: 14px;
    background: var(--grad-primary); border: 1px solid rgba(124, 140, 255, .5);
    color: #eef0ff; font-weight: 700;
    box-shadow: var(--surface-shine), 0 10px 26px rgba(124, 140, 255, .2);
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.compose-btn:active { transform: scale(.97); }
@media (hover: hover) { .compose-btn:hover { transform: translateY(-1px); color: #fff; box-shadow: var(--surface-shine), 0 14px 32px rgba(124, 140, 255, .3); } }
.folder-list { display: grid; gap: 2px; }
.folder {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    min-height: var(--tap); padding: 0 12px; border-radius: 12px;
    color: var(--text2); font-weight: 600; font-size: .92rem;
    transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease);
}
.folder:active { transform: scale(.98); }
.folder.is-active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(124, 140, 255, .32); }
.folder.is-active::after {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
}
.sidebar-head { display: grid; gap: 6px; padding: 2px 10px 6px; }
.sidebar-head strong { font-size: 1.05rem; }
.sidebar-head .panel-badge {
    justify-self: start; padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #c7d2fe; background: var(--accent-soft); border: 1px solid rgba(124, 140, 255, .3);
}
.folder.is-active .icon { color: var(--accent); }
.folder.has-unread { color: var(--text); }
@media (hover: hover) { .folder:not(.is-active):hover { background: rgba(255, 255, 255, .04); color: var(--text); } }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count {
    min-width: 24px; padding: 0 7px; border-radius: 999px; text-align: center;
    font-size: .75rem; font-weight: 800; line-height: 22px;
    color: #0b1020; background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.folder-masks { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; padding-top: 4px; }
.quota { margin-top: auto; padding: 12px; border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border); font-size: .82rem; }
.quota-head { display: flex; justify-content: space-between; color: var(--text2); font-weight: 600; margin-bottom: 8px; }
.quota-bar { width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .08); -webkit-appearance: none; appearance: none; display: block; }
.quota-bar::-webkit-progress-bar { background: rgba(255, 255, 255, .08); }
.quota-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 999px; }
.quota-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 999px; }
.quota.is-full .quota-bar::-webkit-progress-value { background: linear-gradient(90deg, #ef4444, var(--red)); }
.quota.is-full .quota-bar::-moz-progress-bar { background: linear-gradient(90deg, #ef4444, var(--red)); }
.quota-text { margin-top: 6px; color: var(--text3); }

.pane { min-width: 0; padding: 10px calc(8px + var(--safe-r)) calc(16px + var(--safe-b)) calc(8px + var(--safe-l)); animation: page-in var(--t-slow) var(--ease-out) both; }
.pane-card {
    min-width: 0;
    border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 120px), var(--bg-card);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: var(--shadow-card), var(--surface-shine);
    overflow: hidden;
    overflow: clip; /* hidden würde einen Scroll-Container erzeugen und position:sticky der Werkzeugleiste verschieben */
}

/* Werkzeugleiste in der Liste */
.pane-card .toolbar {
    position: sticky; top: var(--topbar-h); z-index: 20;
    margin: 0; gap: 2px; padding: 6px 8px;
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    background: rgba(14, 22, 41, .92);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.pane-card .toolbar::-webkit-scrollbar { display: none; }
.check-all { display: grid; place-items: center; width: var(--tap); height: var(--tap); flex: none; cursor: pointer; }
.toolbar-sep { width: 1px; height: 24px; background: var(--border2); margin: 0 4px; flex: none; }
.toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.toolbar-end .range { color: var(--text3); font-size: .8rem; padding: 0 6px; white-space: nowrap; }
.toolbar-form { display: flex; align-items: center; gap: 2px; margin: 0; }
.bulk-form.is-busy .msg-list { opacity: .65; transition: opacity var(--t-fast); }
@media (max-width: 479.98px) {
    .toolbar-end .range { display: none; }
    .bulk-form:not(.has-selection) [data-needs-selection] { display: none; }
}

.via-filter {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
    padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: .88rem; color: var(--text2);
}
.via-filter label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.via-filter label svg { width: 16px; height: 16px; }
.via-select { width: auto; min-width: 0; max-width: 100%; padding: 6px 10px; font-size: .88rem; }
.via-select.is-active { border-color: rgba(124, 140, 255, .6); background-color: var(--accent-soft); color: var(--text); }
.via-reset { font-size: .85rem; }
.via-filter { position: relative; z-index: 25; }
.via-filter .xsel { flex: 0 1 340px; }
@media (max-width: 600px) { .via-filter .xsel { flex: 1 1 100%; } }

/* Native Auswahlliste: dunkles Aufklappmenü, falls JavaScript fehlt */
select option, select optgroup { background-color: var(--bg-elev); color: var(--text); }
select optgroup { color: var(--text3); font-style: normal; }

/* Auswahlliste im Panel-Design (main.js: enhanceSelect) */
.xsel { position: relative; flex: 1 1 auto; min-width: 0; }
.xsel-native { position: absolute !important; inset: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.xsel-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 40px;
    padding: 4px 6px; border: 1px solid transparent; border-radius: var(--r-sm);
    background: transparent; color: var(--text); text-align: left; cursor: pointer;
    transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.xsel-compose .xsel-btn { margin-left: -6px; width: calc(100% + 6px); }
.xsel-boxed .xsel-btn { min-height: 40px; padding: 4px 10px 4px 6px; background: var(--bg-item); border-color: var(--border2); }
.xsel.is-filtered .xsel-btn { border-color: rgba(124, 140, 255, .6); background: var(--accent-soft); }
.xsel-btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: rgba(124, 140, 255, .7); }
.xsel.is-open .xsel-btn { background: var(--bg-hover); border-color: rgba(124, 140, 255, .45); }
@media (hover: hover) { .xsel-btn:hover { background: rgba(255, 255, 255, .04); border-color: var(--border2); } }
.xsel-btn > .xsel-content { flex: 1 1 auto; }
.xsel-caret {
    flex: none; width: 8px; height: 8px; margin: 0 6px 3px 4px;
    border-right: 2px solid var(--text2); border-bottom: 2px solid var(--text2); transform: rotate(45deg);
    transition: transform var(--t-mid) var(--ease-out), margin var(--t-mid) var(--ease-out);
}
.xsel.is-open .xsel-caret { transform: rotate(-135deg); margin-bottom: -3px; }

.xsel-content { display: flex; align-items: center; gap: 10px; min-width: 0; }
.xsel-ico {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--accent-soft); color: #c7cdff; box-shadow: inset 0 0 0 1px var(--accent-line);
}
.xsel-ico svg { width: 15px; height: 15px; }
.xsel-ico-custom { background: rgba(45, 212, 191, .13); color: #8ef1e2; box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .28); }
.xsel-ico-group { background: rgba(167, 139, 250, .15); color: #d6c9ff; box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .3); }
.xsel-ico-all { background: rgba(255, 255, 255, .06); color: var(--text2); box-shadow: inset 0 0 0 1px var(--border2); }
.xsel-ico-none { display: none; }
.xsel-text { display: grid; min-width: 0; line-height: 1.25; }
.xsel-primary, .xsel-secondary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsel-primary { font-weight: 600; font-size: .92rem; }
.xsel-secondary { font-size: .78rem; color: var(--text3); }

.xsel-list {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
    min-width: 100%; width: max-content; max-width: min(460px, calc(100vw - 28px));
    max-height: min(340px, 60vh); overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 6px; list-style: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 80px), var(--bg-elev);
    border: 1px solid var(--border2); border-radius: var(--r-md);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .5), var(--surface-shine);
    opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left;
    transition: opacity var(--t-fast) var(--ease), transform var(--t-mid) var(--ease-out);
    scrollbar-width: thin;
}
.xsel-compose .xsel-list { left: -6px; right: 0; width: auto; max-width: none; }
.xsel.opens-up .xsel-list { top: auto; bottom: calc(100% + 6px); transform: translateY(6px) scale(.98); transform-origin: bottom left; }
.xsel.is-open .xsel-list { opacity: 1; transform: none; }
.xsel-list:focus { outline: none; }
.xsel-group {
    padding: 10px 10px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text3);
}
.xsel-group:first-child { padding-top: 4px; }
.xsel-opt {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; border-radius: var(--r-sm);
    cursor: pointer; transition: background-color var(--t-fast) var(--ease);
}
.xsel-opt .xsel-content { flex: 1 1 auto; }
.xsel-opt.is-active { background: var(--bg-hover); }
.xsel-opt[aria-selected="true"] { background: var(--accent-soft); }
.xsel-opt[aria-selected="true"].is-active { background: rgba(124, 140, 255, .22); }
.xsel-opt[aria-selected="true"] .xsel-primary { color: #dfe3ff; }
.xsel-check { flex: none; width: 16px; height: 16px; color: var(--accent); opacity: 0; transform: scale(.6); transition: opacity var(--t-fast), transform var(--t-mid) var(--ease-out); }
.xsel-opt[aria-selected="true"] .xsel-check { opacity: 1; transform: none; }
@media (max-width: 600px) {
    .xsel-list { max-width: calc(100vw - 28px); }
    .xsel-opt { padding-top: 10px; padding-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .xsel-list, .xsel-caret, .xsel-check, .xsel-btn { transition: none; }
}
@media (max-width: 600px) { .via-select { flex: 1 1 100%; } }
.search-info { padding: 10px 16px; font-size: .88rem; color: var(--text2); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.new-mail-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 10px; padding: 8px 8px 8px 14px; border-radius: 12px;
    background: rgba(124, 140, 255, .12); border: 1px solid rgba(124, 140, 255, .35);
    font-weight: 600; font-size: .9rem;
    opacity: 0; transform: translateY(-8px);
    transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease-out);
}
.new-mail-banner.is-visible { opacity: 1; transform: none; }
.empty { padding: 64px 20px; text-align: center; color: var(--text2); }
.empty-icon { width: 54px; height: 54px; color: var(--text3); margin-bottom: 10px; }

/* Nachrichtenliste – Handy: zweizeilig */
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg {
    position: relative;
    display: flex; align-items: stretch;
    border-bottom: 1px solid var(--border);
    transition: background-color var(--t-fast);
}
.msg:last-child { border-bottom: 0; }
.msg::before {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    opacity: 0; transform: scaleY(.4); transition: opacity var(--t-fast), transform var(--t-mid) var(--ease-out);
}
.msg.is-unread::before { opacity: 1; transform: none; }
.msg.is-selected { background: rgba(124, 140, 255, .1); }
@media (hover: hover) { .msg:hover { background: rgba(124, 140, 255, .05); } }
.msg-check { display: grid; place-items: center; width: var(--tap); flex: none; cursor: pointer; padding-left: 4px; }
.msg-link {
    flex: 1; min-width: 0;
    display: grid; gap: 1px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "from meta" "subject subject";
    padding: 10px 14px 10px 2px;
    color: var(--text2);
}
.msg-link:active { background: rgba(124, 140, 255, .06); }
.msg-from { grid-area: from; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.msg-subject { grid-area: subject; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--text3); }
.msg-meta { grid-area: meta; display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text3); white-space: nowrap; }
.msg.is-unread .msg-from { color: var(--text); font-weight: 700; }
.msg.is-unread .msg-subject { color: var(--text2); }
.msg.is-unread .msg-meta time { color: #c7d2fe; font-weight: 700; }
.msg-flag { display: inline-flex; color: var(--text3); vertical-align: -2px; margin-right: 4px; }
.msg-flag .icon { width: 15px; height: 15px; }
.msg-draft { color: var(--red); font-weight: 700; margin-right: 6px; }
.mask-badge {
    display: inline-flex; align-items: center; gap: 4px; max-width: 12em;
    margin-right: 6px; padding: 0 8px; border-radius: 999px; vertical-align: 1px;
    font-size: .72rem; font-weight: 700; line-height: 20px;
    color: #c7d2fe; background: var(--accent-soft); border: 1px solid rgba(124, 140, 255, .25);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mask-badge .icon { width: 12px; height: 12px; }
.group-badge { color: #99f6e4; background: rgba(45, 212, 191, .1); border-color: rgba(45, 212, 191, .28); }
.msg.is-new { animation: msg-in var(--t-slow) var(--ease-out) both; }
.msg.is-removing, .is-removing { animation: remove-out var(--t-slow) var(--ease) both; pointer-events: none; }

/* Lesen */
.read-toolbar .tool-btn:first-child { margin-right: 4px; }
.message { padding: 16px 14px 20px; min-width: 0; }
.message-subject { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; margin-bottom: 8px; }
.folder-tag { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--text2); background: rgba(255, 255, 255, .06); border: 1px solid var(--border2); }
.mask-badge-lg { font-size: .78rem; line-height: 24px; max-width: none; }
.mask-badge-off { margin-left: 4px; color: var(--red); }
.mask-via { margin: 0 0 12px; }
.message-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.message-meta { min-width: 0; }
.message-from { overflow-wrap: anywhere; }
.message-to { overflow-wrap: anywhere; }
.message-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-body { overflow-wrap: anywhere; overflow-x: auto; font-size: 15px; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.message-body img { max-width: 100%; height: auto; }
.message-body table { max-width: 100%; }
.message-body pre { white-space: pre-wrap; font-family: var(--mono); font-size: .88rem; }
.message-body blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--border2); color: var(--text2); }
.attachments-block { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.attachments-title { font-weight: 700; font-size: .9rem; color: var(--text2); }
.attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attachment {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px;
    border-radius: var(--r-md); background: var(--bg-item); border: 1px solid var(--border); color: var(--text);
    transition: border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
@media (hover: hover) { .attachment:hover { border-color: rgba(124, 140, 255, .4); transform: translateY(-1px); color: var(--text); } }
.attachment-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { color: var(--text3); font-size: .8rem; white-space: nowrap; }
.attachment-dl { color: var(--accent); }
.attachment-check { cursor: pointer; }
.reply-bar { display: grid; gap: 8px; margin-top: 22px; }
@media (min-width: 600px) {
    .attachments { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .reply-bar { display: flex; flex-wrap: wrap; }
    .message { padding: 22px 26px 28px; }
    .message-subject { font-size: 1.4rem; }
    .message-head { grid-template-columns: auto minmax(0, 1fr) auto; }
    .message-actions { grid-column: auto; justify-content: flex-end; }
}

/* Schreiben */
.compose { padding: 0 0 calc(10px + var(--safe-b)); gap: 0; min-width: 0;
    border-radius: var(--r-lg); background: var(--bg-card); border: 1px solid rgba(255, 255, 255, .09); box-shadow: var(--shadow-card); overflow: hidden; overflow: clip; }
.compose-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); background: rgba(124, 140, 255, .06); }
.compose-head h1 { font-size: 1.05rem; margin: 0; }
.compose-notice { margin: 10px 14px; }
.compose-row { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.compose-row label { width: 56px; flex: none; color: var(--text3); font-size: .85rem; font-weight: 600; }
.compose-row input, .compose-row select { border: 0; background-color: transparent; padding-left: 0; min-width: 0; box-shadow: none; }
.compose-row input:focus, .compose-row select:focus { box-shadow: none; background-color: transparent; }
.compose-row:focus-within { box-shadow: inset 0 -2px 0 rgba(124, 140, 255, .6); }
.compose-from-static { overflow-wrap: anywhere; color: var(--text2); }
.compose-row.has-suggest { position: relative; }
.compose-row.has-suggest input { flex: 1 1 auto; }
.rcpt-list {
    position: absolute; z-index: 40; top: calc(100% + 4px); left: 70px; right: 14px;
    max-width: 520px; max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border2);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
.rcpt-item {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 6px 6px 12px;
    border-radius: 10px; cursor: pointer;
}
.rcpt-item.is-active { background: rgba(124, 140, 255, .16); }
.rcpt-text { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.rcpt-name, .rcpt-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcpt-name { font-weight: 600; font-size: .92rem; color: var(--text); }
.rcpt-mail { font-size: .8rem; color: var(--text3); }
.rcpt-forget {
    flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
    color: var(--text3); font-size: 1.15rem; line-height: 1; cursor: pointer; opacity: .6;
}
.rcpt-item.is-active .rcpt-forget { opacity: 1; }
@media (hover: hover) { .rcpt-forget:hover { color: var(--text); background: rgba(255, 255, 255, .08); } }
@media (max-width: 599px) { .rcpt-list { left: 8px; right: 8px; max-width: none; } }

/* Schreibhilfen (KI, Textkorrektur) */
.assist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.assist-bar .btn .icon { width: 16px; height: 16px; }
.assist-menu { position: relative; }
.assist-menu > summary { list-style: none; cursor: pointer; }
.assist-menu > summary::-webkit-details-marker { display: none; }
.assist-menu[open] > summary { border-color: rgba(124, 140, 255, .55); color: var(--text); }
.assist-pop {
    position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; width: min(92vw, 380px);
    padding: 12px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border2);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45); display: grid; gap: 10px;
}
.assist-pop-hint { margin: 0; font-size: .78rem; color: var(--text3); }
.assist-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.assist-action {
    min-height: 40px; padding: 8px 10px; border-radius: 10px; text-align: left; font: inherit; font-size: .88rem;
    color: var(--text2); background: var(--bg-item); border: 1px solid var(--border); cursor: pointer;
}
@media (hover: hover) { .assist-action:hover { color: var(--text); border-color: rgba(124, 140, 255, .45); } }
.assist-custom { display: flex; gap: 6px; }
.assist-custom input { flex: 1; min-width: 0; }
.assist-off { justify-self: start; padding: 4px 0; border: 0; background: none; font: inherit; font-size: .78rem; color: var(--text3); cursor: pointer; text-decoration: underline; }
.assist-settings { margin-left: auto; display: inline-flex; padding: 6px; border-radius: 8px; color: var(--text3); }
.assist-settings .icon { width: 17px; height: 17px; }
@media (hover: hover) { .assist-settings:hover { color: var(--text); } }
.assist-panel { margin: 0 14px 12px; padding: 12px 14px; border-radius: 14px; background: rgba(124, 140, 255, .06); border: 1px solid rgba(124, 140, 255, .28); }
.assist-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.assist-result { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: var(--bg-item); color: var(--text); line-height: 1.55; }
.assist-note { margin: 8px 0 0; font-size: .76rem; color: var(--text3); }
.assist-loading { margin: 4px 0; color: var(--text2); }
.assist-loading::before {
    content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
    border: 2px solid rgba(124, 140, 255, .3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.assist-error { margin: 4px 0; color: #fca5a5; }
.assist-ok { margin: 4px 0; color: #a7f3d0; }
.assist-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.assist-panel-actions:empty { display: none; }
.spell-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.spell-item { padding: 10px 12px; border-radius: 10px; background: var(--bg-item); border-left: 3px solid #f87171; }
.spell-item.spell-style { border-left-color: #fbbf24; }
.spell-context { font-size: .88rem; color: var(--text2); overflow-wrap: anywhere; }
.spell-context mark { background: rgba(248, 113, 113, .22); color: var(--text); border-radius: 3px; padding: 0 2px; }
.spell-style .spell-context mark { background: rgba(251, 191, 36, .2); }
.spell-msg { margin: 4px 0 8px; font-size: .8rem; color: var(--text3); }
.spell-fixes { display: flex; flex-wrap: wrap; gap: 6px; }
.spell-fix, .spell-ignore {
    min-height: 32px; padding: 4px 10px; border-radius: 8px; font: inherit; font-size: .85rem; cursor: pointer;
    border: 1px solid rgba(124, 140, 255, .4); background: rgba(124, 140, 255, .14); color: var(--text);
}
.spell-ignore { border-color: var(--border); background: transparent; color: var(--text3); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-row p { margin: 2px 0 0; }
.compose-body { border: 0; border-radius: 0; min-height: 42vh; padding: 14px; background: transparent; box-shadow: none !important; resize: vertical; }
.compose-attachments { padding: 10px 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.file-drop {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 10px 14px;
    border-radius: var(--r-md); border: 1px dashed var(--border2); color: var(--text2); cursor: pointer; text-align: center;
    transition: border-color var(--t-fast), background-color var(--t-fast);
}
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop.is-drag { border-color: var(--accent); background: rgba(124, 140, 255, .08); }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
.compose-actions { display: flex; align-items: center; gap: 8px; padding: 10px 14px 4px; flex-wrap: wrap; }
.compose-discard { margin-left: auto; }
@media (max-width: 599.98px) {
    .compose-actions { position: sticky; bottom: 0; background: rgba(14, 22, 41, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding-bottom: calc(8px + var(--safe-b)); }
    .compose-actions .btn-primary { flex: 1; }
}

/* Tablet: zweispaltig (Ordner + Liste) */
@media (min-width: 768px) {
    .app-layout { grid-template-columns: 232px minmax(0, 1fr); }
    .sidebar {
        position: sticky; top: var(--topbar-h); z-index: 1;
        height: calc(100dvh - var(--topbar-h)); width: auto;
        transform: none; visibility: visible;
        padding: 22px 14px 18px calc(14px + var(--safe-l));
        background: transparent; border-right: 1px solid var(--border); box-shadow: none;
        transition: none;
    }
    .sidebar-backdrop { display: none !important; }
    .pane { padding: 20px calc(20px + var(--safe-r)) 28px 20px; }
    body.sidebar-collapsed .sidebar-head { display: none; }
    .message-body { font-size: 15px; }
    body.sidebar-collapsed .app-layout { grid-template-columns: 76px minmax(0, 1fr); }
    body.sidebar-collapsed .folder-name, body.sidebar-collapsed .compose-btn span, body.sidebar-collapsed .quota { display: none; }
    body.sidebar-collapsed .folder { justify-content: center; padding: 0; }
    body.sidebar-collapsed .compose-btn { padding: 0; }
    body.sidebar-collapsed .folder-count { position: absolute; top: 2px; right: 4px; min-width: 18px; line-height: 18px; font-size: .65rem; padding: 0 4px; }
}
/* Tablet quer / Desktop: Liste einzeilig */
@media (min-width: 1024px) {
    .app-layout { grid-template-columns: 248px minmax(0, 1fr); }
    .pane { padding: 28px calc(32px + var(--safe-r)) 40px 32px; }
    .msg-link { grid-template-columns: 220px minmax(0, 1fr) auto; grid-template-areas: "from subject meta"; align-items: center; padding: 0 16px 0 2px; min-height: 48px; }
    .msg-subject { font-size: .92rem; }
}
@media (min-width: 1280px) { .msg-link { grid-template-columns: 260px minmax(0, 1fr) auto; } }

/* -------------------------------------------------------------------------- */
/* Login, Registrierung, Startseite, Fehler                                   */
/* -------------------------------------------------------------------------- */
.auth-card { padding: 22px 18px; animation: fade-up var(--t-slow) var(--ease-out) both; }
@media (min-width: 600px) { .auth-card { padding: 32px; } }
.auth-card h1 { font-size: 1.5rem; }
.auth-switch { margin: 18px 0 0; text-align: center; color: var(--text2); font-size: .9rem; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.terms-check { padding: 10px 12px; border: 1px solid var(--border2); border-radius: var(--r-sm); transition: border-color var(--t-fast); }
.terms-check a { font-weight: 600; }
.terms-check.is-invalid { border-color: rgba(248, 113, 113, .6); }

/* Nutzungsbedingungen */
.legal { max-width: 900px; margin: 0; padding: 24px 20px; line-height: 1.65; }
@media (min-width: 768px) { .legal { padding: 28px 34px; } }.legal h1 { margin: 0 0 4px; font-size: 1.6rem; }
.legal h2 { margin: 26px 0 8px; font-size: 1.1rem; scroll-margin-top: 80px; }
.legal section { scroll-margin-top: 80px; }
.legal ul { margin: 8px 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal p { margin: 8px 0; color: var(--text2); }
.legal li { color: var(--text2); }
.legal strong { color: var(--text); }
.legal-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.legal-toc a {
    padding: 6px 12px; border-radius: 999px; font-size: .85rem; color: var(--text2);
    background: var(--bg-item); border: 1px solid var(--border);
}
@media (hover: hover) { .legal-toc a:hover { color: var(--text); border-color: rgba(124, 140, 255, .4); } }
.legal-back { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.legal-summary {
    margin: 0 0 6px; padding: 14px 18px; border-radius: 14px;
    background: rgba(124, 140, 255, .07); border: 1px solid rgba(124, 140, 255, .22);
}
.legal-summary h2 { margin: 0 0 6px; font-size: 1rem; }
.legal-alert, .legal-highlight {
    margin: 14px 0; padding: 12px 16px; border-radius: 12px; color: var(--text);
    background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35);
}
.legal-highlight { background: rgba(124, 140, 255, .08); border-color: rgba(124, 140, 255, .3); color: var(--text2); }
.legal-address { font-style: normal; line-height: 1.7; color: var(--text2); margin: 8px 0; }
.legal-table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid var(--border); border-radius: 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.legal-table th, .legal-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); color: var(--text2); }
.legal-table th { color: var(--text); font-weight: 600; background: var(--bg-item); }
.legal-table tr:last-child td { border-bottom: 0; }
.legal-table td:last-child { width: 38%; }
.footer-links { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }
.legal-mini { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 10px; font-size: .75rem; }
.legal-mini a { color: var(--text3); }
@media (hover: hover) { .legal-mini a:hover { color: var(--text2); } }
.panel-main > .legal-mini { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--border); }
body.sidebar-collapsed .sidebar .legal-mini { display: none; }
.footer-links a { color: var(--text2); }
@media (hover: hover) { .footer-links a:hover { color: var(--text); } }
@media (min-width: 600px) { .legal { padding: 34px 40px; } }
/* Menschprüfung im bekannten „Ich bin kein Roboter“-Look (hell, wie das Original) */
.rc {
    display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px;
    width: 100%; max-width: 330px; min-height: 78px; padding: 0 10px 0 12px;
    background: #f9f9f9; border: 1px solid #d3d3d3; border-radius: 3px; box-shadow: 0 0 4px 1px rgba(0, 0, 0, .08);
    color: #282828; font-family: Roboto, "Helvetica Neue", Arial, sans-serif; text-align: left;
}
.rc-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rc-box {
    position: relative; display: grid; place-items: center; flex: none; width: 28px; height: 28px; min-height: 0; padding: 0;
    background: #fff; border: 2px solid #c1c1c1; border-radius: 2px; cursor: pointer;
    transition: border-color var(--t-fast), opacity var(--t-mid);
}
@media (hover: hover) { .rc-box:hover { border-color: #b2b2b2; box-shadow: inset 0 1px 1px -1px rgba(0, 0, 0, .2); } }
.rc-box:focus-visible { outline: none; border-color: #4d90fe; }
.rc-box:disabled { cursor: default; }
.rc-label { font-size: 14px; line-height: 1.3; cursor: pointer; user-select: none; }
.rc-spinner {
    position: absolute; inset: -2px; border-radius: 50%; border: 3px solid #4a90e2; border-top-color: transparent;
    opacity: 0; transform: scale(.4); pointer-events: none;
}
.rc-check { position: absolute; inset: -5px -7px -3px -3px; width: 36px; height: 36px; opacity: 0; pointer-events: none; }
.rc-check path { fill: none; stroke: #009e55; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; }
.rc.is-working .rc-box, .rc.is-done .rc-box { border-color: transparent; background: transparent; }
.rc.is-working .rc-spinner { opacity: 1; transform: scale(1); animation: spin .8s linear infinite; transition: transform var(--t-mid), opacity var(--t-mid); }
.rc.is-done .rc-check { opacity: 1; }
.rc.is-done .rc-check path { animation: rc-draw 320ms var(--ease-out) forwards; }
.rc.is-error .rc-box { border-color: #d93025; }
@keyframes rc-draw { to { stroke-dashoffset: 0; } }
.rc-brand { display: grid; justify-items: center; gap: 1px; width: 70px; color: #555; text-align: center; line-height: 1.2; }
.rc-brand img { width: 32px; height: 32px; border-radius: 7px; margin-bottom: 2px; }
.rc-name { font-size: 10px; }
.rc-links, .rc-links a { font-size: 8px; color: #555; }
.rc-links a { text-decoration: none; }
@media (hover: hover) { .rc-links a:hover { text-decoration: underline; } }
.rc-error { grid-column: 1 / -1; margin: 0 0 8px; font-size: 12px; color: #d93025; }
@media (prefers-reduced-motion: reduce) { .rc.is-done .rc-check path { animation: none; stroke-dashoffset: 0; } }

.hero { position: relative; padding: 36px 0 28px; text-align: center; }
.hero-glow { position: absolute; inset: -40px 0 auto; height: 260px; background: radial-gradient(closest-side, rgba(124, 140, 255, .22), transparent); pointer-events: none; }
.hero-inner { position: relative; display: grid; justify-items: center; gap: 14px; animation: fade-up 400ms var(--ease-out) both; }
/* Logo liegt auf der Seitenfarbe; die Maske lässt die Ränder in den Hintergrund auslaufen */
.hero-logo {
    display: block; width: min(100%, 440px); height: auto; margin: -22px 0 -16px; user-select: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
    mask-composite: intersect;
}
@media (min-width: 768px) { .hero-logo { width: 540px; margin: -44px 0 -18px; } }
.auth-logo { display: block; width: 56px; height: 56px; border-radius: 15px; margin: 0 0 14px; background: #000; border: 1px solid rgba(192, 132, 252, .38); box-shadow: 0 8px 26px rgba(168, 85, 247, .3); }
.hero h1 { font-size: clamp(1.8rem, 7vw, 3.4rem); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; margin: 0; }
.lead { color: var(--text2); font-size: 1.02rem; max-width: 60ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.features { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 768px) { .features { grid-template-columns: repeat(3, 1fr); gap: 18px; } .hero { padding: 72px 0 48px; } }
.feature-card { padding: 22px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 28%), var(--bg-card); border: 1px solid rgba(255, 255, 255, .09); box-shadow: var(--shadow-card); transition: transform var(--t-mid) var(--ease), border-color var(--t-mid); }
.feature-card p { color: var(--text2); margin: 0; }
.feature-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 12px; color: #c7d2fe; background: var(--grad-primary); border: 1px solid rgba(124, 140, 255, .35); }
.error-code { font-size: 4rem; font-weight: 800; line-height: 1; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px; }

/* Avatare */
.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: 50%;
    font-weight: 800; font-size: .9rem; color: #0b1020;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.avatar-sm { width: 30px; height: 30px; font-size: .78rem; }
.avatar-lg { width: 46px; height: 46px; font-size: 1.1rem; }
.avatar-c1 { background: linear-gradient(135deg, #2dd4bf, #60a5fa); }
.avatar-c2 { background: linear-gradient(135deg, #f472b6, #a78bfa); }
.avatar-c3 { background: linear-gradient(135deg, #fbbf24, #f87171); }
.avatar-c4 { background: linear-gradient(135deg, #34d399, #2dd4bf); }
.avatar-c5 { background: linear-gradient(135deg, #60a5fa, #7c8cff); }
.avatar-c6 { background: linear-gradient(135deg, #fb923c, #fbbf24); }
.avatar-c7 { background: linear-gradient(135deg, #a78bfa, #f472b6); }

/* -------------------------------------------------------------------------- */
/* Animationen                                                                */
/* -------------------------------------------------------------------------- */
.stagger-in { animation: rf-pop var(--t-slow) var(--ease-out) both; }
.is-saved { position: relative; }
.is-saved::after {
    content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, .65), 0 0 24px rgba(52, 211, 153, .25);
    animation: saved-pulse 900ms var(--ease) both;
}
tr.is-saved::after { content: none; }
tr.is-saved > td { animation: saved-row 900ms var(--ease) both; }
.folder-count.is-saved::after { border-radius: 999px; }

/* -------------------------------------------------------------------------- */
/* Einrichtungs-Animation (main.js: runSetup)                                  */
/* -------------------------------------------------------------------------- */
.flash-stack.is-deferred { display: none; }
body.has-setup { overflow: hidden; }
.setup-overlay {
    position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
    padding: calc(16px + var(--safe-t)) calc(14px + var(--safe-r)) calc(16px + var(--safe-b)) calc(14px + var(--safe-l));
    background: radial-gradient(120% 80% at 50% 30%, rgba(124, 140, 255, .18), transparent 60%), rgba(4, 7, 15, .78);
    backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
    opacity: 0; transition: opacity var(--t-slow) var(--ease);
}
.setup-overlay.is-in { opacity: 1; }
.setup-overlay.is-leaving { opacity: 0; }
.setup-card {
    position: relative; width: min(440px, 100%); max-height: 100%; overflow-y: auto;
    display: grid; justify-items: center; gap: 14px; padding: 30px 26px 22px; text-align: center;
    border-radius: 22px; border: 1px solid rgba(124, 140, 255, .28);
    background: linear-gradient(180deg, rgba(124, 140, 255, .10), transparent 160px), var(--bg-card);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03), var(--surface-shine);
    transform: translateY(14px) scale(.96); transition: transform var(--t-slow) var(--ease-out);
}
.setup-card:focus { outline: none; }
.setup-overlay.is-in .setup-card { transform: none; }
.setup-overlay.is-leaving .setup-card { transform: translateY(-10px) scale(.98); }

.setup-orb { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 4px; }
.setup-orb-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid rgba(124, 140, 255, .14); border-top-color: var(--accent); border-right-color: var(--accent2);
    animation: spin 1.1s linear infinite;
    filter: drop-shadow(0 0 10px rgba(124, 140, 255, .55));
    transition: border-color var(--t-slow), filter var(--t-slow), opacity var(--t-slow);
}
.setup-orb-ring2 { inset: 10px; border-width: 2px; border-color: rgba(45, 212, 191, .12); border-bottom-color: var(--teal); animation-duration: 1.7s; animation-direction: reverse; }
.setup-orb-icon, .setup-orb-check {
    position: absolute; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    transition: opacity var(--t-mid) var(--ease), transform var(--t-slow) var(--ease-out);
}
.setup-orb-icon { background: var(--accent-soft); color: #c7cdff; animation: setup-breathe 1.6s var(--ease) infinite; }
.setup-orb-check { background: linear-gradient(135deg, #34d399, #2dd4bf); color: #04221a; opacity: 0; transform: scale(.4) rotate(-20deg); box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
.setup-orb-icon svg { width: 24px; height: 24px; }
.setup-orb-check svg { width: 28px; height: 28px; stroke-width: 3; }
.setup-overlay.is-done .setup-orb-ring { animation-play-state: paused; border-color: rgba(52, 211, 153, .55); filter: drop-shadow(0 0 16px rgba(52, 211, 153, .6)); }
.setup-overlay.is-done .setup-orb-ring2 { opacity: 0; }
.setup-overlay.is-done .setup-orb-icon { opacity: 0; transform: scale(.5); animation: none; }
.setup-overlay.is-done .setup-orb-check { opacity: 1; transform: none; animation: setup-glow 1.4s var(--ease-out) .1s; }

.setup-burst { position: absolute; inset: 50%; pointer-events: none; }
.setup-burst i {
    position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 2px;
    background: var(--accent); opacity: 0; transform: rotate(var(--a)) translateY(0);
}
.setup-burst i:nth-child(3n) { background: var(--teal); }
.setup-burst i:nth-child(3n+1) { background: var(--accent2); width: 4px; height: 8px; }
.setup-burst i:nth-child(4n) { background: var(--green); border-radius: 50%; }
.setup-burst i:nth-child(1) { --a: 0deg; } .setup-burst i:nth-child(2) { --a: 26deg; }
.setup-burst i:nth-child(3) { --a: 51deg; } .setup-burst i:nth-child(4) { --a: 77deg; }
.setup-burst i:nth-child(5) { --a: 103deg; } .setup-burst i:nth-child(6) { --a: 129deg; }
.setup-burst i:nth-child(7) { --a: 154deg; } .setup-burst i:nth-child(8) { --a: 180deg; }
.setup-burst i:nth-child(9) { --a: 206deg; } .setup-burst i:nth-child(10) { --a: 231deg; }
.setup-burst i:nth-child(11) { --a: 257deg; } .setup-burst i:nth-child(12) { --a: 283deg; }
.setup-burst i:nth-child(13) { --a: 309deg; } .setup-burst i:nth-child(14) { --a: 334deg; }
.setup-overlay.is-done .setup-burst i { animation: setup-burst .9s var(--ease-out) .05s both; }
.setup-overlay.is-done .setup-burst i:nth-child(odd) { animation-duration: 1.1s; }

.setup-title { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.setup-overlay.is-done .setup-title { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; animation: fade-up var(--t-slow) var(--ease-out); }
.setup-address code {
    display: inline-block; max-width: 100%; overflow-wrap: anywhere; padding: 6px 12px; border-radius: 999px;
    font-family: var(--mono); font-size: .9rem; color: #dfe3ff;
    background: rgba(124, 140, 255, .1); border: 1px solid var(--accent-line);
}
.setup-overlay.is-done .setup-address code { border-color: rgba(52, 211, 153, .45); background: rgba(52, 211, 153, .08); color: #d1fae5; transition: all var(--t-slow); }

.setup-steps { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: grid; gap: 4px; text-align: left; }
.setup-step {
    display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px;
    color: var(--text3); font-size: .92rem;
    transition: color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease), opacity var(--t-mid);
}
.setup-dot {
    flex: none; position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--border2); transition: background-color var(--t-mid), border-color var(--t-mid);
}
.setup-dot svg { width: 12px; height: 12px; stroke-width: 3; color: #04221a; opacity: 0; transform: scale(.3); transition: opacity var(--t-fast), transform var(--t-mid) var(--ease-out); }
.setup-step.is-active { color: var(--text); background: rgba(124, 140, 255, .08); }
.setup-step.is-active .setup-dot { border-color: rgba(124, 140, 255, .25); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.setup-step.is-active .setup-step-text {
    background: linear-gradient(90deg, var(--text) 0%, var(--text) 40%, #b9c2ff 50%, var(--text) 60%, var(--text) 100%);
    background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: setup-shimmer 1.2s linear infinite;
}
.setup-step.is-done { color: var(--text2); }
.setup-step.is-done .setup-dot { border-color: transparent; background: var(--green); animation: pop var(--t-slow) var(--ease-out); }
.setup-step.is-done .setup-dot svg { opacity: 1; transform: none; }

.setup-progress { width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.setup-progress-bar {
    display: block; height: 100%; width: 4%; border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--teal)); background-size: 200% 100%;
    animation: setup-flow 1.4s linear infinite; transition: width .45s var(--ease-out);
}
.setup-progress-bar.p0 { width: 4%; } .setup-progress-bar.p20 { width: 20%; } .setup-progress-bar.p40 { width: 40%; }
.setup-progress-bar.p60 { width: 60%; } .setup-progress-bar.p80 { width: 80%; } .setup-progress-bar.p100 { width: 100%; }
.setup-overlay.is-done .setup-progress-bar { background: var(--green); animation: none; }

.setup-hint, .setup-actions { opacity: 0; visibility: hidden; max-height: 0; overflow: hidden; transform: translateY(8px); }
.setup-hint { margin: 0; font-size: .9rem; color: var(--text2); line-height: 1.5; }
.setup-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.setup-actions .btn { flex: 1 1 160px; }
.setup-actions .btn.is-copied { border-color: rgba(52, 211, 153, .55); color: #d1fae5; }
.setup-overlay.is-done .setup-hint, .setup-overlay.is-done .setup-actions {
    opacity: 1; visibility: visible; max-height: 200px; transform: none;
    transition: opacity var(--t-slow) var(--ease) .15s, transform var(--t-slow) var(--ease-out) .15s, max-height var(--t-slow) var(--ease);
}
.setup-skip { border: 0; background: none; color: var(--text3); font-size: .82rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
@media (hover: hover) { .setup-skip:hover { color: var(--text2); } }
.setup-overlay.is-done .setup-skip { display: none; }

@keyframes setup-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes setup-glow { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 100% { box-shadow: 0 0 0 26px rgba(52, 211, 153, 0); } }
@keyframes setup-burst {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(-20px) scale(1); }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(-78px) scale(.4); }
}
@keyframes setup-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes setup-flow { from { background-position: 0 0; } to { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) {
    .setup-overlay, .setup-card, .setup-orb-ring, .setup-orb-icon, .setup-orb-check, .setup-step, .setup-dot, .setup-progress-bar,
    .setup-step.is-active .setup-step-text, .setup-burst i { animation: none !important; transition: none !important; }
    .setup-overlay.is-done .setup-burst i { opacity: 0; }
}

@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rf-pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes saved-pulse { 0% { opacity: 0; transform: scale(.98); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.01); } }
@keyframes saved-row { 0% { opacity: .55; } 100% { opacity: 1; } }
@keyframes remove-out { to { opacity: 0; transform: translateX(24px) scale(.98); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
@keyframes flash-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes flash-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Skeleton (Ladeplatzhalter) */
.skeleton { position: relative; overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, .06); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent); animation: shimmer 1.2s linear infinite; }

/* Seitenübergänge (View Transitions API, sonst Einblenden per page-in) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 180ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 260ms var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
    .btn.is-loading::after, .switch-form.is-busy .switch-track::after, .rc.is-working .rc-spinner, .skeleton::after {
        animation-duration: 1.5s !important; animation-iteration-count: infinite !important;
    }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
    .btn:hover, .card:hover, a.card:hover, .feature-card:hover, .stat:hover, a.sum-card:hover, .quick-link:hover { transform: none !important; }
}

/* Hilfe-Center */
.help { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (max-width: 479px) { .topnav .nav-help-guest { display: none; } }
.help-hero { display: grid; gap: 14px; }
.help-search {
    position: relative; display: flex; align-items: center; width: 100%;
}
.help-search .icon { position: absolute; left: 16px; width: 20px; height: 20px; color: var(--text3); pointer-events: none; }
.help-search input {
    width: 100%; min-height: 54px; padding: 0 18px 0 48px; border-radius: 999px; font-size: 16px;
    background: var(--bg-item); border: 1px solid var(--border2); color: var(--text);
}
.help-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.help-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.help-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-size: .86rem;
    color: var(--text2); background: rgba(255, 255, 255, .04); border: 1px solid var(--border); text-decoration: none;
    transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.help-chip .icon { width: 15px; height: 15px; }
@media (hover: hover) { .help-chip:hover { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); } }

.help-cat h2 { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 1.05rem; color: var(--text2); }
.help-cat h2 .icon { width: 18px; height: 18px; color: var(--accent); }
.help-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.help-card {
    display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; border-radius: var(--r-md);
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text); text-decoration: none;
    box-shadow: var(--surface-shine); transition: border-color var(--t-fast), transform var(--t-fast), background-color var(--t-fast);
}
@media (hover: hover) { .help-card:hover { border-color: var(--accent-line); background: var(--bg-elev); transform: translateY(-1px); } }
.help-card:focus-visible { outline: none; box-shadow: var(--ring); }
.help-card-icon {
    display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
    background: var(--accent-soft); color: #c7d0ff;
}
.help-card-icon .icon { width: 21px; height: 21px; }
.help-card-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.help-card-text strong { font-size: .98rem; }
.help-card-text span { color: var(--text2); font-size: .86rem; line-height: 1.4; }
.help-card-go { color: var(--text3); }
.help-card-go .icon { width: 18px; height: 18px; }
.help-empty { text-align: center; color: var(--text2); }
.help-contact { display: flex; gap: 16px; align-items: flex-start; }
.help-contact h2 { margin: 0 0 4px; font-size: 1.05rem; }
.help-contact p { margin: 0; }
.help-contact-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(45, 212, 191, .12); color: var(--teal); }

/* Hilfe-Artikel */
.help-article { padding: 20px; }
@media (min-width: 768px) { .help-article { padding: 30px 36px; } }
.help-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .85rem; color: var(--text3); margin-bottom: 16px; }
.help-crumbs a { display: inline-flex; align-items: center; gap: 5px; color: var(--text2); text-decoration: none; }
.help-crumbs .icon { width: 15px; height: 15px; }
.help-head { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.help-head h1 { margin: 0 0 4px; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.help-head p { margin: 0; }
.help-head-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; background: var(--grad-primary); border: 1px solid var(--accent-line); color: #c7d0ff; }
.help-head-icon .icon { width: 26px; height: 26px; }

.help-body { line-height: 1.7; color: #dbe2f0; max-width: 820px; }
.help-body h2 { margin: 30px 0 10px; font-size: 1.2rem; color: var(--text); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.help-body p, .help-body ul { margin: 0 0 14px; }
.help-body ul { padding-left: 20px; }
.help-body li { margin: 4px 0; }
.help-body a { color: #aab6ff; }
.help-body code { font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); word-break: break-all; }
.help-body kbd { font-family: var(--mono); font-size: .85em; padding: 1px 7px; border-radius: 6px; background: var(--bg-elev); border: 1px solid var(--border2); border-bottom-width: 2px; }
.help-body .icon { width: 1em; height: 1em; vertical-align: -.14em; }
.help-body .ui {
    display: inline; padding: 1px 7px; border-radius: 7px; -webkit-box-decoration-break: clone; box-decoration-break: clone;
    font-weight: 600; font-size: .92em; color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.help-body .pill { font-size: .8em; vertical-align: 1px; }
.help-steps { counter-reset: step; list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.help-steps > li { counter-increment: step; position: relative; margin: 0; padding: 2px 0 2px 46px; }
.help-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: 50%; font-weight: 700; font-size: .9rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 4px 14px rgba(124, 140, 255, .35);
}
.help-steps > li > strong:first-child { display: block; color: var(--text); }
.help-figure { margin: 18px 0 24px; }
.help-figure a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border2); box-shadow: var(--shadow-card); }
.help-figure img { display: block; width: 100%; height: auto; transition: transform var(--t-slow) var(--ease-out); }
@media (hover: hover) { .help-figure a:hover img { transform: scale(1.01); } }
.help-figure figcaption { margin-top: 8px; font-size: .85rem; color: var(--text3); text-align: center; }
.help-figure.is-narrow { max-width: 380px; margin-left: auto; margin-right: auto; }
.help-tip, .help-warn, .help-note {
    display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid;
}
.help-tip > .icon, .help-warn > .icon, .help-note > .icon { flex: none; width: 20px; height: 20px; margin-top: 3px; }
.help-tip { background: rgba(45, 212, 191, .07); border-color: rgba(45, 212, 191, .25); }
.help-tip > .icon { color: var(--teal); }
.help-warn { background: rgba(251, 191, 36, .07); border-color: rgba(251, 191, 36, .28); }
.help-warn > .icon { color: var(--yellow); }
.help-note { background: var(--accent-soft); border-color: var(--accent-line); }
.help-note > .icon { color: var(--accent); }
.help-table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: .93rem; }
.help-table th, .help-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.help-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text3); }
.help-table tbody th { white-space: nowrap; color: var(--text); font-weight: 600; }
.help-table tbody th .icon { margin-right: 4px; color: var(--accent); }
@media (max-width: 600px) {
    .help-table tbody th { white-space: normal; }
    .help-table:not(.help-table-data) tr { display: grid; }
    .help-table:not(.help-table-data) tbody th { border-bottom: 0; padding-bottom: 0; }
    .help-table-data { display: block; overflow-x: auto; }
}
.help-faq { margin: 0 0 18px; }
.help-faq dt { margin-top: 14px; font-weight: 700; color: var(--text); }
.help-faq dd { margin: 4px 0 0; color: var(--text2); }
.help-faq-lg dt { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--border); }
.help-faq-lg dt:first-child { border-top: 0; padding-top: 0; }
.help-faq-lg dd { margin-bottom: 16px; }
.help-quote { margin: 0 0 18px; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--bg-item); color: var(--text2); }
.help-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); }
.help-pager-link {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); text-decoration: none;
    color: var(--text); background: var(--bg-item); border: 1px solid var(--border); transition: border-color var(--t-fast);
}
.help-pager-link span { display: grid; gap: 2px; min-width: 0; }
.help-pager-link small { color: var(--text3); font-size: .78rem; }
.help-pager-link strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-pager-link.is-next { justify-content: flex-end; text-align: right; grid-column: 2; }
.help-pager-link .icon { flex: none; width: 18px; height: 18px; color: var(--text3); }
@media (hover: hover) { .help-pager-link:hover { border-color: var(--accent-line); } }
@media (max-width: 600px) { .help-pager { grid-template-columns: 1fr; } .help-pager-link.is-next { grid-column: auto; } }
/* Druck */
@media print {
    .help-pager, .help-crumbs { display: none !important; }
    .topbar, .sidebar, .panel-nav, .toolbar, .reply-bar, .toast-stack, .flash-stack { display: none !important; }
    body { padding: 0; background: #fff; color: #000; }
}
