html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    min-height: 100%;
}

body {
    background-color: var(--mud-palette-background);
}

a, .btn-link {
    color: var(--apple-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--apple-primary, #0066cc);
    border-color: var(--apple-primary, #0066cc);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--apple-primary-focus, #0071e3);
    border-color: var(--apple-primary-focus, #0071e3);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--apple-primary-focus, #0071e3);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOng9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.app-shell-appbar {
    padding-inline: 0.5rem;
    gap: 0.25rem;
    background: color-mix(in srgb, var(--mud-palette-surface) 88%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 65%, transparent);
}

/* MudTooltip darf als Wrapper die AppBar-Flexzeile nicht aufbrechen */
.app-shell-appbar .mud-tooltip-root {
    display: inline-flex;
}

/* Markenlink: Logo-Chip + Wortmarke, klickbar -> Startseite */
.app-shell-brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.85rem 0.25rem 0.3rem;
    border-radius: var(--apple-radius-pill);
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.18s ease;
}

.app-shell-brand-link:hover {
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 7%, transparent);
    color: var(--mud-palette-text-primary);
}

.app-shell-brand-link:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Weißer Chip: das schwarze Vereinswappen bleibt auf jedem Theme lesbar
   (gleiches Muster wie das Login-Branding) */
.app-shell-brand-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: var(--apple-radius-md);
    background: #fff;
    display: grid;
    place-items: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.09),
                0 1px 6px rgba(0, 0, 0, 0.28);
}

.app-shell-brand-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.app-shell-brand {
    font-weight: 650;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.app-shell-nav-trigger {
    border-radius: var(--apple-radius-pill);
}

/* Haarlinie zwischen Changelog und Profilbereich */
.app-shell-appbar-sep {
    width: 1px;
    height: 26px;
    margin-inline: 0.5rem;
    background: color-mix(in srgb, var(--mud-palette-lines-default) 90%, transparent);
}

.app-shell-main {
    padding: 5rem 1rem 1.5rem;
}

.app-shell-profile-trigger {
    min-width: auto;
    border-radius: var(--apple-radius-pill);
    padding: 0.25rem 0.35rem !important;
    gap: 0.25rem;
}

.app-shell-profile-badge {
    display: flex;
}

.app-shell-profile-avatar {
    background-color: var(--mud-palette-surface);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.app-shell-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-shell-profile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 100%);
    max-width: 100%;
    z-index: 1300;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--mud-palette-primary) 9%, var(--mud-palette-surface)) 0%,
            var(--mud-palette-surface) 300px);
    border-left: 1px solid var(--mud-palette-lines-default);
    box-sizing: border-box;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.25s;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.app-shell-profile-drawer.open {
    visibility: visible;
    transform: translateX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: Drawer öffnet links, passend zum Hamburger oben links.
   Mobil bleibt er rechts (Avatar oben rechts, Daumenfreundlichkeit). */
@media (min-width: 960px) {
    .app-shell-profile-drawer {
        right: auto;
        left: 0;
        transform: translateX(-100%);
        border-left: 0;
        border-right: 1px solid var(--mud-palette-lines-default);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
}

/* Hintergrund-Scroll sperren, solange der Drawer geöffnet ist */
body.datapin-drawer-open {
    overflow: hidden;
}

.app-shell-drawer-overlay {
    transition: opacity 0.2s ease;
}

/* ── Bottom-Navigation (nur Mobil) ────────────────────────── */

.app-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: none;
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--mud-palette-lines-default);
}

.app-bottomnav-inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
}

.app-bottomnav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 62px;
    padding: 0.4rem 0.25rem 0.45rem;
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
}

.app-bottomnav-item:hover {
    color: var(--mud-palette-text-primary);
}

/* Pill hinter dem Icon als Aktiv-Indikator (Material 3) */
.app-bottomnav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 16px;
    border-radius: var(--apple-radius-pill);
    transition: background-color 0.18s ease;
}

.app-bottomnav-icon {
    width: 22px;
    height: 22px;
    font-size: 22px;
    flex: 0 0 auto;
}

.app-bottomnav-item.active {
    color: var(--mud-palette-primary);
    font-weight: 700;
}

.app-bottomnav-item.active .app-bottomnav-pill {
    background: color-mix(in srgb, var(--mud-palette-primary) 20%, transparent);
}

.app-nav-menu {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    /* Drawer-Hintergrund (Gradient) durchscheinen lassen */
    background: transparent;
    padding: 1rem 0.85rem 1rem;
}

/* ── Header: Benutzer + Suche ─────────────────────────────── */

.app-nav-header {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.app-nav-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.app-nav-user-link {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent !important;
}

.app-nav-user-link > .mud-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    margin-left: -0.55rem;
    border-radius: var(--apple-radius-pill);
    transition: background-color 0.16s ease;
}

.app-nav-user-link > .mud-nav-link:hover {
    background: var(--mud-palette-action-default-hover);
}

.app-nav-user-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    flex: 1 1 auto;
    min-width: 0;
}

    /* Lange Namen/Status-Texte brechen die Kopfzeile — stattdessen Ellipsis */
    .app-nav-user-text > .mud-typography {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.app-nav-user-link .mud-badge {
    flex: 0 0 auto;
}

.app-nav-user-chevron {
    opacity: 0.4;
}

.app-nav-header-buttons {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.15rem;
}

.app-nav-search {
    margin-top: 0;
}

/* Pill-Form für das Outlined-Suchfeld */
.app-nav-search .mud-input-outlined,
.app-nav-search fieldset {
    border-radius: var(--apple-radius-pill) !important;
}

/* ── Sektionen & Einträge ─────────────────────────────────── */

.app-nav-item,
.app-nav-group {
    border-radius: var(--apple-radius-pill);
}

/* MudBlazor 9 legt die Class von MudNavLink auf das äußere div.mud-nav-item,
   die Inhalte liegen aber im inneren div.mud-nav-link-text (plain block).
   Sichtbare Fläche (Padding, Hover, Radius) daher auf dem Anchor, das
   Zeilen-Layout auf mud-nav-link-text. */
.app-nav-menu .app-nav-item > .mud-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: var(--apple-radius-pill);
    transition: background-color 0.16s ease, color 0.16s ease;
}

.app-nav-menu .app-nav-item > .mud-nav-link:hover {
    background: var(--mud-palette-action-default-hover);
}

.app-nav-menu .app-nav-item .mud-nav-link-text,
.app-nav-user-link .mud-nav-link-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.app-nav-menu .mud-nav-link,
.app-nav-menu .mud-nav-group,
.app-nav-menu .mud-nav-group .mud-nav-link,
.app-nav-menu .mud-nav-group .mud-nav-group-title {
    background: transparent !important;
}

.app-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.app-nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    padding: 0 0.65rem 0.25rem;
}

    /* Titel mit auslaufender Hairline */
    .app-nav-section-title::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--mud-palette-lines-default);
    }

.app-nav-item {
    min-height: 44px;
    border-radius: var(--apple-radius-pill);
}

.app-nav-item-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    opacity: 0.7;
    transition: opacity 0.16s ease, color 0.16s ease;
}

/* Aktiver Eintrag: Pill mit Primär-Tint, Icon gefärbt */
.app-nav-menu .mud-nav-link.active {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 16%, transparent) !important;
    font-weight: 600;
}

.app-nav-menu .mud-nav-link.active .app-nav-item-icon {
    color: var(--mud-palette-primary);
    opacity: 1;
}

/* ── Schnellzugriff-Kacheln ───────────────────────────────── */

.app-nav-section-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.app-nav-section-quick .app-nav-section-title {
    grid-column: 1 / -1;
}

/* Farb-Akzente je Kachel (Material-You-Stil), theme-fair über Palette-Variablen */
.app-nav-tile--primary { --tile-accent: var(--mud-palette-primary); }
.app-nav-tile--success { --tile-accent: var(--mud-palette-success); }
.app-nav-tile--warning { --tile-accent: var(--mud-palette-warning); }
.app-nav-tile--info    { --tile-accent: var(--mud-palette-info); }

.app-nav-tile {
    display: flex;
    min-height: 92px;
    border-radius: var(--apple-radius-lg) !important;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.app-nav-tile > .mud-nav-link {
    flex: 1 1 auto;
    display: flex;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--apple-radius-lg);
    /* !important contra die globale Transparent-Regel für mud-nav-link weiter oben */
    background: color-mix(in srgb, var(--tile-accent, var(--mud-palette-primary)) 7%, var(--mud-palette-surface)) !important;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.app-nav-tile .mud-nav-link-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
}

.app-nav-tile:hover > .mud-nav-link {
    border-color: color-mix(in srgb, var(--tile-accent, var(--mud-palette-primary)) 50%, transparent);
    transform: translateY(-2px);
}

/* Icon als farbiger Chip statt nacktem Symbol */
.app-nav-tile-icon {
    padding: 10px;
    border-radius: var(--apple-radius-md);
    background: color-mix(in srgb, var(--tile-accent, var(--mud-palette-primary)) 20%, transparent);
    color: var(--tile-accent, var(--mud-palette-primary));
}

.app-nav-tile-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.app-nav-section-quick .mud-nav-link.active {
    background: color-mix(in srgb, var(--tile-accent, var(--mud-palette-primary)) 14%, var(--mud-palette-surface)) !important;
    border-color: color-mix(in srgb, var(--tile-accent, var(--mud-palette-primary)) 55%, transparent);
    font-weight: 600;
}

.app-nav-menu .mud-nav-group .mud-nav-group-title {
    border-radius: var(--apple-radius-md);
}

/* ── Footer: Abmelden + Version ───────────────────────────── */

.app-nav-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.app-nav-logout-button {
    min-height: 42px;
    border-radius: var(--apple-radius-pill);
    border: 1px solid color-mix(in srgb, var(--mud-palette-error) 32%, transparent);
}

.app-nav-logout-form {
    padding-inline: 0.25rem;
}

.app-nav-version {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.4rem 0 0.15rem;
    opacity: 0.65;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.app-nav-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    padding: 1.75rem 1rem;
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: var(--apple-radius-lg);
}

.app-nav-empty-icon {
    padding: 12px;
    border-radius: var(--apple-radius-pill);
    background: color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
    color: var(--mud-palette-primary);
}

.app-login-shell {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--apple-space-lg, 24px);
    background: var(--apple-canvas-parchment, #f5f5f7);
}

/* Vollbild-Wasserzeichen: die Silhouette (logo-watermark.png) ist WEISS auf
   transparentem Grund. Im Dark Mode wirkt sie direkt subtil; im Light Mode
   wird sie per invert() zur dunklen Silhouette (invertiert nur Farben, nicht
   den Alphakanal). */
.app-login-watermark {
    position: absolute;
    inset: 0;
    margin: auto;
    width: min(94vmin, 880px);
    height: min(94vmin, 880px);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

html:not(.apple-dark) .app-login-watermark {
    filter: invert(1);
    opacity: 0.08;
}

html.apple-dark .app-login-watermark {
    opacity: 0.07;
}

/* ── Solo-Variante: einzelne Card (Passwort vergessen / Reset) ── */

.app-login-card--solo {
    width: min(100%, 26rem);
    margin-inline: auto;
    background: var(--apple-canvas, #ffffff);
    border: 1px solid var(--apple-hairline, #e0e0e0);
    border-radius: var(--apple-radius-lg, 18px);
    box-shadow: none;
}

.app-login-solo-badge {
    width: 52px;
    height: 52px;
    border-radius: var(--apple-radius-md, 11px);
    background: var(--apple-canvas-parchment, #f5f5f7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    box-shadow: none;
}

.app-login-solo-badge img {
    height: 34px;
    width: 34px;
    display: block;
    border-radius: 8px;
}

.app-login-solo-badge--success {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.app-login-solo-badge--success .app-login-solo-badge-icon {
    color: #4caf50;
}

.app-login-solo-badge-icon {
    font-size: 30px;
}

.app-reset-password-hint.mud-typography {
    margin-top: -0.45rem;
    color: var(--apple-ink-muted-48, #7a7a7a);
    line-height: 1.45;
}

.app-reset-security-note.mud-typography {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--apple-ink-muted-48, #7a7a7a);
    line-height: 1.4;
}

.app-reset-security-note .mud-icon-root {
    flex: 0 0 auto;
    color: var(--apple-primary, #0066cc);
}

.app-login-link--center {
    display: block;
    text-align: center;
    margin-top: 0.4rem;
}

/* ── Vertical Stack: Branding top, Formular below ───────────── */

.app-login-frame {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 26rem);
    border-radius: 0;
    overflow: visible;
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.app-login-frame::before {
    display: none;
}

.app-login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0 var(--apple-space-lg, 24px);
    background: transparent;
    text-align: center;
    max-width: 420px;
    border-right: none;
}

.app-login-brand-logo {
    width: fit-content;
    background: transparent;
    border-radius: var(--apple-radius-lg, 18px);
    padding: 0;
    box-shadow: none;
    margin-bottom: var(--apple-space-md, 17px);
}

/* Logo ist eine helle Grafik auf schwarzem Tile (kein Alphakanal) — als
   gerundetes App-Icon mit sanftem Schatten; im Dark Mode hebt der
   Hairline-Rahmen das Tile vom dunklen Grund ab. */
.app-login-brand-logo img {
    height: 76px;
    width: 76px;
    display: block;
    border-radius: 17px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

html.apple-dark .app-login-brand-logo img {
    border: 1px solid var(--apple-hairline, #38383a);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.app-login-brand-name.mud-typography {
    font-weight: 600;
    color: var(--apple-ink, #1d1d1f);
}

.app-login-brand-tagline.mud-typography {
    margin-top: 0.3rem;
    color: var(--apple-ink-muted-48, #7a7a7a);
}

.app-login-brand-points {
    display: none;
}

.app-login-brand-points li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--apple-ink-muted-80, #333333);
    font-size: 0.875rem;
}

.app-login-point-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--apple-radius-sm, 8px);
    background: var(--apple-canvas-parchment, #f5f5f7);
    border: 1px solid var(--apple-hairline, #e0e0e0);
    color: var(--apple-primary, #0066cc);
    flex-shrink: 0;
}

.app-login-point-icon .material-icons {
    font-size: 19px;
}

.app-login-brand-footer {
    margin-top: var(--apple-space-md, 17px);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--apple-ink-muted-48, #7a7a7a);
}

.app-login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--apple-space-xl, 32px);
    background: var(--apple-canvas, #ffffff);
    border: 1px solid var(--apple-hairline, #e0e0e0);
    border-radius: var(--apple-radius-lg, 18px);
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    box-shadow: none;
}

.app-login-title.mud-typography {
    font-weight: 600;
    color: var(--apple-ink, #1d1d1f);
}

.app-login-subtitle.mud-typography {
    margin-top: 0.3rem;
    margin-bottom: 1.6rem;
    color: var(--apple-ink-muted-48, #7a7a7a);
}

.app-login-form {
    gap: 1rem;
}

.app-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.app-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--apple-ink-muted-80, #333333);
}

.app-login-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--apple-primary, #0066cc);
    cursor: pointer;
}

.app-login-link {
    color: var(--apple-primary, #0066cc);
    font-size: 0.8rem;
    text-decoration: none;
}

.app-login-link:hover {
    text-decoration: underline;
}

/* MudBlazor Outlined-Felder auf der Canvas-Card */
.app-login-card .mud-input-outlined-border {
    border-color: var(--apple-hairline, #e0e0e0) !important;
}

.app-login-card .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--apple-ink-muted-48, #7a7a7a) !important;
}

.app-login-card .mud-input-outlined.mud-shrink .mud-input-outlined-border,
.app-login-card .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--apple-primary, #0066cc) !important;
}

.app-login-card .mud-input-slot,
.app-login-card input {
    color: var(--apple-ink, #1d1d1f) !important;
}

.app-login-card .mud-input-label,
.app-login-card .mud-input-adornment-icon {
    color: var(--apple-ink-muted-48, #7a7a7a) !important;
}

.app-login-card .mud-input-helper-text,
.app-login-card .mud-checkbox-label {
    color: var(--apple-ink-muted-80, #333333) !important;
}

/* Chrome-Autofill: keep light background consistent */
.app-login-card input:-webkit-autofill,
.app-login-card input:-webkit-autofill:hover,
.app-login-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--apple-ink, #1d1d1f);
    caret-color: var(--apple-ink, #1d1d1f);
    -webkit-box-shadow: 0 0 0 1000px var(--apple-canvas, #ffffff) inset;
    transition: background-color 9999s ease-out;
}

/* Anmelde-Button: Apple primary style */
.app-login-card .mud-button-filled-primary {
    border-radius: var(--apple-radius-pill, 9999px);
    transition: opacity 0.15s ease;
}

.app-login-card .mud-button-filled-primary:hover {
    opacity: 0.9;
}

.app-login-card .mud-button-filled-primary:active {
    opacity: 0.8;
}

.app-login-link:focus-visible {
    outline: 2px solid var(--apple-primary, #0066cc);
    outline-offset: 2px;
    border-radius: var(--apple-radius-xs, 5px);
}

/* ── Theme-Toggle (Anmeldeseiten, statisch gerendert) ────────── */

.app-theme-toggle {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--apple-hairline, #e0e0e0);
    border-radius: var(--apple-radius-pill, 9999px);
    background: color-mix(in srgb, var(--apple-canvas, #ffffff) 72%, transparent);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    backdrop-filter: blur(12px) saturate(160%);
    color: var(--apple-ink-muted-80, #333333);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.12s ease;
}

.app-theme-toggle:hover {
    color: var(--apple-ink, #1d1d1f);
}

.app-theme-toggle:active {
    transform: scale(0.92);
}

/* Icon zeigt je nach Theme das Ziel-Design: hell → Mond, dunkel → Sonne */
.app-theme-toggle .app-theme-toggle-to-light {
    display: none;
}

html.apple-dark .app-theme-toggle .app-theme-toggle-to-light {
    display: inline-flex;
}

html.apple-dark .app-theme-toggle .app-theme-toggle-to-dark {
    display: none;
}

@media (min-width: 960px) {
    .app-shell-main {
        padding: 5.5rem 1.5rem 2rem;
    }
}

@media (max-width: 600px) {
    .app-shell-profile-drawer {
        width: 100%;
        max-width: 100%;
        border-left: 0;
    }

    /* Kompaktere Markenzeile auf schmalen Screens */
    .app-shell-brand-logo {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .app-shell-brand-logo img {
        width: 27px;
        height: 27px;
    }

    .app-shell-brand-link {
        gap: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Bottom-Navigation einblenden; Inhalt darf darunter nicht verdeckt werden */
    .app-bottomnav {
        display: block;
    }

    .app-shell-main {
        padding: 4.75rem 0.75rem calc(4.75rem + env(safe-area-inset-bottom));
    }

    .app-nav-item,
    .app-nav-menu .mud-nav-group .mud-nav-link,
    .app-nav-menu .mud-nav-group .mud-nav-group-title {
        min-height: 50px;
        font-size: 0.98rem !important;
    }

    /* Kacheln bleiben zweispaltig, auch auf schmalen Screens */
    .app-nav-section-quick {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-nav-menu {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .app-nav-version {
        padding: 0.4rem;
        font-size: 0.75rem;
    }

    .app-login-shell {
        padding: 0.75rem;
    }

    .app-reset-password-shell {
        align-items: flex-start;
        overflow-y: auto;
        padding-block: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-bottom));
    }

    .app-login-card {
        padding: 1.75rem 1.5rem 1.9rem;
    }

    .app-reset-password-card {
        margin-block: auto;
    }

    .app-login-brand {
        padding: 1.75rem 1.5rem 1.4rem;
    }
}


.app-page-container {
    width: 100%;
}

.app-page-header {
    gap: 1rem;
}

.app-toolbar-wrap {
    flex-wrap: wrap;
}

.app-page-title,
.app-home-title,
.app-strong-text {
    font-weight: 700;
}

.app-page-title-sm {
    font-size: 1.25rem;
}

.app-section-card {
    background: var(--mud-palette-surface);
    border-radius: var(--apple-radius-md);
}

.app-inline-icon {
    vertical-align: middle;
}

.app-medium-text {
    font-weight: 500;
}

.app-summary-card {
    height: 100%;
}

/* Summary-Karten-Tints: flache 8%-Flächen — liegen in css/apple.css
   (Kaskade hinter MudBlazor.min.css, sonst überschreibt .mud-card sie). */

.app-upcoming-item {
    /* Theme variable instead of a hard-coded black tint so the item stays
       legible in dark mode. */
    background: var(--mud-palette-background-gray);
    border-left: 3px solid var(--mud-palette-success);
}

.app-summary-avatar {
    width: 56px;
    height: 56px;
}

.app-home-stat-avatar {
    width: 48px;
    height: 48px;
}

.app-summary-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.app-summary-label-compact {
    letter-spacing: 0.05em;
}

.app-summary-label-muted {
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.app-summary-value {
    font-weight: 700;
}

.app-kpi-card {
    color: white;
}

.app-kpi-label {
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1.5px;
}

.app-kpi-value {
    color: white;
    font-weight: 700;
}

.app-kpi-value-compact {
    font-weight: 700;
}

.app-kpi-meta {
    color: rgba(255, 255, 255, 0.6);
}

.app-kpi-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.25);
}

.app-kpi-icon-lg {
    font-size: 2.8rem;
}

.app-home-stat-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-home-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.app-home-stat-card:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Home greeting header */
.app-greeting-avatar {
    width: 56px;
    height: 56px;
    font-weight: 700;
}

@media (max-width: 600px) {
    .app-greeting-avatar {
        width: 48px;
        height: 48px;
    }
}

/* Home quick actions */
.app-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.app-quick-action {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-quick-action:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.app-quick-action:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* Keep a long carrier name from pushing past the viewport edge on phones. */
.app-music-box-chip {
    max-width: 100%;
}

@media (max-width: 600px) {
    .app-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .app-quick-action {
        padding: 0.75rem !important;
    }
}

.app-home-stats-table .mud-table-container {
    overflow-x: auto;
}

.app-rank-column {
    width: 50px;
}

.app-align-right {
    text-align: right;
}

.app-grid-pager {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.app-empty-state {
    text-align: center;
}

.app-empty-state-dashed {
    border: 2px dashed var(--apple-hairline);
    border-radius: var(--apple-radius-md);
}

.app-empty-state-icon {
    font-size: 4rem !important;
}

.app-empty-state-lg {
    min-height: 300px;
}

.app-empty-state-md {
    min-height: 200px;
}

.app-detail-panel {
    background: var(--mud-palette-background-gray);
}

.app-detail-table {
    border-radius: 8px;
    overflow: hidden;
}

.app-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-finance-filter-control {
    min-width: 200px;
}

.app-finance-search-field {
    min-width: 180px;
}

.app-finance-mini-avatar {
    width: 28px;
    height: 28px;
}

.app-finance-amount-chip {
    font-weight: 700;
    min-width: 100px;
    justify-content: flex-end;
}

.app-finance-grid,
.app-ellipsis-text {
    border-radius: inherit;
}

.app-ellipsis-text {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-break-word {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.app-iban-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.app-year-select {
    max-width: 160px;
}

.app-muted-icon {
    opacity: 0.5;
}

.app-template-preview-frame {
    width: 100%;
    height: min(600px, 70vh);
    border: 1px solid var(--apple-hairline);
    overflow: auto;
    background-color: var(--apple-canvas);
}

.app-template-studio-shell .mud-tabs-panels {
    min-height: 65vh;
}

.app-template-source-editor textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 0.9rem;
    line-height: 1.45;
}

.app-template-side-panel {
    max-height: 75vh;
    overflow-y: auto;
}

.app-kegelkasse-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.app-camera-shell {
    position: relative;
    width: min(250px, 70vw);
    height: min(250px, 70vw);
}

.app-camera-video {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--mud-palette-primary);
}

.app-camera-crop-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 70%;
    border: 2px dashed rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
}

.app-camera-switch-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.app-camera-loading {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--mud-palette-background-grey);
    border: 3px dashed var(--mud-palette-lines-default);
}

.app-user-avatar {
    width: 96px;
    height: 96px;
    font-size: 2.2rem;
    overflow: hidden;
}

.app-user-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.app-user-avatar-action {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--mud-palette-primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-nav-role-select-section {
    padding: 0 0.65rem 0.35rem;
    gap: 0.35rem;
}

.mud-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes highlight-blink {
    0% { background-color: #ffd700aa; }
    50% { background-color: transparent; }
    100% { background-color: #ffd700aa; }
}

.highlight-row td {
    animation: highlight-blink 0.6s ease-in-out 4;
}

@media (max-width: 600px) {
    .app-page-header {
        align-items: flex-start !important;
    }

    .app-home-title,
    .app-page-title {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }

    .app-summary-avatar {
        width: 48px;
        height: 48px;
    }

    .app-detail-panel {
        margin-left: 0 !important;
        padding: 0.75rem !important;
    }

    .app-userlist-summary {
        width: 100%;
    }

    .app-page-title-sm {
        font-size: 1.1rem !important;
    }

    .app-finance-filter-control,
    .app-finance-search-field,
    .app-year-select {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }

    .app-toolbar-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .app-toolbar-wrap > * {
        width: 100%;
    }

    .app-kpi-icon,
    .app-kpi-icon-lg {
        font-size: 2.2rem;
    }

    .app-camera-shell {
        width: min(250px, 78vw);
        height: min(250px, 78vw);
    }

    .app-template-preview-frame {
        height: min(520px, 62vh);
    }
}


/* ===================== Benutzerverwaltung (UserList) ===================== */

/* KPI-/Statistikkarten oben auf der Seite */
.app-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.app-stat-row > .app-stat-card {
    flex: 1 1 180px;
}

.app-stat-card {
    border-radius: var(--apple-radius-md);
    height: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* Stat-Karten: flache Tint-Flächen (Apple: keine dekorativen Gradients) —
   Regeln liegen in css/apple.css, da MudBlazor.min.css nach app.css lädt
   und .mud-paper sonst die Hintergrundfarbe überschreibt. */

.app-stat-avatar {
    width: 48px;
    height: 48px;
}

.app-stat-value {
    font-weight: 700;
    line-height: 1.1;
}

.app-stat-label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
}

/* Schnellsuche im Benutzer-Tab */
.app-userlist-search {
    flex: 1;
    min-width: 240px;
    max-width: 420px;
}

/* Rollenkarten */
.app-role-card {
    border-radius: var(--apple-radius-md);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-role-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.app-role-card .mud-card-actions {
    margin-top: auto;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* Rollen-Mitglieder-Dialog */
.app-role-dialog-content {
    min-width: min(420px, 80vw);
}

.app-role-member-list {
    max-height: 320px;
    overflow-y: auto;
}

.app-role-member-item {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* IBAN-Karten */
.app-iban-card {
    border-radius: var(--apple-radius-md);
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-iban-card:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.app-iban-row {
    background: var(--mud-palette-background-gray);
    border-radius: 10px;
}

@media (max-width: 600px) {
    .app-userlist-search {
        min-width: 100%;
        max-width: 100%;
    }

    .app-stat-value {
        font-size: 1.25rem;
    }
}

/* ---------- Getränkenotizen (DrinkNotes, LawOfWriter) ---------- */

.drink-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.drink-note-card {
    background: var(--mud-palette-background-gray);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .drink-note-card:hover {
        transform: translateY(-2px);
    }

.drink-note-canvas {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 6px;
    background: #fff;
    display: block;
}

.drink-note-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 2px 0;
}

.drink-note-label {
    font-weight: 600;
}

.drink-note-dialog-canvas-wrap {
    background: #fff;
    border-radius: 8px;
    padding: 8px;
}

.drink-note-dialog-canvas {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 6px;
    display: block;
}

/* ===================== Umsätze hinzufügen (FinanceAdd) ===================== */

/* Status-Chips in der Toolbar: etwas kräftiger als Standard-Chips */
.app-import-chip {
    font-weight: 600;
}

/* Schnellsuche: kompakte feste Breite am Desktop, voll mobil (übernimmt
   die bestehende .app-finance-search-field-Media-Query) */
.app-import-search {
    width: 230px;
}

/* Label-Zuweisung für die aktuelle Auswahl */
.app-import-label-select {
    width: 210px;
}

@media (max-width: 600px) {
    .app-import-label-select {
        min-width: 100%;
        max-width: 100%;
        width: 100%;
    }
}

/* Schalter "Nur neue" nicht auf volle Breite ziehen (Mobile-Toolbar-Reset) */
.app-import-switch {
    width: auto;
    flex: 0 0 auto;
}

/* Status-Spalte im Grid nicht mitwachsen lassen */
.app-import-status-col {
    width: 118px;
    white-space: nowrap;
}

/* Bereits gebuchte Umsätze treten optisch zurück — funktionier in
   hellem und dunklem Theme, da nur die Deckkraft reduziert wird. */
tr.app-row-booked > td {
    opacity: 0.5;
}

/* Leerzustand, wenn noch keine Umsätze geladen sind */
.app-import-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    max-width: 640px;
    margin: 2.5rem auto;
    padding: 2.5rem 1.5rem;
    border-radius: var(--apple-radius-lg);
    border: 1px dashed color-mix(in srgb, var(--mud-palette-lines-default) 75%, transparent);
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
}

.app-import-empty-icon {
    width: 3rem;
    height: 3rem;
    font-size: 3rem;
    margin-bottom: 0.25rem;
    color: color-mix(in srgb, var(--mud-palette-primary) 55%, var(--mud-palette-text-primary));
}

@media (max-width: 600px) {
    .app-import-empty {
        margin: 1.5rem auto;
        padding: 2rem 1.25rem;
    }
}

/* --- N26-Online-Abruf: Fortschritts-Dialog (N26FetchDialog) + Toolbar-Chip --- */

/* Geblurrter Backdrop über der (sichtbar bleibenden) Seite; z-index über MudOverlay,
   aber unter Snackbar — Fehlermeldungen bleiben im geschlossenen Zustall lesbar. */
.app-n26-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: color-mix(in srgb, var(--apple-canvas-parchment) 55%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    backdrop-filter: blur(18px) saturate(1.1);
}

.app-n26-dialog {
    width: min(480px, 100%);
    padding: 1.6rem 1.6rem 1.35rem;
    border-radius: var(--apple-radius-lg);
    border: 1px solid color-mix(in srgb, var(--apple-ink) 8%, transparent);
    background: var(--apple-canvas);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: app-n26-dialog-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes app-n26-dialog-in {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

/* Kopf: pulsierender Icon-Chip + Laufzeit */
.app-n26-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.app-n26-head-icon {
    position: relative;
    width: 48px;
    height: 48px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--apple-primary) 13%, transparent);
    color: var(--apple-primary);
}

.app-n26-head-icon::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 18px;
    border: 2px solid color-mix(in srgb, var(--apple-primary) 55%, transparent);
    animation: app-n26-ring-pulse 1.8s ease-out infinite;
}

@keyframes app-n26-ring-pulse {
    0%   { opacity: 0.9; transform: scale(0.92); }
    70%  { opacity: 0; transform: scale(1.12); }
    100% { opacity: 0; }
}

.app-n26-title { letter-spacing: -0.015em; }

.app-n26-subtitle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.app-n26-subtitle-icon { margin-right: 0.15rem; }

/* Phasen-Timeline */
.app-n26-phases {
    list-style: none;
    margin: 0.25rem 0 1.1rem;
    padding: 0;
}

.app-n26-phases li {
    position: relative;
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    column-gap: 0.6rem;
    padding: 0.45rem 0;
}

.app-n26-phases li + li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: -14px;
    width: 2px;
    height: 28px;
    background: var(--apple-hairline);
}

.app-n26-phases li + li.app-n26-phase-done::before {
    background: color-mix(in srgb, var(--mud-palette-success) 60%, transparent);
}

.app-n26-phase-dot {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--apple-hairline);
    background: var(--apple-canvas);
    color: var(--apple-ink-muted-48);
}

.app-n26-phase-done .app-n26-phase-dot {
    border-color: var(--mud-palette-success);
    background: var(--mud-palette-success);
    color: #fff;
}

.app-n26-phase-active .app-n26-phase-dot {
    border-color: var(--apple-primary);
    color: var(--apple-primary);
}

.app-n26-phase-active .app-n26-phase-dot::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--apple-primary) 70%, transparent);
    animation: app-n26-dot-breathe 1.6s ease-in-out infinite;
}

@keyframes app-n26-dot-breathe {
    0%, 100% { transform: scale(0.55); opacity: 0.9; }
    50%      { transform: scale(1); opacity: 0.25; }
}

.app-n26-phase-name { font-weight: 600; }

.app-n26-phase-pending .app-n26-phase-name {
    color: var(--apple-ink-muted-48);
    font-weight: 500;
}

.app-n26-phase-time {
    color: var(--apple-ink-muted-48);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

/* 2FA-Callout: der eine Moment, an dem der Nutzer handeln muss */
.app-n26-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    margin-bottom: 1rem;
    border-radius: var(--apple-radius-md);
    background: color-mix(in srgb, var(--mud-palette-warning) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 38%, transparent);
}

.app-n26-callout-icon {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mud-palette-warning) 20%, transparent);
    color: var(--mud-palette-warning);
    animation: app-n26-callout-bounce 2.4s ease-in-out infinite;
}

@keyframes app-n26-callout-bounce {
    0%, 100% { transform: translateY(0); }
    8%       { transform: translateY(-3px); }
    16%      { transform: translateY(0); }
    24%      { transform: translateY(-2px); }
    32%      { transform: translateY(0); }
}

.app-n26-callout-title { font-weight: 700; }

/* Live-Log: dunkler Terminal-Feed in beiden Themes */
.app-n26-log {
    padding: 0.75rem 0.9rem;
    border-radius: var(--apple-radius-md);
    background: #161618;
    color: #d2d2d7;
    font-family: 'Consolas', 'Monaco', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.75;
    overflow: hidden;
}

html.apple-dark .app-n26-log { background: #000; }

.app-n26-log-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    color: #8e8e93;
    font-family: var(--apple-font-text);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-n26-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mud-palette-success);
    animation: app-n26-live-blink 1.4s ease-in-out infinite;
}

@keyframes app-n26-live-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}

.app-n26-log-row {
    display: flex;
    gap: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-n26-log-ts { color: #636366; }

.app-n26-log-ok { color: var(--mud-palette-success); }

.app-n26-log-info { color: #64d2ff; }

/* Footer-Buttons: Apple-Pille — Mud rounded-lg (8px !important) muss explizit überschrieben werden */
.app-n26-dialog .app-n26-btn {
    height: 44px;
    border-radius: var(--apple-radius-pill) !important;
    font-size: 0.95rem;
}

.app-n26-dialog .app-n26-btn-ghost {
    height: 44px;
    border-radius: var(--apple-radius-pill) !important;
}

.app-n26-foot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.app-n26-hint { margin-top: 0.6rem; }

/* Erfolgsszene */
.app-n26-success-icon {
    width: 64px;
    height: 64px;
    margin: 2px auto 0.9rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mud-palette-success);
    color: #fff;
    animation: app-n26-pop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.6);
}

@keyframes app-n26-pop-in {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.app-n26-success-head { text-align: center; margin-bottom: 1.1rem; }

.app-n26-success-title { letter-spacing: -0.015em; }

.app-n26-kpis {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.app-n26-kpi {
    padding: 0.75rem 0.6rem;
    text-align: center;
    border-radius: var(--apple-radius-md);
    background: var(--apple-surface-pearl);
    border: 1px solid var(--apple-divider-soft);
}

.app-n26-kpi-num {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.app-n26-kpi-accent { color: var(--mud-palette-success); }

.app-n26-kpi-label {
    color: var(--apple-ink-muted-48);
    font-size: 0.72rem;
    font-weight: 600;
}

.app-n26-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: var(--apple-ink-muted-80);
    font-size: 0.85rem;
}

.app-n26-range-icon { color: var(--apple-ink-muted-48); }

/* Toolbar-Chip im Hintergrund-Modus: rotierendes Icon deutet den laufenden Abruf an */
.app-n26-chip .mud-icon-root,
.app-n26-chip svg {
    animation: app-n26-spin 2.2s linear infinite;
}

@keyframes app-n26-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Mobile: Dialog als Bottom-Sheet mit Griff */
@media (max-width: 640px) {
    .app-n26-overlay {
        align-items: end;
        padding: 0;
    }

    .app-n26-dialog {
        width: 100%;
        border-radius: var(--apple-radius-lg) var(--apple-radius-lg) 0 0;
        padding: 0.6rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
        animation: app-n26-sheet-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    }

    @keyframes app-n26-sheet-in {
        from { transform: translateY(60%); }
        to   { transform: none; }
    }

    .app-n26-grip {
        width: 38px;
        height: 5px;
        border-radius: 3px;
        margin: 0.25rem auto 0.9rem;
        background: color-mix(in srgb, var(--apple-ink) 22%, transparent);
    }

    /* nur die zwei neuesten Log-Zeilen — nichts clippen
       (Kopf zählt mit: Reihe 3 ist das 4. Kind und existiert nur bei 3 Meldungen) */
    .app-n26-log-row:nth-child(4) { display: none; }

    .app-n26-head { margin-bottom: 0.9rem; }

    .app-n26-phases li { padding: 0.3rem 0; }

    .app-n26-phases li + li::before {
        top: -11px;
        height: 22px;
    }

    .app-n26-callout {
        padding: 0.7rem 0.8rem;
        margin-bottom: 0.8rem;
    }

    .app-n26-kpi-num { font-size: 1.2rem; }
}

/* Griff nur auf Mobile zeigen */
.app-n26-grip { display: none; }

@media (max-width: 640px) {
    .app-n26-grip { display: block; }
}


/* --- E-Mail-Vorlagen-Editor --- */
.app-mail-template-source textarea {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre;
}

.app-template-preview-frame {
    width: 100%;
    height: 620px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 6px;
    background: #fff;
}

.app-template-side-panel {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.app-mail-variable-code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: var(--mud-palette-primary);
    background: var(--mud-palette-background-grey);
    padding: 1px 5px;
    border-radius: 3px;
    align-self: flex-start;
}

/* Visueller E-Mail-Editor (Quill): feste Arbeitshöhe und lesbare Schrift */
.app-mail-template-rich .ql-container {
    min-height: 420px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.app-mail-template-rich .ql-editor {
    min-height: 420px;
}

/* Rohantwort des Endpoints im KI-Verbindungstest — umbruchfähig und abgesetzt */
.app-ai-test-detail {
    display: block;
    margin-top: 0.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    overflow-wrap: anywhere;
    word-break: break-word;
}
