:root {
    --bg0: #0c0e12;
    --bg1: #12151c;
    --text: #e8eaef;
    --muted: #8b92a5;
    --card: rgba(22, 26, 36, 0.72);
    --stroke: rgba(255, 255, 255, 0.06);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 400;
    color: var(--text);
    background: var(--bg0);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(99, 102, 241, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 50%, rgba(16, 185, 129, 0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(244, 114, 182, 0.06), transparent 45%);
    line-height: 1.5;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 2rem) 4rem;
}

header {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    text-align: center;
}

header h1 {
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #f0f2f8 0%, #a8b0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

header p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--muted);
    max-width: 32em;
    margin-inline: auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 140px;
    padding: 1.35rem 1.4rem 1.25rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.28s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(
        600px circle at var(--mx, 50%) var(--my, 0%),
        color-mix(in srgb, var(--accent) 22%, transparent),
        transparent 45%
    );
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--stroke));
    box-shadow:
        0 16px 40px -20px color-mix(in srgb, var(--accent) 40%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent);
}

.card:hover::before,
.card:focus-visible::before {
    opacity: 1;
}

.card:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, white);
    outline-offset: 3px;
}

.card-index {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}

.card-desc {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--muted);
    flex: 1;
}

.card-arrow {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--accent) 85%, white);
}

.card-arrow svg {
    width: 1em;
    height: 1em;
    transition: transform 0.2s ease;
}

.card:hover .card-arrow svg,
.card:focus-visible .card-arrow svg {
    transform: translateX(4px);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius);
    border: 1px dashed var(--stroke);
    color: var(--muted);
    font-weight: 300;
    font-size: 0.95rem;
}

.empty-state code {
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.88em;
    padding: 0.15em 0.45em;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 300;
}

.wrap--narrow {
    max-width: 420px;
}

/* Fixe Leiste oben rechts, bündig mit .wrap (1120px) */
body:has(.header-toolbar) {
    padding-top: calc(4.25rem + env(safe-area-inset-top, 0px));
}

.header-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding-top: env(safe-area-inset-top, 0px);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--bg0) 96%, #0f172a) 0%,
        color-mix(in srgb, var(--bg0) 78%, transparent) 70%,
        transparent 100%
    );
    border-bottom: 1px solid color-mix(in srgb, white 6%, transparent);
    box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.header-toolbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.65rem clamp(1.25rem, 4vw, 2rem) 0.7rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    pointer-events: auto;
}

.header-toolbar-inner--spread {
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.header-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.header-nav--segmented {
    gap: 0;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg1) 88%, #0f172a);
    border: 1px solid color-mix(in srgb, white 8%, var(--stroke));
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, white 5%, transparent),
        0 4px 18px -10px rgba(0, 0, 0, 0.55);
}

.header-nav-link {
    padding: 0.38rem 1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid transparent;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.2s ease;
}

.header-nav-link--segment {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.95rem 0.42rem 0.72rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.header-nav-link--segment .header-nav-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    opacity: 0.72;
    transition: opacity 0.18s ease;
}

.header-nav-link--segment:hover .header-nav-icon,
.header-nav-link--segment.is-active .header-nav-icon {
    opacity: 1;
}

.header-nav-link:hover {
    color: #e2e8f0;
    background: color-mix(in srgb, white 6%, transparent);
}

.header-nav-link.is-active {
    color: #f1f5f9;
    background: color-mix(in srgb, var(--card) 100%, transparent);
    border-color: color-mix(in srgb, #64748b 25%, var(--stroke));
    box-shadow:
        0 1px 0 color-mix(in srgb, white 5%, transparent),
        inset 0 1px 0 color-mix(in srgb, white 4%, transparent);
}

.header-nav--segmented .header-nav-link--segment:hover:not(.is-active) {
    background: color-mix(in srgb, white 5%, transparent);
}

.header-nav--segmented .header-nav-link--segment.is-active {
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #6366f1 35%, var(--card)) 0%,
        color-mix(in srgb, #312e81 22%, var(--card)) 100%
    );
    border-color: color-mix(in srgb, #818cf8 28%, var(--stroke));
    color: #f8fafc;
    box-shadow:
        0 2px 12px -4px color-mix(in srgb, #6366f1 45%, transparent),
        inset 0 1px 0 color-mix(in srgb, white 12%, transparent);
}

.header-nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, #6366f1 25%, transparent);
}

.header-nav--segmented .header-nav-link--segment:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, #6366f1 45%, transparent);
}

.header-nav-wrap {
    position: relative;
    min-width: 0;
    flex: 1 1 auto;
}

.header-nav--desktop {
    flex-wrap: nowrap;
}

.header-nav-dropdown {
    position: relative;
}

.header-nav-dropdown-trigger {
    cursor: pointer;
    font: inherit;
    background: transparent;
    appearance: none;
}

.header-nav-chevron {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    opacity: 0.65;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.header-nav-dropdown.is-open .header-nav-chevron,
.header-nav-dropdown-trigger[aria-expanded="true"] .header-nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.header-nav-dropdown.is-active > .header-nav-dropdown-trigger {
    color: #f8fafc;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #6366f1 35%, var(--card)) 0%,
        color-mix(in srgb, #312e81 22%, var(--card)) 100%
    );
    border-color: color-mix(in srgb, #818cf8 28%, var(--stroke));
    box-shadow:
        0 2px 12px -4px color-mix(in srgb, #6366f1 45%, transparent),
        inset 0 1px 0 color-mix(in srgb, white 12%, transparent);
}

.header-nav-mobile-trigger-wrap {
    display: none;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    appearance: none;
}

.header-nav-mobile-trigger-wrap .header-nav-mobile-trigger {
    pointer-events: none;
}

.header-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 50%;
    z-index: 220;
    min-width: 12.5rem;
    padding: 0.35rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, white 10%, var(--stroke));
    background: color-mix(in srgb, var(--bg1) 94%, #0f172a);
    box-shadow:
        0 16px 40px -16px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -4px);
    transition:
        opacity 0.16s ease,
        transform 0.16s ease,
        visibility 0.16s ease;
    pointer-events: none;
}

.header-nav-dropdown.is-open .header-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.header-nav-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--muted);
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.header-nav-dropdown-link .header-nav-icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.72;
}

.header-nav-dropdown-link:hover {
    color: #e2e8f0;
    background: color-mix(in srgb, white 6%, transparent);
}

.header-nav-dropdown-link.is-active {
    color: #f8fafc;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #6366f1 35%, var(--card)) 0%,
        color-mix(in srgb, #312e81 22%, var(--card)) 100%
    );
}

.header-nav-dropdown-link.is-active .header-nav-icon {
    opacity: 1;
}

.header-nav-mobile-trigger,
.header-nav-mobile-panel {
    display: none;
}

@media (max-width: 820px) {
    .header-nav--desktop {
        display: none;
    }

    .header-nav-mobile-trigger-wrap {
        display: inline-flex;
    }

    .header-nav-mobile-trigger {
        display: inline-flex;
    }

    .header-nav-mobile-current {
        margin-left: 0.15rem;
        padding: 0.12rem 0.5rem;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 600;
        color: #c7d2fe;
        background: color-mix(in srgb, #6366f1 22%, transparent);
        border: 1px solid color-mix(in srgb, #818cf8 25%, transparent);
        max-width: 8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-nav-mobile-panel {
        display: block;
        position: absolute;
        top: calc(100% + 0.45rem);
        left: 0;
        right: 0;
        z-index: 220;
        padding: 0.65rem;
        border-radius: calc(var(--radius) + 4px);
        border: 1px solid color-mix(in srgb, white 10%, var(--stroke));
        background: color-mix(in srgb, var(--bg1) 96%, #0f172a);
        box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.7);
    }

    .header-nav-mobile-panel[hidden] {
        display: none;
    }

    .header-nav-mobile-groups {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        max-height: min(70vh, 28rem);
        overflow-y: auto;
    }

    .header-nav-mobile-group {
        padding: 0.35rem 0 0.15rem;
    }

    .header-nav-mobile-group-label {
        display: block;
        padding: 0.25rem 0.65rem 0.4rem;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: color-mix(in srgb, var(--muted) 85%, var(--text));
    }

    .header-nav-mobile-group-links {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }

    .header-nav-mobile-link {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.6rem 0.65rem;
        border-radius: calc(var(--radius) - 2px);
        font-size: 0.875rem;
        font-weight: 600;
        text-decoration: none;
        color: var(--muted);
        transition: color 0.15s ease, background 0.15s ease;
    }

    .header-nav-mobile-link .header-nav-icon {
        width: 1.05rem;
        height: 1.05rem;
        opacity: 0.75;
    }

    .header-nav-mobile-link:hover {
        color: #e2e8f0;
        background: color-mix(in srgb, white 5%, transparent);
    }

    .header-nav-mobile-link.is-active {
        color: #f8fafc;
        background: linear-gradient(
            145deg,
            color-mix(in srgb, #6366f1 35%, var(--card)) 0%,
            color-mix(in srgb, #312e81 22%, var(--card)) 100%
        );
    }

    .header-nav-mobile-link.is-active .header-nav-icon {
        opacity: 1;
    }

    .header-toolbar-inner--spread {
        flex-wrap: nowrap;
    }
}

.header-logout {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.95rem 0.42rem 0.65rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #64748b 22%, var(--stroke));
    background: color-mix(in srgb, var(--card) 94%, #1e1b4b);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #e2e8f0;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    box-shadow:
        0 1px 0 color-mix(in srgb, white 6%, transparent),
        inset 0 1px 0 color-mix(in srgb, white 5%, transparent);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.25s ease,
        transform 0.18s ease,
        color 0.15s ease;
}

.header-logout:hover {
    border-color: color-mix(in srgb, #818cf8 35%, var(--stroke));
    background: color-mix(in srgb, #252b3d 92%, #312e81);
    box-shadow:
        0 6px 20px -8px color-mix(in srgb, #6366f1 45%, transparent),
        0 0 0 1px color-mix(in srgb, #6366f1 18%, transparent);
    transform: translateY(-1px);
    color: #f8fafc;
}

.header-logout:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, #a5b4fc 50%, var(--stroke));
    box-shadow: 0 0 0 3px color-mix(in srgb, #6366f1 28%, transparent);
}

.header-logout:active {
    transform: translateY(0);
}

.header-logout-icon {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    opacity: 0.92;
}

.header-logout:hover .header-logout-icon {
    opacity: 1;
}

@media (max-width: 380px) {
    .header-logout-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .header-logout {
        padding: 0.5rem;
        border-radius: 12px;
    }
}

/* —— Gesundheit (Withings) —— */
.health-hero {
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
    text-align: center;
}

.health-hero h1 {
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #f0f2f8 0%, #a8b0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.health-lead {
    margin: 0 auto;
    max-width: 36em;
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--muted);
}

.health-error {
    border-style: solid;
    border-color: color-mix(in srgb, #fb7185 35%, var(--stroke));
    background: color-mix(in srgb, #fb7185 10%, var(--card));
    color: #fecaca;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.25rem;
}

.health-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .health-grid--two {
        grid-template-columns: 1fr;
    }
}

.health-page-eyebrow {
    margin: 0 0 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.health-section-heading {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
    padding-top: 0.25rem;
}

.health-weight-banner {
    width: 100%;
    margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
    border-radius: calc(var(--radius) + 4px);
    background: var(--card);
    border: 1px solid color-mix(in srgb, #6366f1 22%, var(--stroke));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    box-shadow:
        0 20px 50px -28px color-mix(in srgb, #6366f1 35%, transparent),
        0 0 0 1px color-mix(in srgb, #6366f1 8%, transparent);
}

.health-weight-banner-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.health-weight-banner-text {
    width: 100%;
    padding: clamp(1.35rem, 3vw, 2rem) clamp(1.25rem, 4vw, 2.5rem) 1rem;
    text-align: center;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, #6366f1 12%, transparent) 0%,
        transparent 72%
    );
}

.health-weight-title {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.health-weight-kpi {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    width: 100%;
}

.health-weight-value {
    font-size: clamp(3rem, 12vw, 5.25rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #a5b4fc;
    text-shadow: 0 0 60px color-mix(in srgb, #6366f1 35%, transparent);
}

.health-weight-unit {
    font-size: clamp(1.15rem, 3.5vw, 1.65rem);
    font-weight: 500;
    color: var(--muted);
}

.health-weight-banner .health-delta {
    justify-content: center;
    text-align: center;
}

.health-weight-meta {
    margin-top: 0.75rem !important;
}

.health-weight-chart-wrap {
    position: relative;
    width: 100%;
    height: min(280px, 42vw);
    min-height: 200px;
    padding: 0.65rem clamp(0.75rem, 2vw, 1.25rem) 1rem;
}

@media (min-width: 900px) {
    .health-weight-chart-wrap {
        height: 260px;
    }
}

.health-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    box-shadow: 0 12px 40px -24px rgba(0, 0, 0, 0.5);
    transition: border-color 0.22s ease, box-shadow 0.25s ease;
}

.health-card:hover {
    border-color: color-mix(in srgb, #6366f1 22%, var(--stroke));
    box-shadow:
        0 16px 48px -20px color-mix(in srgb, #6366f1 25%, transparent),
        0 0 0 1px color-mix(in srgb, #6366f1 10%, transparent);
}

.health-card[data-accent="0"] { --health-accent: #7c9cff; }
.health-card[data-accent="1"] { --health-accent: #5eead4; }
.health-card[data-accent="2"] { --health-accent: #fbbf77; }
.health-card[data-accent="3"] { --health-accent: #c4b5fd; }
.health-card[data-accent="4"] { --health-accent: #fb7185; }
.health-card[data-accent="5"] { --health-accent: #94d2bd; }
.health-card[data-accent="6"] { --health-accent: #38bdf8; }
.health-card[data-accent="7"] { --health-accent: #a3e635; }

.health-card-top {
    padding: 1.25rem 1.35rem 1rem;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--health-accent, #7c9cff) 8%, transparent) 0%,
        transparent 65%
    );
}

.health-card-title {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #f1f5f9;
}

.health-kpi {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

.health-kpi-value {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--health-accent, #7c9cff);
    line-height: 1.1;
}

.health-kpi-unit {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--muted);
}

.health-delta {
    margin: 0.65rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
}

.health-delta.is-up {
    color: #86efac;
}

.health-delta.is-down {
    color: #fca5a5;
}

.health-meta {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--muted);
}

.health-chart-wrap {
    position: relative;
    height: 220px;
    padding: 0.5rem 0.65rem 0.85rem;
}

.health-page-header {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    text-align: center;
}

.health-page-title {
    margin: 0 0 0.5rem;
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: clamp(1.65rem, 3.5vw, 2.1rem);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #f0f2f8 0%, #a8b0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.health-page-lead {
    margin: 0 auto 1rem;
    max-width: 40em;
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--muted);
}

.health-source-nav {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.health-source-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 80%, transparent);
    color: #cbd5e1;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.health-source-nav-link:hover,
.health-source-nav-link:focus-visible {
    color: #f8fafc;
    border-color: color-mix(in srgb, #6366f1 35%, var(--stroke));
    background: color-mix(in srgb, #6366f1 12%, var(--card));
}

.health-source-section {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    padding-top: 0.5rem;
    scroll-margin-top: 5rem;
}

.health-source-section--garmin {
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
    border-top: 1px solid color-mix(in srgb, #22d3ee 18%, var(--stroke));
}

.health-source-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 560px) {
    .health-source-header {
        flex-direction: column;
    }
}

.health-source-title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.health-source-lead {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--muted);
    max-width: 42em;
}

.health-source-lead code {
    font-size: 0.92em;
}

.health-source-badge {
    flex-shrink: 0;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.health-source-badge--withings {
    color: #c7d2fe;
    background: color-mix(in srgb, #6366f1 18%, transparent);
    border: 1px solid color-mix(in srgb, #6366f1 28%, var(--stroke));
}

.health-source-badge--garmin {
    color: #a5f3fc;
    background: color-mix(in srgb, #22d3ee 16%, transparent);
    border: 1px solid color-mix(in srgb, #22d3ee 28%, var(--stroke));
}

.health-source-empty {
    margin-top: 0;
}

.health-subsection-heading {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #cbd5e1;
}

.health-garmin-hero {
    margin-bottom: 1.25rem;
    border-radius: calc(var(--radius) + 4px);
    background: var(--card);
    border: 1px solid color-mix(in srgb, #22d3ee 22%, var(--stroke));
    overflow: hidden;
    box-shadow:
        0 20px 50px -28px color-mix(in srgb, #22d3ee 35%, transparent),
        0 0 0 1px color-mix(in srgb, #22d3ee 8%, transparent);
}

.health-garmin-hero-inner {
    display: flex;
    flex-direction: column;
}

.health-garmin-hero-text {
    padding: clamp(1.2rem, 3vw, 1.75rem) clamp(1.25rem, 4vw, 2rem) 1rem;
    text-align: center;
    border-bottom: 1px solid var(--stroke);
    background: linear-gradient(
        180deg,
        color-mix(in srgb, #22d3ee 12%, transparent) 0%,
        transparent 72%
    );
}

.health-garmin-hero-title {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.health-garmin-hero-kpi {
    display: flex;
    justify-content: center;
}

.health-garmin-hero-value {
    font-size: clamp(2.75rem, 10vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #67e8f9;
    text-shadow: 0 0 60px color-mix(in srgb, #22d3ee 35%, transparent);
}

.health-garmin-hero-chart-wrap {
    position: relative;
    height: min(240px, 38vw);
    min-height: 190px;
    padding: 0.65rem clamp(0.75rem, 2vw, 1.25rem) 1rem;
}

.health-garmin-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.health-garmin-kpi {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
}

.health-garmin-kpi-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.health-garmin-kpi-value {
    font-size: 1.35rem;
    font-weight: 600;
    color: #67e8f9;
}

.health-garmin-kpi-unit {
    margin-left: 0.15rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
}

.health-garmin-sleep-block {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
}

@media (min-width: 860px) {
    .health-garmin-sleep-block {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        align-items: stretch;
    }
}

.health-garmin-sleep-stats {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.health-garmin-sleep-stats li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.health-garmin-sleep-stats strong {
    color: #e2e8f0;
    font-weight: 600;
}

.health-garmin-sleep-chart-wrap {
    position: relative;
    min-height: 220px;
    height: 100%;
}

.health-card--garmin:hover {
    border-color: color-mix(in srgb, #22d3ee 22%, var(--stroke));
    box-shadow:
        0 16px 48px -20px color-mix(in srgb, #22d3ee 25%, transparent),
        0 0 0 1px color-mix(in srgb, #22d3ee 10%, transparent);
}

.health-activity-list {
    display: grid;
    gap: 0.85rem;
}

.health-activity-card {
    padding: 1rem 1.1rem 1.05rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
}

.health-activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--stroke);
}

.health-activity-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.health-activity-meta {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.health-activity-distance-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #67e8f9;
    white-space: nowrap;
}

.health-activity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.health-activity-stats dt {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.health-activity-stats dd {
    margin: 0;
    font-size: 0.88rem;
    color: #e2e8f0;
}

.login-header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.login-header h1 {
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
    background: linear-gradient(135deg, #f0f2f8 0%, #a8b0c4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-lead {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--muted);
}

.login-warn {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px dashed var(--stroke);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 300;
}

.login-warn code {
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.88em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.login-error {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #fb7185 40%, var(--stroke));
    background: color-mix(in srgb, #fb7185 12%, var(--card));
    color: #fecaca;
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 1.35rem 1.4rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.login-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.35rem;
}

.login-label:first-of-type {
    margin-top: 0;
}

.login-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

.login-input:focus {
    outline: none;
    border-color: color-mix(in srgb, #7c9cff 50%, var(--stroke));
    box-shadow: 0 0 0 3px color-mix(in srgb, #7c9cff 18%, transparent);
}

.login-submit {
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.12s ease;
}

.login-submit:hover,
.login-submit:focus-visible {
    filter: brightness(1.06);
}

.login-submit:active {
    transform: scale(0.99);
}

/* —— Home Assistant Integrationen —— */
.integrations-wrap {
    max-width: 1080px;
}

.integrations-hero {
    display: grid;
    gap: 1.75rem;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: calc(var(--radius) + 6px);
    background:
        radial-gradient(ellipse 90% 70% at 100% 0%, color-mix(in srgb, #6366f1 16%, transparent), transparent 55%),
        radial-gradient(ellipse 70% 60% at 0% 100%, color-mix(in srgb, #22d3ee 12%, transparent), transparent 50%),
        var(--card);
    border: 1px solid color-mix(in srgb, #6366f1 18%, var(--stroke));
    box-shadow:
        0 24px 60px -32px color-mix(in srgb, #6366f1 35%, transparent),
        0 0 0 1px color-mix(in srgb, #6366f1 6%, transparent);
}

@media (min-width: 820px) {
    .integrations-hero {
        grid-template-columns: 1.4fr 1fr;
        align-items: center;
    }
}

.integrations-eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #a5b4fc;
}

.integrations-title {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    background: linear-gradient(135deg, #f8fafc 0%, #a5b4fc 55%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.integrations-lead {
    margin: 0;
    max-width: 34em;
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

.integrations-platform {
    margin: 0.85rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.integrations-health-link {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
}

.integrations-health-link:hover,
.integrations-health-link:focus-visible {
    color: #c7d2fe;
    text-decoration: underline;
}

.integration-status--hero {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
}

.integration-status--ok {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
    background: color-mix(in srgb, #6ee7b7 10%, transparent);
}

.integration-status--degraded {
    color: #fcd34d;
    border-color: color-mix(in srgb, #fcd34d 35%, var(--stroke));
    background: color-mix(in srgb, #fcd34d 10%, transparent);
}

.integration-status--error {
    color: #fca5a5;
    border-color: color-mix(in srgb, #fca5a5 35%, var(--stroke));
    background: color-mix(in srgb, #fca5a5 10%, transparent);
}

.integration-status.is-muted {
    color: #94a3b8;
    border-color: var(--stroke);
    background: rgba(0, 0, 0, 0.18);
}

.integration-status.is-muted .integration-status-dot {
    box-shadow: none;
}

.integrations-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.integrations-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 5.5rem;
    padding: 0.85rem 0.65rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--stroke);
    text-align: center;
}

.integrations-stat--accent {
    border-color: color-mix(in srgb, #6ee7b7 30%, var(--stroke));
    background: color-mix(in srgb, #6ee7b7 8%, rgba(0, 0, 0, 0.22));
}

.integrations-stat-value {
    font-size: clamp(1.55rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #e2e8f0;
}

.integrations-stat--accent .integrations-stat-value {
    color: #6ee7b7;
}

.integrations-stat-sub {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

.integrations-stat-label {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-section {
    margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.integrations-section-head {
    margin-bottom: 1.1rem;
}

.integrations-section-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.integrations-section-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.integrations-grid {
    display: grid;
    gap: 1rem;
}

.integrations-grid--pages {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.integrations-grid--api {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.integration-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.25rem 1.3rem 1.15rem;
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    border: 1px solid var(--stroke);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.28s ease;
}

.integration-tile-glow {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--accent) 85%, white),
        transparent
    );
    opacity: 0.75;
}

.integration-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    background: radial-gradient(
        520px circle at var(--mx, 50%) var(--my, 0%),
        color-mix(in srgb, var(--accent) 18%, transparent),
        transparent 48%
    );
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.integration-tile:not(.integration-tile--static):hover,
.integration-tile:not(.integration-tile--static):focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent) 38%, var(--stroke));
    box-shadow:
        0 20px 48px -24px color-mix(in srgb, var(--accent) 42%, transparent),
        0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.integration-tile:not(.integration-tile--static):hover::after,
.integration-tile:not(.integration-tile--static):focus-visible::after {
    opacity: 1;
}

.integration-tile--static {
    cursor: default;
}

.integration-tile--soon {
    border-style: dashed;
    opacity: 0.88;
}

.integration-tile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.integration-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    color: color-mix(in srgb, var(--accent) 80%, white);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--stroke));
    box-shadow: 0 10px 28px -16px color-mix(in srgb, var(--accent) 50%, transparent);
}

.integration-tile-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.integration-tile-icon--muted {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--stroke);
    box-shadow: none;
}

.integration-tile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.integration-kind {
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--stroke);
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.2);
    color: var(--muted);
}

.integration-status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: currentColor;
}

.integration-status.is-ok {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
    background: color-mix(in srgb, #6ee7b7 10%, transparent);
}

.integration-status.is-ok .integration-status-dot {
    box-shadow: 0 0 8px color-mix(in srgb, #6ee7b7 80%, transparent);
}

.integration-status.is-warn {
    color: #fcd34d;
    border-color: color-mix(in srgb, #fcd34d 35%, var(--stroke));
    background: color-mix(in srgb, #fcd34d 10%, transparent);
}

.integration-status.is-off {
    color: #fca5a5;
    border-color: color-mix(in srgb, #fca5a5 35%, var(--stroke));
    background: color-mix(in srgb, #fca5a5 10%, transparent);
}

.integration-tile-body {
    flex: 1;
}

.integration-tile-tagline {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 70%, white);
}

.integration-tile-title {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.integration-tile-desc {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.55;
    color: var(--muted);
}

.integration-tile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 1rem;
}

.integration-endpoint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--stroke);
    font-size: 0.78rem;
}

.integration-endpoint-method {
    padding: 0.12rem 0.35rem;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fde68a;
    background: color-mix(in srgb, #fbbf77 18%, transparent);
}

.integration-endpoint code {
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.76rem;
    color: #cbd5e1;
}

.integration-chip {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6ee7b7;
    background: color-mix(in srgb, #6ee7b7 10%, transparent);
    border: 1px solid color-mix(in srgb, #6ee7b7 28%, var(--stroke));
}

.integration-chip--muted {
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.18);
    border-color: var(--stroke);
}

.integration-tile-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--stroke);
}

.integration-tile-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--accent) 85%, white);
}

.integration-tile-arrow {
    width: 1.1rem;
    height: 1.1rem;
    color: color-mix(in srgb, var(--accent) 85%, white);
    transition: transform 0.2s ease;
}

.integration-tile:not(.integration-tile--static):hover .integration-tile-arrow,
.integration-tile:not(.integration-tile--static):focus-visible .integration-tile-arrow {
    transform: translateX(4px);
}

.integration-tile-note {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
}

.integration-tile--soon .integration-tile-note {
    color: color-mix(in srgb, var(--accent) 80%, white);
}

@media (max-width: 520px) {
    .integrations-stats {
        grid-template-columns: 1fr;
    }

    .integrations-stat {
        min-height: auto;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .integrations-stat-label {
        margin-top: 0;
        text-align: right;
    }
}

.integrations-govee-section {
    --accent: #a855f7;
}

.integrations-govee-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1.15rem 1.25rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--stroke));
    background:
        radial-gradient(640px circle at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
        var(--card);
}

.integrations-govee-head-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: min(100%, 280px);
}

.integrations-govee-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    color: color-mix(in srgb, var(--accent) 88%, white);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.integrations-govee-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.integrations-govee-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 72%, white);
}

.integrations-govee-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.integrations-govee-lead {
    margin: 0;
    max-width: 42rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted);
}

.integrations-govee-lead code {
    font-size: 0.82em;
}

.integrations-govee-head-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
}

.integrations-govee-count {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: color-mix(in srgb, var(--accent) 85%, white);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}

.integrations-govee-endpoint {
    max-width: 100%;
}

.integrations-govee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}

.integrations-govee-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.05rem 1.1rem 1rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    overflow: hidden;
    transition:
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.integrations-govee-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--stroke));
    box-shadow: 0 16px 40px -28px color-mix(in srgb, var(--accent) 55%, transparent);
}

.integrations-govee-card-glow {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--accent) 80%, white),
        transparent
    );
    opacity: 0.85;
}

.integrations-govee-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.integrations-govee-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.integrations-govee-id {
    flex-shrink: 0;
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-elevated) 70%, transparent);
    border: 1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
}

.integrations-govee-card-desc {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--muted);
}

.integrations-govee-kv {
    margin: 0;
}

.integrations-govee-kv-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.65rem;
    align-items: center;
}

.integrations-govee-kv dt {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-govee-kv dd {
    margin: 0;
    min-width: 0;
}

.integrations-govee-kv dd code {
    display: inline-block;
    max-width: 100%;
    padding: 0.18rem 0.45rem;
    border-radius: 6px;
    font-size: 0.8rem;
    word-break: break-all;
    color: #e9d5ff;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.integrations-govee-ha {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
}

.integrations-govee-ha-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-govee-ha-code {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: break-all;
    color: #cbd5e1;
    background: color-mix(in srgb, #0f172a 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
}

.integrations-govee-alert {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--muted);
    background: color-mix(in srgb, var(--surface-elevated) 55%, transparent);
    border: 1px dashed color-mix(in srgb, var(--stroke) 90%, transparent);
}

.integrations-govee-alert--warn {
    color: color-mix(in srgb, #fbbf24 88%, white);
    background: color-mix(in srgb, #fbbf24 8%, transparent);
    border-color: color-mix(in srgb, #fbbf24 28%, transparent);
    border-style: solid;
}

.integrations-govee-footnote {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}

.integrations-govee-footnote code {
    font-size: 0.92em;
}

.integrations-govee-trace {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--stroke));
    background: color-mix(in srgb, var(--accent) 6%, var(--card));
}

.integrations-govee-trace-main {
    flex: 1 1 280px;
    min-width: min(100%, 240px);
}

.integrations-govee-trace-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.integrations-govee-trace-desc,
.integrations-govee-trace-note {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--muted);
}

.integrations-govee-trace-desc code,
.integrations-govee-trace-note code {
    font-size: 0.92em;
}

.integrations-govee-trace-note--warn {
    color: color-mix(in srgb, #fbbf77 82%, white);
}

.integrations-govee-trace-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.integrations-govee-trace-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.integrations-govee-trace-switch {
    position: relative;
    flex-shrink: 0;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 28%, transparent);
    border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.integrations-govee-trace-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.integrations-govee-trace-input:checked + .integrations-govee-trace-switch {
    background: color-mix(in srgb, var(--accent) 72%, #1a1028);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.integrations-govee-trace-input:checked + .integrations-govee-trace-switch::after {
    transform: translateX(1.25rem);
}

.integrations-govee-trace-input:focus-visible + .integrations-govee-trace-switch {
    outline: 2px solid color-mix(in srgb, var(--accent) 65%, white);
    outline-offset: 2px;
}

.integrations-govee-trace-input:disabled + .integrations-govee-trace-switch {
    opacity: 0.45;
}

.integrations-govee-trace-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.integrations-govee-trace-state {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 78%, white);
}

.integrations-govee-trace-feedback {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.integrations-govee-trace-feedback.is-ok {
    color: color-mix(in srgb, #5eead4 78%, white);
}

.integrations-govee-trace-feedback.is-error {
    color: color-mix(in srgb, #fb7185 82%, white);
}

.integrations-govee-panels {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.integrations-govee-panel {
    padding: 1rem 1.1rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--stroke));
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.integrations-govee-panel--wide {
    grid-column: 1 / -1;
}

.integrations-govee-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.integrations-govee-panel-title {
    margin: 0 0 0.25rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #e2e8f0;
}

.integrations-govee-panel-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--muted);
}

.integrations-govee-panel-desc code {
    font-size: 0.92em;
}

.integrations-govee-btn {
    appearance: none;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--stroke));
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    cursor: pointer;
}

.integrations-govee-btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.integrations-govee-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.integrations-govee-btn--primary {
    color: #0f172a;
    background: color-mix(in srgb, var(--accent) 78%, white);
    border-color: transparent;
}

.integrations-govee-status-grid {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}

.integrations-govee-status-row {
    display: grid;
    grid-template-columns: minmax(7rem, 10rem) 1fr;
    gap: 0.65rem 1rem;
    align-items: baseline;
}

.integrations-govee-status-row dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-govee-status-row dd {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #e2e8f0;
}

.integrations-govee-status-row dd code {
    font-size: 0.88em;
}

.integrations-govee-status-loading,
.integrations-govee-log-empty {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
}

.integrations-govee-status-error {
    color: #fca5a5;
}

.integrations-govee-badge {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.integrations-govee-badge--warn {
    color: #fde68a;
    background: color-mix(in srgb, #f59e0b 18%, transparent);
}

.integrations-govee-schedule-form {
    display: grid;
    gap: 0.85rem;
}

.integrations-govee-schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.integrations-govee-field {
    display: grid;
    gap: 0.35rem;
}

.integrations-govee-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-govee-field input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.88rem;
}

.integrations-govee-schedule-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.integrations-govee-schedule-preview {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.integrations-govee-log-wrap {
    min-height: 2rem;
}

.integrations-govee-log-scroll {
    overflow-x: auto;
}

.integrations-govee-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.integrations-govee-log-table th,
.integrations-govee-log-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    text-align: left;
    vertical-align: top;
}

.integrations-govee-log-table th {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.integrations-govee-log-table tr.is-skipped td {
    opacity: 0.72;
    font-style: italic;
}

@media (max-width: 900px) {
    .integrations-govee-schedule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .integrations-govee-status-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .integrations-govee-schedule-grid {
        grid-template-columns: 1fr;
    }

    .integrations-govee-head-meta {
        align-items: flex-start;
        width: 100%;
    }

    .integrations-govee-kv-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

/* —— BYD Fahrtenbuch —— */
.byd-wrap {
    max-width: 960px;
}

.byd-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.byd-subnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.18);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.byd-subnav-link:hover,
.byd-subnav-link:focus-visible {
    color: #67e8f9;
    border-color: color-mix(in srgb, #22d3ee 35%, var(--stroke));
    background: color-mix(in srgb, #22d3ee 8%, rgba(0, 0, 0, 0.18));
}

.byd-subnav-link.is-active {
    color: #ecfeff;
    border-color: color-mix(in srgb, #22d3ee 55%, var(--stroke));
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.byd-hero--stats {
    margin-bottom: clamp(1.5rem, 3.5vw, 2rem);
}

.byd-hero-top--stats {
    margin-bottom: 0;
}

.byd-stats-period {
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
    color: #94a3b8;
}

.byd-stats-empty {
    margin: 1.25rem 0 0;
}

.byd-kpi-grid--stats-main {
    margin-top: 1.35rem;
}

.byd-stats-section {
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.byd-stats-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #67e8f9;
}

.byd-stats-section-title--charge {
    color: #bef264;
}

.byd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
    gap: 0.85rem;
}

.byd-stat-card {
    padding: 0.95rem 1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid color-mix(in srgb, #22d3ee 16%, var(--stroke));
    border-left: 3px solid color-mix(in srgb, #22d3ee 55%, transparent);
}

.byd-stat-card--charge {
    border-color: color-mix(in srgb, #a3e635 16%, var(--stroke));
    border-left-color: color-mix(in srgb, #a3e635 65%, transparent);
    background: color-mix(in srgb, #a3e635 4%, var(--card));
}

.byd-stat-card--primary {
    border-color: color-mix(in srgb, #22d3ee 28%, var(--stroke));
    border-left-color: color-mix(in srgb, #22d3ee 70%, transparent);
    background: color-mix(in srgb, #22d3ee 8%, var(--card));
}

.byd-stat-card--primary .byd-stat-value {
    color: #67e8f9;
    font-size: 1.15rem;
}

.byd-stats-hint {
    margin: 0.75rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.byd-stat-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: #e2e8f0;
}

.byd-stats-table-wrap {
    margin-top: 1.25rem;
}

.byd-stats-table-title {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #cbd5e1;
}

.byd-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.byd-stats-table th,
.byd-stats-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--stroke);
}

.byd-stats-table th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-stats-table td:last-child,
.byd-stats-table th:last-child {
    text-align: right;
}

.byd-page-eyebrow {
    margin: 0 0 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.byd-error {
    border-style: solid;
    border-color: color-mix(in srgb, #fb7185 35%, var(--stroke));
    background: color-mix(in srgb, #fb7185 10%, var(--card));
    color: #fecaca;
}

.byd-flash {
    margin: 0 0 1rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    color: #6ee7b7;
    background: color-mix(in srgb, #6ee7b7 12%, var(--card));
    border: 1px solid color-mix(in srgb, #6ee7b7 28%, var(--stroke));
}

.byd-hero {
    margin-bottom: clamp(1.75rem, 4vw, 2.25rem);
    padding: clamp(1.35rem, 3vw, 2rem);
    border-radius: calc(var(--radius) + 4px);
    background: var(--card);
    border: 1px solid color-mix(in srgb, #22d3ee 22%, var(--stroke));
    box-shadow:
        0 20px 50px -28px color-mix(in srgb, #22d3ee 30%, transparent),
        0 0 0 1px color-mix(in srgb, #22d3ee 8%, transparent);
}

.byd-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1.35rem;
}

.byd-hero-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.65rem, 4vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.byd-hero-sub {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.byd-hero-sub code {
    font-size: 0.8rem;
}

.byd-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--stroke);
}

.byd-month-label {
    min-width: 9rem;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 600;
    color: #cbd5e1;
}

.byd-month-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.byd-month-btn svg {
    width: 1.1rem;
    height: 1.1rem;
}

.byd-month-btn:hover,
.byd-month-btn:focus-visible {
    color: #22d3ee;
    background: color-mix(in srgb, #22d3ee 12%, transparent);
}

.byd-month-btn--disabled {
    opacity: 0.25;
    pointer-events: none;
}

.byd-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

@media (max-width: 760px) {
    .byd-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.byd-kpi {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--stroke);
}

.byd-kpi--primary {
    border-color: color-mix(in srgb, #22d3ee 30%, var(--stroke));
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #22d3ee 14%, transparent),
        rgba(0, 0, 0, 0.12)
    );
}

.byd-kpi-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-kpi-value {
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #67e8f9;
}

.byd-kpi-value--sm {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    color: #cbd5e1;
}

.byd-kpi-unit {
    margin-left: 0.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted);
}

.byd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.byd-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #e2e8f0;
}

.byd-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    text-decoration: none;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.byd-export-btn svg {
    width: 1rem;
    height: 1rem;
}

.byd-export-btn:hover,
.byd-export-btn:focus-visible {
    color: #67e8f9;
    border-color: color-mix(in srgb, #22d3ee 35%, var(--stroke));
}

.byd-trip-list {
    display: grid;
    gap: 0.85rem;
}

.byd-trip-card {
    padding: 1rem 1.15rem 1.1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
    border-left: 3px solid color-mix(in srgb, #22d3ee 55%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.byd-trip-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--stroke);
}

.byd-trip-head-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    flex-shrink: 0;
}

.byd-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, #fb7185 28%, var(--stroke));
    border-radius: 10px;
    background: color-mix(in srgb, #fb7185 8%, rgba(0, 0, 0, 0.2));
    color: #fda4af;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.byd-delete-btn svg {
    width: 1rem;
    height: 1rem;
}

.byd-delete-btn:hover,
.byd-delete-btn:focus-visible {
    color: #fecaca;
    border-color: color-mix(in srgb, #fb7185 45%, var(--stroke));
    background: color-mix(in srgb, #fb7185 14%, rgba(0, 0, 0, 0.2));
}

.byd-delete-btn:disabled,
.byd-delete-btn.is-deleting {
    cursor: wait;
    opacity: 0.65;
}

.byd-delete-btn--charge {
    border-color: color-mix(in srgb, #fb7185 22%, var(--stroke));
}

.byd-trip-date {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.byd-trip-time {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.byd-trip-distance {
    text-align: right;
    flex-shrink: 0;
}

.byd-trip-distance-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #67e8f9;
}

.byd-trip-distance-unit {
    margin-left: 0.15rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.byd-trip-body {
    display: grid;
    gap: 0.75rem;
}

.byd-trip-stat-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-trip-stat-value {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.byd-battery-delta {
    color: #fca5a5;
    font-weight: 600;
}

.byd-battery-delta.is-charge {
    color: #6ee7b7;
}

.byd-battery-bar {
    position: relative;
    height: 6px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.byd-battery-fill {
    display: block;
    height: 100%;
    width: var(--end, 50%);
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        color-mix(in srgb, #22d3ee 70%, #6366f1),
        color-mix(in srgb, #67e8f9 80%, #22d3ee)
    );
    opacity: 0.85;
}

.byd-trip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.byd-map-link {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.15);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.byd-map-link:hover,
.byd-map-link:focus-visible {
    color: #67e8f9;
    border-color: color-mix(in srgb, #22d3ee 35%, var(--stroke));
}

.byd-note-form {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--stroke);
}

.byd-note-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-note-row {
    display: flex;
    gap: 0.5rem;
}

.byd-note-input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
}

.byd-note-input:focus {
    outline: none;
    border-color: color-mix(in srgb, #22d3ee 45%, var(--stroke));
    box-shadow: 0 0 0 3px color-mix(in srgb, #22d3ee 15%, transparent);
}

.byd-note-save {
    flex-shrink: 0;
    padding: 0.55rem 0.85rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #ecfeff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.byd-note-save:hover,
.byd-note-save:focus-visible {
    filter: brightness(1.08);
}

.byd-note-save.is-saving,
.byd-note-save:disabled {
    cursor: wait;
    opacity: 0.72;
}

.byd-note-status {
    display: block;
    min-height: 1.1rem;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.byd-note-status.is-ok {
    color: #6ee7b7;
}

.byd-note-status.is-error {
    color: #fca5a5;
}

.byd-note-suggestions {
    margin-top: 0.55rem;
}

.byd-note-suggestions-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-note-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.byd-note-suggestion {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #22d3ee 24%, var(--stroke));
    background: color-mix(in srgb, #22d3ee 8%, rgba(0, 0, 0, 0.18));
    color: #a5f3fc;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.byd-note-suggestion:hover,
.byd-note-suggestion:focus-visible {
    color: #ecfeff;
    border-color: color-mix(in srgb, #22d3ee 45%, var(--stroke));
    background: color-mix(in srgb, #22d3ee 16%, rgba(0, 0, 0, 0.18));
}

.byd-note-suggestion.is-active {
    color: #ecfeff;
    border-color: color-mix(in srgb, #22d3ee 60%, var(--stroke));
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

.byd-note-suggestion.is-saving,
.byd-note-suggestion:disabled {
    cursor: wait;
    opacity: 0.7;
}

.byd-note-suggestion--charge {
    border-color: color-mix(in srgb, #a3e635 24%, var(--stroke));
    background: color-mix(in srgb, #a3e635 8%, rgba(0, 0, 0, 0.18));
    color: #d9f99d;
}

.byd-note-suggestion--charge:hover,
.byd-note-suggestion--charge:focus-visible {
    color: #ecfccb;
    border-color: color-mix(in srgb, #a3e635 45%, var(--stroke));
    background: color-mix(in srgb, #a3e635 16%, rgba(0, 0, 0, 0.18));
}

.byd-note-suggestion--charge.is-active {
    color: #1a2e05;
    border-color: color-mix(in srgb, #a3e635 70%, var(--stroke));
    background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
}

.byd-suggestions-admin {
    margin-bottom: clamp(1.5rem, 3.5vw, 2rem);
}

.byd-suggestion-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.byd-suggestion-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 14rem;
    min-width: 0;
}

.byd-suggestion-field--type {
    flex: 0 1 11rem;
}

.byd-suggestion-field-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.byd-suggestion-select {
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text);
    font: inherit;
    font-size: 0.88rem;
}

.byd-suggestion-form-status {
    min-height: 1.1rem;
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.byd-suggestion-form-status.is-ok {
    color: #6ee7b7;
}

.byd-suggestion-form-status.is-error {
    color: #fca5a5;
}

.byd-suggestion-admin-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.byd-suggestion-admin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.byd-suggestion-admin-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    min-width: 0;
}

.byd-suggestion-admin-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}

.byd-suggestion-admin-type {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--stroke);
}

.byd-suggestion-admin-delete {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, #fb7185 28%, var(--stroke));
    background: color-mix(in srgb, #fb7185 8%, rgba(0, 0, 0, 0.2));
    color: #fda4af;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.byd-suggestion-admin-delete:hover,
.byd-suggestion-admin-delete:focus-visible {
    color: #fecaca;
    border-color: color-mix(in srgb, #fb7185 45%, var(--stroke));
}

.byd-kpi-grid--overview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.byd-kpi--charge {
    border-color: color-mix(in srgb, #a3e635 28%, var(--stroke));
    background: linear-gradient(
        145deg,
        color-mix(in srgb, #a3e635 12%, transparent),
        rgba(0, 0, 0, 0.12)
    );
}

.byd-kpi--charge .byd-kpi-value {
    color: #bef264;
}

.byd-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
    padding: 0.35rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--stroke);
}

.byd-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.byd-tab:hover,
.byd-tab:focus-visible {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
}

.byd-tab.is-active {
    color: #ecfeff;
    background: linear-gradient(135deg, color-mix(in srgb, #0891b2 55%, #0e7490) 0%, #0e7490 100%);
    box-shadow: 0 8px 24px -12px color-mix(in srgb, #22d3ee 45%, transparent);
}

.byd-tab-count {
    min-width: 1.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.22);
}

.byd-trip-list--timeline {
    margin-top: 0.25rem;
}

.byd-trip-list--timeline .byd-trip-card:not(.byd-trip-card--charge) {
    background: color-mix(in srgb, #22d3ee 4%, var(--card));
}

.byd-tab.is-active .byd-tab-count {
    background: rgba(255, 255, 255, 0.16);
}

.byd-trip-card--charge {
    border-color: color-mix(in srgb, #a3e635 18%, var(--stroke));
    border-left-color: color-mix(in srgb, #a3e635 65%, transparent);
    background: color-mix(in srgb, #a3e635 4%, var(--card));
}

.byd-trip-distance--charge .byd-trip-distance-value {
    color: #bef264;
}

.byd-trip-distance-value--sm {
    font-size: 1.1rem;
}

.byd-charge-state {
    display: inline-flex;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #d9f99d;
    background: color-mix(in srgb, #a3e635 12%, transparent);
    border: 1px solid color-mix(in srgb, #a3e635 28%, var(--stroke));
}

.byd-battery-delta.is-gain {
    color: #bef264;
}

.byd-battery-bar--charge {
    background: rgba(255, 255, 255, 0.06);
}

.byd-battery-fill--charge {
    background: linear-gradient(
        90deg,
        color-mix(in srgb, #84cc16 70%, #a3e635),
        color-mix(in srgb, #bef264 80%, #84cc16)
    );
}

.byd-note-save--charge {
    background: linear-gradient(135deg, #65a30d 0%, #4d7c0f 100%);
}

@media (max-width: 760px) {
    .byd-kpi-grid--overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* —— Geplant (Roadmap) —— */
.planned-wrap {
    max-width: 960px;
}

.planned-hero {
    margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: calc(var(--radius) + 6px);
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, color-mix(in srgb, #c4b5fd 14%, transparent), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, color-mix(in srgb, #94d2bd 10%, transparent), transparent 50%),
        var(--card);
    border: 1px solid color-mix(in srgb, #c4b5fd 18%, var(--stroke));
    box-shadow: 0 20px 50px -30px color-mix(in srgb, #c4b5fd 30%, transparent);
    text-align: center;
}

.planned-eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #c4b5fd;
}

.planned-title {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f8fafc 0%, #c4b5fd 50%, #94d2bd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.planned-lead {
    margin: 0 auto;
    max-width: 36em;
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

.planned-count {
    margin: 1rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.planned-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 1rem 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.planned-stat-sep {
    opacity: 0.45;
}

.planned-flash {
    margin: 0 0 1rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: #86efac;
    background: color-mix(in srgb, #22c55e 12%, transparent);
    border: 1px solid color-mix(in srgb, #22c55e 28%, var(--stroke));
}

.planned-error {
    margin-top: 1rem;
}

.planned-section {
    margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.planned-section--done {
    padding-top: 0.5rem;
}

.planned-section-title {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #e2e8f0;
}

.planned-section-desc {
    margin: -0.35rem 0 1rem;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--muted);
}

.planned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
}

.planned-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.25rem 1.3rem 1.15rem;
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--stroke));
    overflow: hidden;
}

.planned-card--done {
    border-style: solid;
    opacity: 0.92;
    background: color-mix(in srgb, var(--card) 92%, #22c55e 8%);
}

.planned-card-glow {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--accent) 75%, white),
        transparent
    );
    opacity: 0.7;
}

.planned-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.planned-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 14px;
    color: color-mix(in srgb, var(--accent) 80%, white);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--stroke));
}

.planned-card-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.planned-badge {
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 85%, white);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--stroke));
}

.planned-phase {
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--stroke);
}

.planned-phase--planung {
    color: #c4b5fd;
    background: color-mix(in srgb, #c4b5fd 12%, transparent);
    border-color: color-mix(in srgb, #c4b5fd 28%, var(--stroke));
}

.planned-phase--entwicklung {
    color: #7c9cff;
    background: color-mix(in srgb, #7c9cff 12%, transparent);
    border-color: color-mix(in srgb, #7c9cff 28%, var(--stroke));
}

.planned-phase--test {
    color: #fbbf77;
    background: color-mix(in srgb, #fbbf77 12%, transparent);
    border-color: color-mix(in srgb, #fbbf77 28%, var(--stroke));
}

.planned-phase--fertig {
    color: #86efac;
    background: color-mix(in srgb, #22c55e 12%, transparent);
    border-color: color-mix(in srgb, #22c55e 28%, var(--stroke));
}

.planned-card-body {
    flex: 1;
}

.planned-card-tagline {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--accent) 70%, white);
}

.planned-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.planned-card-desc {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.55;
    color: var(--muted);
}

.planned-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.planned-tags li {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--stroke);
}

.planned-phase-form {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--stroke);
}

.planned-phase-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.planned-phase-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.planned-phase-select {
    flex: 1 1 8rem;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border-radius: calc(var(--radius) - 2px);
    font: inherit;
    font-size: 0.85rem;
    color: #e2e8f0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--stroke);
}

.planned-phase-save {
    padding: 0.45rem 0.85rem;
    border-radius: calc(var(--radius) - 2px);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    background: #94d2bd;
    border: 1px solid color-mix(in srgb, #94d2bd 70%, white);
    cursor: pointer;
}

.planned-phase-save:hover {
    filter: brightness(1.05);
}

/* —— Finanzen —— */
.finance-wrap {
    max-width: none;
    padding-top: clamp(0.85rem, 2vw, 1.15rem);
}

body:has(.finance-wrap) .header-toolbar-inner {
    max-width: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.finance-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.5rem;
    padding: clamp(0.85rem, 2.5vw, 1.15rem) clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.finance-header--unlocked {
    border-color: color-mix(in srgb, #6aa84f 28%, var(--stroke));
    background:
        linear-gradient(135deg, color-mix(in srgb, #6aa84f 5%, var(--card)), var(--card));
}

.finance-header-titles {
    min-width: 0;
}

.finance-header-root {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #6aa84f;
}

.finance-header-page {
    margin: 0.15rem 0 0;
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text);
}

.finance-header-pin {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    flex-shrink: 0;
    margin-left: auto;
}

.finance-header-pin-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: calc(var(--radius) + 4px);
    border: 2px solid color-mix(in srgb, var(--stroke) 70%, #7c9cff 30%);
    background:
        linear-gradient(
            155deg,
            color-mix(in srgb, var(--bg1) 55%, var(--card)),
            color-mix(in srgb, var(--card) 75%, #7c9cff 25%)
        );
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, white 8%, transparent),
        0 8px 28px color-mix(in srgb, black 35%, transparent);
}

.finance-header-pin-panel--locked {
    border-color: color-mix(in srgb, #fbbf24 62%, #7c9cff 38%);
    background:
        linear-gradient(
            155deg,
            color-mix(in srgb, #fbbf24 16%, var(--bg1)),
            color-mix(in srgb, var(--card) 70%, #7c9cff 30%)
        );
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, #fbbf24 22%, transparent),
        0 0 0 1px color-mix(in srgb, #fbbf24 18%, transparent),
        0 10px 36px color-mix(in srgb, #fbbf24 22%, transparent),
        0 8px 32px color-mix(in srgb, black 38%, transparent);
    animation: finance-pin-panel-glow 2.8s ease-in-out infinite;
}

@keyframes finance-pin-panel-glow {
    0%,
    100% {
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, #fbbf24 22%, transparent),
            0 0 0 1px color-mix(in srgb, #fbbf24 18%, transparent),
            0 10px 36px color-mix(in srgb, #fbbf24 18%, transparent),
            0 8px 32px color-mix(in srgb, black 38%, transparent);
    }

    50% {
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, #fbbf24 35%, transparent),
            0 0 0 2px color-mix(in srgb, #fbbf24 28%, transparent),
            0 12px 42px color-mix(in srgb, #fbbf24 32%, transparent),
            0 8px 32px color-mix(in srgb, black 38%, transparent);
    }
}

.finance-header-pin-panel--unlocked {
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    background:
        linear-gradient(
            155deg,
            color-mix(in srgb, #6aa84f 18%, var(--card)),
            color-mix(in srgb, var(--card) 88%, transparent)
        );
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, #6aa84f 25%, transparent),
        0 0 0 1px color-mix(in srgb, #6aa84f 20%, transparent),
        0 10px 32px color-mix(in srgb, #6aa84f 20%, transparent);
}

.finance-header-pin-panel-label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text) 65%, var(--muted));
    line-height: 1;
    white-space: nowrap;
}

.finance-header-pin-panel--locked .finance-header-pin-panel-label {
    color: #fde68a;
    text-shadow: 0 0 20px color-mix(in srgb, #fbbf24 45%, transparent);
}

.finance-header-pin-panel--unlocked .finance-header-pin-panel-label {
    color: color-mix(in srgb, #6aa84f 85%, var(--text));
}

.finance-header-pin-error {
    margin: 0;
    padding: 0.45rem 0.65rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.85rem;
    line-height: 1.35;
    color: #fecaca;
    background: color-mix(in srgb, #fb7185 12%, transparent);
    border: 1px solid color-mix(in srgb, #fb7185 35%, transparent);
    text-align: right;
}

.finance-header-pin-muted {
    font-size: 0.88rem;
    color: var(--muted);
}

.finance-pin-mini {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
}

.finance-pin-mini--static {
    flex-wrap: nowrap;
}

.finance-pin-mini-input {
    width: 7.25rem;
    min-height: 3.15rem;
    padding: 0.65rem 0.75rem;
    border-radius: calc(var(--radius));
    border: 2px solid color-mix(in srgb, #fbbf24 45%, #7c9cff 55%);
    background: color-mix(in srgb, var(--bg1) 35%, #0f172a);
    color: #f8fafc;
    font: inherit;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-align: center;
    box-shadow:
        inset 0 2px 6px color-mix(in srgb, black 35%, transparent),
        0 0 0 1px color-mix(in srgb, #fbbf24 12%, transparent);
}

.finance-header-pin-panel--locked .finance-pin-mini-input {
    border-color: color-mix(in srgb, #fbbf24 70%, white 30%);
}

.finance-pin-mini-input::placeholder {
    letter-spacing: 0.12em;
    font-weight: 600;
    font-size: 1.15rem;
    color: color-mix(in srgb, #fde68a 45%, transparent);
}

.finance-pin-mini-input:focus {
    outline: none;
    border-color: #fde68a;
    background: color-mix(in srgb, var(--bg1) 25%, #0f172a);
    box-shadow:
        inset 0 2px 6px color-mix(in srgb, black 28%, transparent),
        0 0 0 4px color-mix(in srgb, #fbbf24 35%, transparent),
        0 0 24px color-mix(in srgb, #fbbf24 28%, transparent);
}

.finance-pin-mini-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.15rem;
    height: auto;
    min-height: 3.15rem;
    padding: 0 0.9rem;
    border-radius: calc(var(--radius));
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #0f172a;
    background: linear-gradient(180deg, #fde68a, #fbbf24 55%, #f59e0b);
    border: 2px solid color-mix(in srgb, #fde68a 70%, white);
    cursor: pointer;
    box-shadow:
        0 4px 14px color-mix(in srgb, #fbbf24 45%, transparent),
        inset 0 1px 0 color-mix(in srgb, white 35%, transparent);
}

.finance-pin-mini-btn--submit {
    min-width: 3.65rem;
    text-transform: uppercase;
}

.finance-pin-mini-btn:hover,
.finance-pin-mini-btn:focus-visible {
    filter: brightness(1.06);
}

.finance-pin-mini-btn--ghost {
    min-width: auto;
    min-height: 2.85rem;
    height: auto;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    border: 2px solid var(--stroke);
    box-shadow: none;
}

.finance-pin-mini-btn--ghost:hover,
.finance-pin-mini-btn--ghost:focus-visible {
    color: var(--text);
    filter: none;
    background: color-mix(in srgb, #6aa84f 8%, transparent);
    border-color: color-mix(in srgb, #6aa84f 45%, var(--stroke));
}

@media (prefers-reduced-motion: reduce) {
    .finance-header-pin-panel--locked {
        animation: none;
    }
}

.finance-hero {
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border-radius: calc(var(--radius) + 6px);
    background:
        radial-gradient(ellipse 80% 60% at 0% 0%, color-mix(in srgb, #6aa84f 14%, transparent), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 100%, color-mix(in srgb, #94d2bd 10%, transparent), transparent 50%),
        var(--card);
    border: 1px solid color-mix(in srgb, #6aa84f 18%, var(--stroke));
    box-shadow: 0 20px 50px -30px color-mix(in srgb, #6aa84f 28%, transparent);
    text-align: center;
}

.finance-eyebrow {
    margin: 0 0 0.65rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6aa84f;
}

.finance-title {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #f8fafc 0%, #6aa84f 45%, #94d2bd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.finance-lead {
    margin: 0 auto;
    max-width: 36em;
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted);
}

.finance-status-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.1rem;
}

.finance-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 80%, transparent);
    color: var(--muted);
}

.finance-status-badge--mode {
    color: #6aa84f;
    border-color: color-mix(in srgb, #6aa84f 35%, var(--stroke));
}

.finance-status-badge--warn {
    color: #fbbf77;
    border-color: color-mix(in srgb, #fbbf77 35%, var(--stroke));
}

.finance-pin-banner {
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.finance-pin-banner--locked {
    border-color: color-mix(in srgb, #fbbf77 28%, var(--stroke));
    background:
        linear-gradient(135deg, color-mix(in srgb, #fbbf77 6%, var(--card)), var(--card));
}

.finance-pin-banner--unlocked {
    border-color: color-mix(in srgb, #6aa84f 28%, var(--stroke));
    background:
        linear-gradient(135deg, color-mix(in srgb, #6aa84f 6%, var(--card)), var(--card));
}

.finance-pin-banner-inner {
    display: grid;
    gap: 1rem;
}

@media (min-width: 720px) {
    .finance-pin-banner-inner {
        grid-template-columns: 1fr auto;
        align-items: center;
    }
}

.finance-pin-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-pin-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.finance-pin-lead {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.finance-pin-lead code {
    font-size: 0.85em;
}

.finance-pin-error {
    margin: 0;
    grid-column: 1 / -1;
    padding: 0.65rem 0.85rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.9rem;
    color: #fecaca;
    background: color-mix(in srgb, #fb7185 12%, transparent);
    border: 1px solid color-mix(in srgb, #fb7185 35%, transparent);
}

.finance-pin-form {
    min-width: min(100%, 16rem);
}

.finance-pin-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-pin-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.finance-pin-input {
    width: 5.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg) 60%, var(--card));
    color: var(--text);
    font: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-align: center;
}

.finance-pin-input:focus {
    outline: none;
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    box-shadow: 0 0 0 3px color-mix(in srgb, #6aa84f 18%, transparent);
}

.finance-pin-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.finance-pin-btn {
    padding: 0.55rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    background: #6aa84f;
    border: 1px solid color-mix(in srgb, #6aa84f 70%, white);
    cursor: pointer;
    white-space: nowrap;
}

.finance-pin-btn:hover,
.finance-pin-btn:focus-visible {
    filter: brightness(1.06);
}

.finance-pin-btn--secondary {
    color: var(--text);
    background: transparent;
    border-color: var(--stroke);
}

.finance-section-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.finance-placeholder {
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.finance-error {
    border: 1px solid color-mix(in srgb, #fb7185 35%, var(--stroke));
}

.finance-view-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.finance-view-toolbar-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.finance-view-toolbar .finance-section-title {
    margin: 0 0 0.25rem;
}

.finance-view-toolbar-hint {
    margin: 0;
}

.finance-view-card .finance-table-scroll {
    margin-top: 0.25rem;
}

.finance-data-table--view .finance-accounts-meta,
.finance-data-table--view .finance-bundesschatz-meta {
    font-variant-numeric: tabular-nums;
}

.finance-data-table--view tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--stroke) 12%, transparent);
}

.finance-data-table--view .finance-accounts-col-period,
.finance-data-table--view .finance-bundesschatz-col-period {
    font-weight: 600;
}

.finance-data-table--view .finance-accounts-col-subtotal,
.finance-data-table--view .finance-bundesschatz-computed {
    font-weight: 600;
}

.finance-view-toolbar .finance-pin-btn {
    flex: 0 0 auto;
    align-self: center;
    text-decoration: none;
    text-align: center;
}

.finance-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.85rem;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.finance-kpi-card {
    padding: 1rem 1.1rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.finance-kpi-label {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-kpi-value {
    margin: 0;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 600;
    color: #6aa84f;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.finance-kpi-value--positive {
    color: #6aa84f;
}

.finance-kpi-value--negative {
    color: #fb7185;
}

.finance-kpi-value--neutral {
    color: var(--text);
}

.finance-kpi-card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.finance-kpi-card--link:hover,
.finance-kpi-card--link:focus-visible {
    border-color: color-mix(in srgb, #6aa84f 45%, var(--stroke));
    box-shadow: 0 0 0 1px color-mix(in srgb, #6aa84f 20%, transparent);
    transform: translateY(-1px);
}

.finance-kpi-link-hint {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.finance-kpi-card--link:hover .finance-kpi-link-hint,
.finance-kpi-card--link:focus-visible .finance-kpi-link-hint {
    color: #6aa84f;
}

.finance-kpi-grid--compact {
    margin-bottom: 1rem;
}

.finance-mode-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 88%, var(--bg));
}

.finance-mode-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.95rem;
    border-radius: calc(var(--radius) + 2px);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.finance-mode-tab:hover,
.finance-mode-tab:focus-visible {
    color: var(--text);
    background: color-mix(in srgb, var(--stroke) 35%, transparent);
}

.finance-mode-tab.is-active {
    color: var(--text);
    background: var(--card);
    box-shadow: 0 1px 2px color-mix(in srgb, #000 12%, transparent);
}

.finance-wealth-detail-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.finance-wealth-detail-title {
    margin: 0 0 0.25rem;
}

.finance-wealth-detail-hint {
    margin: 0;
    max-width: 42rem;
}

.finance-wealth-months {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.finance-wealth-month {
    border: 1px solid var(--stroke);
    border-radius: calc(var(--radius) + 2px);
    background: var(--card);
    overflow: hidden;
}

.finance-wealth-month-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
}

.finance-wealth-month-summary::-webkit-details-marker {
    display: none;
}

.finance-wealth-month-summary::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    margin-left: auto;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.finance-wealth-month[open] .finance-wealth-month-summary::after {
    transform: rotate(-135deg) translate(-1px, -1px);
}

.finance-wealth-month-period {
    flex: 0 0 auto;
    min-width: 5rem;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.finance-wealth-month-total {
    flex: 1 1 auto;
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    color: #6aa84f;
    font-variant-numeric: tabular-nums;
}

.finance-wealth-month-change {
    flex: 0 0 auto;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-wealth-month-change--positive {
    color: #6aa84f;
}

.finance-wealth-month-change--negative {
    color: #fb7185;
}

.finance-wealth-month-change--muted {
    color: var(--muted);
    font-weight: 500;
}

.finance-wealth-month-body {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
}

.finance-wealth-month-note {
    margin: 0.95rem 0 1.1rem;
    padding: 0.75rem 0.9rem;
    border-radius: calc(var(--radius) + 1px);
    border: 1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
    background: color-mix(in srgb, var(--card) 92%, var(--bg));
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text);
}

.finance-wealth-month-note-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-wealth-group + .finance-wealth-group {
    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px dashed color-mix(in srgb, var(--stroke) 80%, transparent);
}

.finance-wealth-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.finance-wealth-group-title {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-wealth-group-subtotal {
    font-size: 0.92rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.finance-wealth-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.finance-wealth-row {
    display: grid;
    grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr) minmax(5.5rem, auto) 3.5rem;
    align-items: center;
    gap: 0.65rem 0.75rem;
    font-size: 0.92rem;
}

.finance-wealth-row-label {
    color: var(--text);
}

.finance-wealth-row-bar-wrap {
    position: relative;
    height: 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--stroke) 55%, transparent);
    overflow: hidden;
}

.finance-wealth-row-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: color-mix(in srgb, #6aa84f 75%, var(--card));
}

.finance-wealth-row-bar--liquid {
    background: color-mix(in srgb, #60a5fa 75%, var(--card));
}

.finance-wealth-row-bar--pension {
    background: color-mix(in srgb, #a78bfa 75%, var(--card));
}

.finance-wealth-row-bar--investments {
    background: color-mix(in srgb, #6aa84f 75%, var(--card));
}

.finance-wealth-row-amount {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.finance-wealth-row-pct {
    text-align: right;
    font-size: 0.82rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.finance-wealth-row--liability .finance-wealth-row-amount {
    color: #fb7185;
}

.finance-wealth-month-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.1rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--stroke);
}

.finance-wealth-month-footer-label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-wealth-month-footer-total {
    font-size: 1.15rem;
    font-weight: 700;
    color: #6aa84f;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .finance-wealth-month-summary {
        flex-wrap: wrap;
    }

    .finance-wealth-month-total {
        flex-basis: calc(100% - 6rem);
    }

    .finance-wealth-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
    }

    .finance-wealth-row-bar-wrap {
        grid-column: 1 / -1;
    }

    .finance-wealth-row-pct {
        font-size: 0.78rem;
    }
}

.finance-chart-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

@media (min-width: 900px) {
    .finance-chart-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    }
}

@media (min-width: 960px) {
    .finance-chart-grid--wealth {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .finance-chart-grid--wealth .finance-chart-card--wide {
        grid-column: 1 / -1;
    }
}

.finance-chart-card {
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.finance-kpi-grid + .finance-chart-card,
.finance-lent-hero + .finance-chart-card {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.finance-chart-hint {
    margin: -0.35rem 0 0.85rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.finance-chart-wrap {
    position: relative;
    width: 100%;
}

.finance-chart-wrap--doughnut {
    height: 280px;
}

.finance-chart-wrap--line {
    height: 320px;
}

.finance-chart-wrap--stacked {
    height: 360px;
}

.finance-chart-wrap--stacked-wide {
    height: 380px;
}

.finance-chart-wrap--line-wide {
    height: 340px;
}

.finance-chart-wrap--bar {
    height: 320px;
}

.finance-chart-card--wide {
    grid-column: 1 / -1;
}

@media (min-width: 900px) {
    .finance-chart-grid--stacked {
        grid-template-columns: 1fr;
    }
}

.finance-table-card {
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    margin-bottom: 1rem;
}

.finance-table-scroll {
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.finance-data-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.finance-data-table th,
.finance-data-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--stroke);
    text-align: right;
    white-space: nowrap;
}

.finance-data-table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--card) 88%, transparent);
}

.finance-data-table tbody th,
.finance-data-table tfoot th {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 1;
}

.finance-data-table td {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.finance-data-table-total {
    font-weight: 600;
    color: var(--text) !important;
}

.finance-data-table-amount--expense {
    color: color-mix(in srgb, var(--text) 75%, #fb7185 25%) !important;
}

.finance-table-amount--expense {
    color: color-mix(in srgb, var(--text) 75%, #fb7185 25%) !important;
}

.finance-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 1rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.finance-breadcrumb-link {
    color: #6aa84f;
    text-decoration: none;
}

.finance-breadcrumb-link:hover,
.finance-breadcrumb-link:focus-visible {
    text-decoration: underline;
}

.finance-breadcrumb-sep {
    opacity: 0.65;
}

.finance-breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.finance-month-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in srgb, #6aa84f 55%, transparent);
}

.finance-month-link:hover,
.finance-month-link:focus-visible {
    color: #6aa84f;
    border-bottom-color: currentColor;
}

.finance-data-table--expense-detail {
    min-width: 72rem;
}

.finance-data-table--expense-detail .finance-expense-detail-col-desc,
.finance-data-table--expense-detail .finance-expense-detail-desc {
    text-align: left;
    white-space: normal;
    min-width: 18rem;
    max-width: 36rem;
}

.finance-expense-detail-desc-mask {
    color: var(--muted);
    font-style: italic;
}

.finance-import-status--error {
    color: #fb7185;
}

.finance-modal-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
    font-weight: 400;
}

.finance-expense-elba-toolbar {
    margin-bottom: 0.85rem;
}

.finance-expense-elba-table-wrap {
    max-height: min(52vh, 34rem);
    overflow: auto;
    margin-bottom: 0.85rem;
    border: 1px solid var(--stroke);
    border-radius: calc(var(--radius) - 2px);
}

.finance-data-table--elba-assign {
    min-width: 72rem;
}

.finance-data-table--elba-assign .finance-expense-elba-desc {
    text-align: left;
    white-space: normal;
    min-width: 16rem;
    max-width: 28rem;
}

.finance-data-table--elba-assign .finance-expense-elba-category-cell {
    text-align: left;
    white-space: normal;
    vertical-align: top;
    min-width: 22rem;
    max-width: 34rem;
}

.finance-expense-elba-category-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.finance-expense-elba-category-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--stroke) 92%, var(--text) 8%);
    border-radius: calc(var(--radius) - 3px);
    background: color-mix(in srgb, var(--card) 88%, var(--bg0));
    box-shadow:
        0 1px 0 color-mix(in srgb, white 8%, transparent),
        0 1px 2px color-mix(in srgb, black 14%, transparent);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.finance-expense-elba-category-btn:hover,
.finance-expense-elba-category-btn:focus-visible {
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    background: color-mix(in srgb, #6aa84f 12%, var(--card));
    box-shadow:
        0 1px 0 color-mix(in srgb, white 10%, transparent),
        0 2px 4px color-mix(in srgb, #6aa84f 16%, transparent);
    outline: none;
    transform: translateY(-1px);
}

.finance-expense-elba-category-btn.is-active {
    border-color: color-mix(in srgb, #6aa84f 72%, var(--stroke));
    background: color-mix(in srgb, #6aa84f 24%, var(--card));
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, #6aa84f 22%, transparent),
        0 1px 2px color-mix(in srgb, #6aa84f 20%, transparent);
    color: var(--text);
}

.finance-expense-elba-remove {
    padding: 0.25rem 0.55rem;
    border: 1px solid color-mix(in srgb, #fb7185 35%, var(--stroke));
    border-radius: calc(var(--radius) - 4px);
    background: transparent;
    color: color-mix(in srgb, var(--text) 70%, #fb7185 30%);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.finance-expense-elba-remove:hover,
.finance-expense-elba-remove:focus-visible {
    background: color-mix(in srgb, #fb7185 8%, transparent);
}

.finance-data-table tfoot td {
    color: var(--muted);
    font-weight: 500;
}

.finance-chart-wrap--horizontal {
    height: 420px;
}

.finance-fixkosten-hint-locked {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid color-mix(in srgb, #fbbf77 28%, var(--stroke));
    background: color-mix(in srgb, #fbbf77 6%, var(--card));
    color: var(--muted);
}

.finance-depot-isin {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--muted);
}

.finance-data-table--depot th[scope="row"] {
    min-width: 10rem;
    max-width: 16rem;
    white-space: normal;
}

.finance-data-table--depot-positions thead th.finance-depot-col-name {
    text-align: left;
}

.finance-data-table--depot-positions .finance-depot-meta {
    color: color-mix(in srgb, var(--text) 68%, var(--muted));
    font-variant-numeric: tabular-nums;
}

.finance-data-table--depot-positions .finance-depot-meta--type {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.finance-data-table--depot-positions .finance-depot-meta--months {
    font-size: 0.84rem;
}

.finance-data-table--depot-positions .finance-depot-meta--value {
    font-weight: 500;
    color: color-mix(in srgb, var(--text) 82%, #94d2bd 18%);
}

.finance-depot-value-cell {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.55rem;
    max-width: 100%;
}

.finance-depot-value-main {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-depot-value-real {
    font-size: 0.78rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

.finance-depot-gain-pct {
    font-size: 0.78rem;
    font-weight: 600;
}

.finance-depot-type-header th {
    padding: 0.65rem 0.55rem 0.45rem;
    border-bottom: 1px solid var(--stroke);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--text);
    background: color-mix(in srgb, var(--card) 90%, transparent);
    position: static;
    z-index: auto;
}

.finance-depot-type-header--spaced th {
    border-top: 0.35rem solid color-mix(in srgb, var(--stroke) 55%, transparent);
    padding-top: 1rem;
}

.finance-depot-type-header--etf th {
    border-left: 3px solid #60a5fa;
    background: color-mix(in srgb, #60a5fa 7%, var(--card));
}

.finance-depot-type-header--stock th {
    border-left: 3px solid #6aa84f;
    background: color-mix(in srgb, #6aa84f 7%, var(--card));
}

.finance-depot-type-header--fund th {
    border-left: 3px solid #fbbf77;
    background: color-mix(in srgb, #fbbf77 8%, var(--card));
}

.finance-depot-type-header--ledger th {
    border-left: 3px solid #94a3b8;
    background: color-mix(in srgb, #94a3b8 10%, var(--card));
}

.finance-depot-type-header--coinbase th {
    border-left: 3px solid #60a5fa;
    background: color-mix(in srgb, #60a5fa 10%, var(--card));
}

.finance-data-table--depot-positions .finance-depot-type-header:hover th {
    background: inherit;
}

.finance-data-table--depot-positions .finance-depot-position-row--sold .finance-depot-meta {
    color: color-mix(in srgb, var(--muted) 88%, transparent);
}

.finance-depot-hint-locked {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.finance-data-table--depot-positions .finance-depot-position-row {
    cursor: pointer;
}

.finance-data-table--depot-positions .finance-depot-position-row:hover th,
.finance-data-table--depot-positions .finance-depot-position-row:hover td,
.finance-data-table--depot-positions .finance-depot-position-row:focus-visible th,
.finance-data-table--depot-positions .finance-depot-position-row:focus-visible td {
    background: color-mix(in srgb, var(--surface-2) 88%, #6aa84f 12%);
}

.finance-depot-open-hint {
    color: var(--muted) !important;
    font-size: 0.82rem;
    white-space: nowrap;
}

.finance-depot-empty-row {
    text-align: center;
    color: var(--muted) !important;
    padding: 1.25rem !important;
}

.finance-modal--wide .finance-modal-dialog--wide {
    width: min(99vw, 112rem);
    max-height: 96vh;
    overflow: auto;
}

.finance-depot-modal-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.finance-depot-holdings-toolbar {
    padding: 0 1.25rem 0.75rem;
}

.finance-depot-holdings-form .finance-depot-holdings-scroll {
    margin-inline: 1.25rem;
}

.finance-depot-holdings-add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.finance-depot-period-input {
    width: 7rem;
    max-width: 100%;
}

.finance-depot-month-picker {
    width: auto;
    min-width: 11rem;
    max-width: 100%;
    color-scheme: dark;
}

.finance-crypto-notes-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 1.25rem 0.75rem;
}

.finance-crypto-notes-input {
    min-height: 3.5rem;
    resize: vertical;
}

.finance-crypto-notes-cell {
    max-width: 14rem;
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finance-depot-sold-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0 1.25rem 0.85rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid color-mix(in srgb, #fbbf24 22%, var(--stroke));
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in srgb, #fbbf24 6%, transparent);
}

.finance-depot-sold-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
}

.finance-depot-sold-period-picker:disabled {
    opacity: 0.55;
}

.finance-depot-status {
    display: inline-block;
    font-size: 0.82rem;
    white-space: nowrap;
}

.finance-depot-status--active {
    color: #6aa84f;
}

.finance-depot-status--sold {
    color: var(--muted);
}

.finance-depot-position-row--sold th,
.finance-depot-position-row--sold td {
    opacity: 0.82;
}

.finance-depot-holdings-scroll {
    max-height: min(40rem, calc(95vh - 14rem));
    margin-bottom: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
    border-radius: calc(var(--radius) - 2px);
    background: color-mix(in srgb, var(--bg0) 40%, transparent);
}

.finance-data-table--depot-edit {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.finance-data-table--depot-edit thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg1);
    box-shadow: 0 1px 0 color-mix(in srgb, var(--stroke) 100%, transparent);
}

.finance-data-table--depot-edit thead th {
    background-color: var(--bg1);
}

.finance-depot-group-header th {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.45rem 0.35rem;
    border-bottom: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg1) 82%, #1a1f2b);
}

.finance-depot-col-header th {
    text-align: center;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.35rem 0.3rem;
    border-bottom: 1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
    background: var(--bg1);
}

.finance-data-table--depot-edit thead .finance-depot-group--period {
    background: color-mix(in srgb, var(--stroke) 12%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--stand,
.finance-data-table--depot-edit thead .finance-depot-col-stand {
    background: color-mix(in srgb, #60a5fa 10%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--delta,
.finance-data-table--depot-edit thead .finance-depot-col-delta {
    background: color-mix(in srgb, #a78bfa 10%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--sold,
.finance-data-table--depot-edit thead .finance-depot-col-sold {
    background: color-mix(in srgb, #fbbf24 11%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--cumulative,
.finance-data-table--depot-edit thead .finance-depot-col-cumulative {
    background: color-mix(in srgb, var(--stroke) 10%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--result,
.finance-data-table--depot-edit thead .finance-depot-col-result {
    background: color-mix(in srgb, #6aa84f 11%, var(--bg1)) !important;
}

.finance-data-table--depot-edit thead .finance-depot-group--action,
.finance-data-table--depot-edit thead .finance-depot-col-action {
    background: var(--bg1) !important;
}

.finance-data-table--depot-edit tbody tr:nth-child(even) td,
.finance-data-table--depot-edit tbody tr:nth-child(even) th.finance-depot-col-period {
    background: color-mix(in srgb, var(--surface) 35%, transparent);
}

.finance-data-table--depot-edit tbody tr:hover td,
.finance-data-table--depot-edit tbody tr:hover th.finance-depot-col-period {
    background: color-mix(in srgb, #6aa84f 6%, var(--surface));
}

.finance-data-table--depot-edit th,
.finance-data-table--depot-edit td {
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
    padding: 0.3rem 0.25rem;
}

.finance-depot-group--period,
.finance-depot-col-period {
    background: color-mix(in srgb, var(--stroke) 8%, transparent) !important;
    border-right: 1px solid color-mix(in srgb, var(--stroke) 45%, transparent);
}

.finance-depot-group--stand,
.finance-depot-col-stand {
    background: color-mix(in srgb, #60a5fa 7%, transparent) !important;
}

.finance-depot-group--delta,
.finance-depot-col-delta {
    background: color-mix(in srgb, #a78bfa 7%, transparent) !important;
}

.finance-depot-group--sold,
.finance-depot-col-sold {
    background: color-mix(in srgb, #fbbf24 8%, transparent) !important;
}

.finance-depot-group--cumulative,
.finance-depot-col-cumulative {
    background: color-mix(in srgb, var(--stroke) 6%, transparent) !important;
}

.finance-depot-group--result,
.finance-depot-col-result {
    background: color-mix(in srgb, #6aa84f 8%, transparent) !important;
}

.finance-depot-group--action,
.finance-depot-col-action {
    background: transparent !important;
    border-left: 1px solid color-mix(in srgb, var(--stroke) 45%, transparent);
}

.finance-depot-cell-input {
    display: block;
    width: 100%;
    min-width: 4.25rem;
    max-width: 7.25rem;
    margin: 0 auto;
    padding: 0.4rem 0.35rem;
    border: 1px solid color-mix(in srgb, var(--stroke) 75%, transparent);
    border-radius: calc(var(--radius) - 4px);
    font: inherit;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--text);
    background: color-mix(in srgb, var(--bg0) 55%, var(--surface));
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.finance-depot-cell-input:hover {
    border-color: color-mix(in srgb, var(--text) 25%, var(--stroke));
}

.finance-depot-cell-input:focus {
    outline: none;
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    box-shadow: 0 0 0 2px color-mix(in srgb, #6aa84f 16%, transparent);
    background: color-mix(in srgb, var(--bg0) 35%, var(--surface));
}

.finance-depot-period-input {
    min-width: 5.5rem;
    max-width: 5.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.finance-depot-stand-input:focus {
    border-color: color-mix(in srgb, #60a5fa 55%, var(--stroke));
    box-shadow: 0 0 0 2px color-mix(in srgb, #60a5fa 14%, transparent);
}

.finance-depot-delta-input:focus {
    border-color: color-mix(in srgb, #a78bfa 55%, var(--stroke));
    box-shadow: 0 0 0 2px color-mix(in srgb, #a78bfa 14%, transparent);
}

.finance-depot-sold-input:focus {
    border-color: color-mix(in srgb, #fbbf24 55%, var(--stroke));
    box-shadow: 0 0 0 2px color-mix(in srgb, #fbbf24 14%, transparent);
}

.finance-depot-computed {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.84rem;
    padding-inline: 0.45rem !important;
}

.finance-depot-computed--gain {
    color: #6aa84f !important;
}

.finance-depot-computed--loss {
    color: #fb7185 !important;
}

.finance-depot-computed--neutral {
    color: var(--muted) !important;
}

.finance-depot-cumulative {
    color: var(--muted, #888) !important;
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    padding-inline: 0.4rem !important;
}

.finance-depot-sold-proceeds {
    color: color-mix(in srgb, #fbbf24 75%, #fef3c7) !important;
    font-weight: 600;
}

.finance-depot-profit,
.finance-depot-sale-profit {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.finance-depot-profit--positive,
.finance-depot-sale-profit--positive {
    color: #6aa84f !important;
}

.finance-depot-profit--negative,
.finance-depot-sale-profit--negative {
    color: #fb7185 !important;
}

.finance-depot-profit--neutral,
.finance-depot-sale-profit--neutral {
    color: var(--muted) !important;
}

.finance-data-table--depot-positions .finance-depot-profit {
    font-size: 0.84rem;
}

.finance-data-table--depot-edit th.finance-depot-col-delta {
    font-size: 0.74rem;
}

.finance-depot-sold-input,
.finance-depot-delta-input {
    min-width: 4rem;
    max-width: 6.5rem;
}

.finance-depot-stand-input {
    max-width: 6.25rem;
}

.finance-depot-sold-toolbar,
.finance-depot-holdings-toolbar {
    padding-inline: 1.25rem;
}

.finance-depot-holdings-form .finance-modal-actions {
    padding-inline: 1.25rem;
}

.finance-depot-holdings-form .finance-modal-hint {
    margin-inline: 1.25rem;
    line-height: 1.55;
    color: color-mix(in srgb, #6aa84f 80%, var(--muted));
}

.finance-depot-row-actions {
    width: 2.5rem;
    padding-inline: 0.15rem !important;
    text-align: center;
}

.finance-depot-row-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, #fb7185 35%, var(--stroke));
    border-radius: calc(var(--radius) - 4px);
    background: color-mix(in srgb, #fb7185 10%, transparent);
    color: #fecaca;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.finance-depot-row-delete:hover,
.finance-depot-row-delete:focus-visible {
    background: color-mix(in srgb, #fb7185 22%, transparent);
    border-color: color-mix(in srgb, #fb7185 55%, var(--stroke));
}

.finance-depot-row-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.finance-fixkosten-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.finance-depot-recompute-btn {
    font-size: 0.84rem;
    padding: 0.45rem 0.85rem;
}

.finance-depot-recompute-status {
    margin: -0.35rem 0 1rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
}

.finance-bundesschatz-title {
    color: color-mix(in srgb, #fbbf77 88%, var(--text));
}

.finance-bundesschatz-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 1rem;
    margin-bottom: 1rem;
}

.finance-bundesschatz-add {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.finance-bundesschatz-month-picker {
    min-width: 10rem;
}

.finance-bundesschatz-scroll {
    max-height: min(70vh, 720px);
}

.finance-data-table--bundesschatz {
    min-width: 52rem;
}

.finance-bundesschatz-group-header th {
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: color-mix(in srgb, #fbbf77 12%, var(--card));
    border-bottom: 1px solid color-mix(in srgb, #fbbf77 35%, var(--stroke));
}

.finance-bundesschatz-col-group {
    border-left: 3px solid #e69138;
}

.finance-bundesschatz-col-result-group {
    border-left: 3px solid #6aa84f;
}

.finance-bundesschatz-col-header th {
    font-size: 0.74rem;
    background: color-mix(in srgb, var(--card) 92%, #e69138 8%);
}

.finance-bundesschatz-col-period {
    text-align: left !important;
    min-width: 5.5rem;
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
}

.finance-bundesschatz-meta {
    color: color-mix(in srgb, var(--text) 72%, var(--muted));
    font-variant-numeric: tabular-nums;
}

.finance-bundesschatz-input {
    display: block;
    width: 100%;
    min-width: 4.5rem;
    max-width: 6.75rem;
    margin-inline: auto;
    padding: 0.28rem 0.4rem;
    border: 1px solid var(--stroke);
    border-radius: calc(var(--radius) - 4px);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.finance-bundesschatz-input--rate {
    max-width: 4.75rem;
}

.finance-bundesschatz-input:focus {
    outline: 2px solid color-mix(in srgb, #fbbf77 55%, transparent);
    border-color: #fbbf77;
}

.finance-bundesschatz-computed {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: color-mix(in srgb, var(--text) 80%, #94d2bd 20%) !important;
}

.finance-bundesschatz-computed--profit {
    color: #6aa84f !important;
}

.finance-bundesschatz-computed--negative {
    color: #fb7185 !important;
}

.finance-bundesschatz-col-action {
    width: 2.5rem;
    text-align: center !important;
}

.finance-bundesschatz-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.finance-accounts-add-card {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    padding: 1rem 1.25rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    border-left: 3px solid #6aa84f;
    background: color-mix(in srgb, #6aa84f 6%, var(--card));
}

.finance-accounts-add-card-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.finance-accounts-add-card-text {
    flex: 1 1 12rem;
    min-width: 0;
}

.finance-accounts-add-card-label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
}

.finance-accounts-add-card-hint {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
}

.finance-accounts-add-card-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    flex: 0 1 auto;
}

.finance-accounts-month-picker {
    width: auto;
    min-width: 10.5rem;
    max-width: 11.5rem;
    padding: 0.48rem 0.75rem;
    color-scheme: dark;
}

.finance-accounts-scroll {
    margin-bottom: 0.5rem;
}

.finance-data-table--accounts {
    min-width: 72rem;
}

.finance-accounts-col-period {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 5.5rem;
    background: var(--card);
    font-weight: 600;
}

.finance-accounts-col-header th {
    font-size: 0.78rem;
    white-space: nowrap;
}

.finance-accounts-col-info {
    min-width: 10rem;
    max-width: 14rem;
}

.finance-accounts-meta {
    white-space: nowrap;
}

.finance-accounts-meta.finance-accounts-col-info {
    white-space: normal;
    font-size: 0.82rem;
    color: var(--muted);
}

.finance-accounts-input {
    width: 100%;
    min-width: 5.5rem;
    max-width: 7.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid color-mix(in srgb, var(--muted) 28%, transparent);
    background: var(--surface-2);
    color: inherit;
    font: inherit;
    font-size: 0.82rem;
    text-align: right;
}

.finance-accounts-input--info {
    min-width: 10rem;
    max-width: 14rem;
    text-align: left;
}

.finance-accounts-input:focus {
    outline: 2px solid color-mix(in srgb, #6aa84f 55%, transparent);
    outline-offset: 1px;
}

.finance-accounts-computed {
    font-weight: 600;
    white-space: nowrap;
    text-align: right !important;
}

.finance-accounts-col-subtotal {
    min-width: 6.5rem;
}

.finance-accounts-col-action {
    width: 2.5rem;
    text-align: center !important;
}

.finance-accounts-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.finance-fixkosten-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.9rem;
    border-radius: calc(var(--radius) - 2px);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    background: #6aa84f;
    border: 1px solid color-mix(in srgb, #6aa84f 70%, white);
    cursor: pointer;
}

.finance-fixkosten-add-btn:hover,
.finance-fixkosten-add-btn:focus-visible {
    filter: brightness(1.06);
}

.finance-fixkosten-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.85rem;
}

.finance-fixkosten-section-meta {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.finance-data-table--fixkosten th,
.finance-data-table--fixkosten td {
    text-align: left;
    color: var(--text);
}

.finance-fixkosten-name-blurred {
    display: inline-block;
    max-width: 100%;
    filter: blur(7px);
    -webkit-filter: blur(7px);
    opacity: 0.92;
    user-select: none;
    pointer-events: none;
}

.finance-data-table--fixkosten .finance-data-table-total {
    color: #6aa84f !important;
}

.finance-data-table-notes {
    white-space: normal;
    min-width: 10rem;
    max-width: 22rem;
    color: var(--muted) !important;
}

.finance-row-inactive th,
.finance-row-inactive td {
    opacity: 0.72;
}

.finance-fixkosten-subtitle {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-fixkosten-table-block {
    margin-bottom: 1.25rem;
}

.finance-fixkosten-table-block--inactive {
    padding-top: 0.5rem;
    border-top: 1px solid var(--stroke);
}

.finance-data-table--inactive-group tbody tr {
    opacity: 0.78;
}

button.finance-service-link {
    padding: 0;
    border: 0;
    background: none;
    color: #6aa84f;
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, #6aa84f 35%, transparent);
    text-underline-offset: 0.15em;
}

button.finance-service-link:hover,
button.finance-service-link:focus-visible {
    color: #94d2bd;
}

body.finance-modal-open {
    overflow: hidden;
}

.finance-modal[hidden] {
    display: none !important;
}

.finance-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.finance-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, 0.72);
    backdrop-filter: blur(4px);
}

.finance-modal-dialog {
    position: relative;
    width: min(100%, 32rem);
    max-height: min(92vh, 720px);
    overflow: auto;
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--stroke);
    background: var(--card);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
}

.finance-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.finance-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.finance-modal-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.finance-modal-form {
    display: grid;
    gap: 0.65rem;
}

.finance-modal-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-import-textarea {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg) 60%, var(--card));
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.finance-modal-hint {
    margin: 0;
    font-size: 0.88rem;
    color: #6aa84f;
}

.finance-amount-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.finance-amount-symbol {
    flex-shrink: 0;
    min-width: 1rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}

.finance-amount-field .finance-import-select {
    flex: 1;
    min-width: 0;
}

.finance-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.finance-modal-error {
    margin: 0;
}

@media (max-width: 560px) {
    .finance-modal-grid {
        grid-template-columns: 1fr;
    }
}

.finance-status-badge--active {
    color: #6aa84f;
    border-color: color-mix(in srgb, #6aa84f 35%, var(--stroke));
}

.finance-status-badge--inactive {
    color: #fb7185;
    border-color: color-mix(in srgb, #fb7185 35%, var(--stroke));
}

button.finance-status-toggle {
    cursor: pointer;
    font: inherit;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

button.finance-status-toggle:hover,
button.finance-status-toggle:focus-visible {
    filter: brightness(1.08);
}

button.finance-status-toggle:disabled,
button.finance-status-toggle.finance-status-toggle--loading {
    cursor: wait;
    opacity: 0.75;
}

.finance-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 2.25rem;
    margin-bottom: clamp(1.5rem, 3.5vw, 2rem);
    padding: clamp(0.95rem, 2.2vw, 1.25rem) clamp(1.1rem, 3vw, 1.5rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, var(--stroke) 85%, #6aa84f 15%);
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--card) 88%, #6aa84f 12%),
            var(--card)
        );
    box-shadow: 0 1px 0 color-mix(in srgb, white 4%, transparent);
}

.finance-subnav-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.9rem;
}

.finance-subnav-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text) 55%, var(--muted));
    white-space: nowrap;
}

.finance-subnav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.finance-subnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
    background: color-mix(in srgb, var(--bg1) 55%, var(--card));
    transition:
        color 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.finance-subnav-link:hover {
    color: var(--text);
    border-color: color-mix(in srgb, #6aa84f 45%, var(--stroke));
    background: color-mix(in srgb, #6aa84f 8%, var(--card));
    box-shadow: 0 2px 10px color-mix(in srgb, #6aa84f 12%, transparent);
}

.finance-subnav-link.is-active {
    color: #0f172a;
    font-weight: 700;
    background: #6aa84f;
    border-color: color-mix(in srgb, #6aa84f 70%, white);
    box-shadow: 0 3px 14px color-mix(in srgb, #6aa84f 38%, transparent);
}

.finance-import-card {
    padding: clamp(1rem, 3vw, 1.35rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    margin-bottom: 1rem;
}

.finance-import-card--muted {
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.finance-import-help {
    margin: -0.25rem 0 1rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--muted);
}

.finance-import-form {
    display: grid;
    gap: 0.65rem;
    max-width: 28rem;
}

.finance-import-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-import-select,
.finance-import-file {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg) 60%, var(--card));
    color: var(--text);
    font: inherit;
}

.finance-import-type-hint {
    margin: -0.25rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.finance-import-submit {
    margin-top: 0.35rem;
    padding: 0.65rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    background: #6aa84f;
    border: 1px solid color-mix(in srgb, #6aa84f 70%, white);
    cursor: pointer;
}

.finance-import-submit:hover,
.finance-import-submit:focus-visible {
    filter: brightness(1.06);
}

.finance-flash {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.92rem;
}

.finance-flash--ok {
    color: #d4edbc;
    background: color-mix(in srgb, #11734b 18%, transparent);
    border: 1px solid color-mix(in srgb, #11734b 40%, transparent);
}

.finance-flash--error {
    color: #fecaca;
    background: color-mix(in srgb, #fb7185 12%, transparent);
    border: 1px solid color-mix(in srgb, #fb7185 35%, transparent);
}

.finance-wealth-status {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.finance-wealth-status--warn {
    border-color: color-mix(in srgb, #f59e0b 45%, var(--stroke));
    background: color-mix(in srgb, #f59e0b 8%, var(--card));
}

.finance-wealth-status--ok {
    border-color: color-mix(in srgb, #11734b 40%, var(--stroke));
    background: color-mix(in srgb, #11734b 10%, var(--card));
}

.finance-wealth-status-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.75rem;
}

.finance-wealth-status-header .finance-section-title {
    margin: 0;
}

.finance-wealth-status-period {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.finance-wealth-status-message {
    margin: 0 0 0.75rem;
    font-size: 0.94rem;
    color: var(--text);
}

.finance-wealth-status-message--ok {
    margin-bottom: 0;
    color: color-mix(in srgb, #6aa84f 85%, var(--text));
}

.finance-wealth-status-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.finance-wealth-status-item {
    display: grid;
    grid-template-columns: minmax(5.5rem, 7rem) minmax(0, 1fr) auto;
    gap: 0.5rem 0.85rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    font-size: 0.92rem;
}

.finance-wealth-status-item-label {
    font-weight: 700;
    color: var(--text);
}

.finance-wealth-status-item-detail {
    color: var(--muted);
}

.finance-wealth-status-item-link {
    color: #6aa84f;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.finance-wealth-status-item-link:hover,
.finance-wealth-status-item-link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .finance-wealth-status-item {
        grid-template-columns: 1fr;
    }
}

.finance-cash-card {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.35rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.finance-cash-header {
    margin-bottom: 1rem;
}

.finance-cash-header .finance-section-title {
    margin: 0 0 0.35rem;
}

.finance-cash-balance {
    margin: 0 0 1.15rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    color: var(--text);
}

.finance-cash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.finance-cash-btn {
    min-width: 5.5rem;
    padding: 0.65rem 1rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 60%, var(--card));
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.finance-cash-btn--plus {
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    color: #6aa84f;
}

.finance-cash-btn--minus {
    border-color: color-mix(in srgb, #fb7185 45%, var(--stroke));
    color: #fb7185;
}

.finance-cash-btn:hover,
.finance-cash-btn:focus-visible {
    filter: brightness(1.08);
}

.finance-cash-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.finance-cash-transfer-card {
    margin-bottom: 1.35rem;
    padding: 0;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, #60a5fa 28%, var(--stroke));
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, #60a5fa 9%, var(--card)) 0%,
            var(--card) 52%,
            color-mix(in srgb, #6aa84f 6%, var(--card)) 100%
        );
    overflow: hidden;
    box-shadow: 0 1px 0 color-mix(in srgb, white 4%, transparent);
}

.finance-cash-transfer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 16rem);
    gap: 0;
}

.finance-cash-transfer-main {
    padding: 1.15rem 1.35rem 1.25rem;
}

.finance-cash-transfer-intro {
    margin-bottom: 1rem;
}

.finance-cash-transfer-title {
    margin: 0 0 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-cash-transfer-intro-hint {
    margin: 0;
    max-width: 42rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.finance-cash-transfer-stats {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 0 1.25rem;
}

.finance-cash-transfer-stat {
    min-width: 0;
}

.finance-cash-transfer-stat-label {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-cash-transfer-balance {
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 2.85rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #60a5fa;
}

.finance-cash-transfer-snapshot-value {
    margin: 0;
    font-size: clamp(1.35rem, 2.8vw, 1.85rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.finance-cash-transfer-stat-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.finance-cash-transfer-badge {
    display: inline-block;
    margin: 0.55rem 0 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fbbf24;
    background: color-mix(in srgb, #fbbf24 14%, transparent);
    border: 1px solid color-mix(in srgb, #fbbf24 35%, transparent);
}

.finance-cash-transfer-stat-sep {
    width: 1px;
    align-self: stretch;
    background: color-mix(in srgb, var(--stroke) 75%, transparent);
}

.finance-cash-transfer-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    padding: 1.15rem 1.25rem;
    border-left: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
    background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.finance-cash-transfer-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.finance-cash-transfer-aside-hint {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--muted);
}

.finance-cash-transfer-locked {
    margin: 0;
}

.finance-cash-transfer-link {
    align-self: flex-start;
    color: #6aa84f;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.finance-cash-transfer-link:hover,
.finance-cash-transfer-link:focus-visible {
    text-decoration: underline;
}

@media (max-width: 820px) {
    .finance-cash-transfer-layout {
        grid-template-columns: 1fr;
    }

    .finance-cash-transfer-aside {
        border-left: none;
        border-top: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
    }

    .finance-cash-transfer-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .finance-cash-transfer-stat-sep {
        width: 100%;
        height: 1px;
    }
}

.finance-lent-page {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.finance-lent-hero {
    margin-bottom: 0;
    padding: 0;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, #a78bfa 28%, var(--stroke));
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, #a78bfa 10%, var(--card)) 0%,
            var(--card) 48%,
            color-mix(in srgb, #f59e0b 6%, var(--card)) 100%
        );
    overflow: hidden;
    box-shadow: 0 1px 0 color-mix(in srgb, white 4%, transparent);
}

.finance-lent-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
    gap: 0;
}

.finance-lent-hero-main {
    padding: 1.2rem 1.4rem 1.3rem;
}

.finance-lent-hero-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-lent-balance {
    margin: 0;
    font-size: clamp(2rem, 5vw, 2.85rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #a78bfa;
}

.finance-lent-hero-hint {
    margin: 0.45rem 0 0.85rem;
    max-width: 36rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.finance-lent-hero-chip {
    display: inline-block;
    margin: 0;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c4b5fd;
    background: color-mix(in srgb, #a78bfa 14%, transparent);
    border: 1px solid color-mix(in srgb, #a78bfa 32%, transparent);
}

.finance-lent-hero-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    padding: 1.1rem 1.25rem;
    border-left: 1px solid color-mix(in srgb, var(--stroke) 75%, transparent);
    background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.finance-lent-hero-locked {
    margin: 0;
    font-size: 0.9rem;
}

.finance-lent-list-card {
    margin-bottom: 0;
    padding: 1.15rem 1.3rem 1.3rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.finance-lent-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.finance-lent-list-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.finance-lent-list-count {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-lent-add-borrower {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.finance-lent-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.finance-lent-field-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.finance-lent-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 55%, var(--card));
    color: inherit;
    font: inherit;
}

.finance-lent-input:focus-visible {
    outline: 2px solid color-mix(in srgb, #a78bfa 55%, transparent);
    outline-offset: 1px;
}

.finance-lent-add-btn {
    width: 100%;
    min-height: 2.55rem;
}

.finance-lent-borrower-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.finance-lent-empty-state {
    grid-column: 1 / -1;
    padding: 2rem 1.25rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px dashed color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 40%, transparent);
    text-align: center;
}

.finance-lent-empty-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.finance-lent-empty-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.finance-lent-borrower-empty {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: calc(var(--radius) - 4px);
    font-size: 0.88rem;
    color: var(--muted);
    background: color-mix(in srgb, var(--bg) 50%, transparent);
}

.finance-lent-borrower-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1rem 1.05rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--bg) 28%, var(--card)) 0%,
            var(--card) 100%
        );
    box-shadow: 0 1px 0 color-mix(in srgb, white 3%, transparent);
}

.finance-lent-borrower-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.finance-lent-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #c4b5fd;
    background: color-mix(in srgb, #a78bfa 16%, transparent);
    border: 1px solid color-mix(in srgb, #a78bfa 30%, transparent);
}

.finance-lent-borrower-meta {
    min-width: 0;
}

.finance-lent-borrower-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-lent-borrower-outstanding {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.55rem;
    margin: 0.3rem 0 0;
}

.finance-lent-borrower-outstanding-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.finance-lent-borrower-outstanding-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.finance-lent-borrower-outstanding--open .finance-lent-borrower-outstanding-label {
    color: #fbbf24;
}

.finance-lent-borrower-outstanding--open .finance-lent-borrower-outstanding-value {
    color: #a78bfa;
}

.finance-lent-borrower-outstanding--settled .finance-lent-borrower-outstanding-label {
    color: #6aa84f;
}

.finance-lent-borrower-outstanding--settled .finance-lent-borrower-outstanding-value {
    color: color-mix(in srgb, var(--muted) 80%, var(--text));
}

.finance-lent-borrower-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.finance-lent-action-btn {
    padding: 0.48rem 0.82rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 55%, var(--card));
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.finance-lent-action-btn--lend {
    border-color: color-mix(in srgb, #6aa84f 55%, var(--stroke));
    color: #6aa84f;
}

.finance-lent-action-btn--repay {
    border-color: color-mix(in srgb, #fb7185 45%, var(--stroke));
    color: #fb7185;
}

.finance-lent-action-btn--delete {
    margin-left: auto;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 500;
}

.finance-lent-action-btn:hover,
.finance-lent-action-btn:focus-visible {
    filter: brightness(1.08);
}

.finance-lent-action-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.finance-lent-borrower-history {
    border-top: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
    padding-top: 0.65rem;
}

.finance-lent-borrower-history-summary {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    list-style: none;
}

.finance-lent-borrower-history-summary::-webkit-details-marker {
    display: none;
}

.finance-lent-borrower-history-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--text);
    background: color-mix(in srgb, var(--bg) 65%, var(--card));
    border: 1px solid color-mix(in srgb, var(--stroke) 75%, transparent);
}

.finance-lent-tx-table-wrap {
    margin-top: 0.65rem;
    overflow-x: visible;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
    background: color-mix(in srgb, var(--bg) 45%, transparent);
}

.finance-lent-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.finance-lent-tx-table th,
.finance-lent-tx-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
    text-align: left;
    vertical-align: middle;
}

.finance-lent-tx-table tr:last-child td {
    border-bottom: 0;
}

.finance-lent-tx-table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: color-mix(in srgb, var(--bg) 35%, transparent);
}

.finance-lent-tx-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.finance-lent-tx-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.finance-lent-tx-note {
    color: color-mix(in srgb, var(--muted) 85%, var(--text));
    word-break: break-word;
}

.finance-lent-tx-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.finance-lent-tx-pill--lend {
    color: #6aa84f;
    background: color-mix(in srgb, #6aa84f 12%, transparent);
    border: 1px solid color-mix(in srgb, #6aa84f 28%, transparent);
}

.finance-lent-tx-pill--repay {
    color: #fb7185;
    background: color-mix(in srgb, #fb7185 12%, transparent);
    border: 1px solid color-mix(in srgb, #fb7185 28%, transparent);
}

.finance-lent-transfer-card {
    margin-bottom: 1.25rem;
    border-color: color-mix(in srgb, #a78bfa 28%, var(--stroke));
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, #a78bfa 9%, var(--card)) 0%,
            var(--card) 52%,
            color-mix(in srgb, #f59e0b 5%, var(--card)) 100%
        );
}

.finance-lent-transfer-card .finance-cash-transfer-balance {
    color: #a78bfa;
}

@media (max-width: 760px) {
    .finance-lent-hero-layout {
        grid-template-columns: 1fr;
    }

    .finance-lent-hero-aside {
        border-left: 0;
        border-top: 1px solid color-mix(in srgb, var(--stroke) 75%, transparent);
    }

    .finance-lent-action-btn--delete {
        margin-left: 0;
    }

    .finance-lent-borrower-grid {
        grid-template-columns: 1fr;
    }
}

.finance-import-next {
    margin: -0.5rem 0 1rem;
}

.finance-import-back {
    color: #6aa84f;
    text-decoration: none;
    font-weight: 500;
}

.finance-import-back:hover {
    text-decoration: underline;
}

.finance-import-notes {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.finance-import-notes code {
    font-size: 0.88em;
}

/* —— Security —— */
.security-wrap {
    max-width: 1280px;
    padding-bottom: 2.5rem;
}

.security-error {
    margin-top: 1.5rem;
}

.security-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    margin-top: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    padding: clamp(1.1rem, 3vw, 1.5rem);
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, rgba(244, 114, 182, 0.08), transparent 55%),
        var(--card);
}

.security-hero-copy {
    flex: 1 1 18rem;
    min-width: 0;
}

.security-eyebrow {
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.security-title {
    margin: 0 0 0.55rem;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.security-lead {
    margin: 0;
    max-width: 36rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
}

.security-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(5.5rem, 1fr));
    gap: 0.65rem;
    flex: 0 1 auto;
}

.security-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 5.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg1) 82%, white 18%);
}

.security-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.security-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.security-stat-card--warn .security-stat-value {
    color: #fca5a5;
}

.security-stat-card--blocked .security-stat-value {
    color: #fbbf24;
}

.security-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
    gap: clamp(1rem, 2.5vw, 1.5rem);
    align-items: start;
}

.security-panel,
.security-card {
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.security-panel {
    min-width: 0;
}

.security-panel--logs {
    display: flex;
    flex-direction: column;
    min-height: 24rem;
    max-height: calc(100vh - 14rem);
}

.security-panel-head,
.security-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.85rem;
    border-bottom: 1px solid var(--stroke);
}

.security-card-head--row {
    align-items: center;
}

.security-panel-title,
.security-card-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
}

.security-panel-sub,
.security-card-sub {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.security-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.85rem;
    height: 1.85rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg1) 88%, white 12%);
}

.security-panel-empty,
.security-card-empty {
    margin: 0;
    padding: 1.25rem 1.1rem 1.5rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.security-log-list,
.security-blocklist,
.security-tools-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.security-log-list {
    overflow-y: auto;
    flex: 1 1 auto;
}

.security-log-group {
    border-bottom: 1px solid var(--stroke);
}

.security-log-group:last-child {
    border-bottom: none;
}

.security-log-details {
    margin: 0;
}

.security-log-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem 0.85rem;
    align-items: center;
    padding: 0.9rem 1.1rem;
    list-style: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.security-log-summary::-webkit-details-marker {
    display: none;
}

.security-log-summary:hover {
    background: color-mix(in srgb, var(--bg1) 55%, transparent);
}

.security-log-group--login_failed .security-log-summary {
    background: color-mix(in srgb, #fca5a5 4%, transparent);
}

.security-log-group--login_failed .security-log-summary:hover {
    background: color-mix(in srgb, #fca5a5 7%, transparent);
}

.security-log-chevron,
.security-chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-top: -0.1rem;
}

.security-log-details[open] .security-log-chevron,
.security-card-details[open] .security-chevron {
    transform: rotate(45deg);
    margin-top: 0.15rem;
}

.security-log-detail-panel {
    padding: 0 1.1rem 0.9rem 2.35rem;
    border-top: 1px dashed color-mix(in srgb, var(--stroke) 80%, transparent);
    background: color-mix(in srgb, var(--bg1) 45%, transparent);
}

.security-log-detail-title {
    margin: 0.65rem 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.security-log-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.security-log-detail-item {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) minmax(4rem, auto);
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
    font-size: 0.84rem;
}

.security-log-detail-item:last-child {
    border-bottom: none;
}

.security-log-detail-time {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

.security-log-detail-user {
    color: var(--text);
    text-align: right;
    overflow-wrap: anywhere;
}

.security-log-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.5rem;
}

.security-log-date {
    font-size: 0.92rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.security-log-range,
.security-log-total {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    white-space: nowrap;
}

.security-log-events {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.security-log-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    margin: 0;
}

.security-log-meta > div {
    min-width: 0;
}

.security-log-meta dt {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.security-log-meta dd {
    margin: 0;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.security-log-item-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.security-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.security-card {
    overflow: hidden;
}

.security-card-details {
    margin: 0;
}

.security-card-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem 0.85rem;
    align-items: center;
    padding: 1rem 1.1rem;
    list-style: none;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: background 0.15s ease;
}

.security-card-summary::-webkit-details-marker {
    display: none;
}

.security-card-summary:hover {
    background: color-mix(in srgb, var(--bg1) 55%, transparent);
}

.security-card-details[open] .security-card-summary {
    border-bottom-color: var(--stroke);
}

.security-card-summary-copy {
    min-width: 0;
}

.security-card-body .security-card-error {
    padding-top: 0.85rem;
}

.security-card-body .ip-block-add-form {
    padding-top: 0.85rem;
}

.security-card-body .security-card-empty {
    padding-top: 0;
}

.security-card-error {
    margin: 0;
    padding: 0 1.1rem 0.85rem;
    font-size: 0.88rem;
    color: #fca5a5;
}

.security-card-hint {
    margin: 0;
    padding: 0 1.1rem 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
}

.security-blocklist-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--stroke);
}

.security-blocklist-item:last-child {
    border-bottom: none;
}

.security-blocklist-item--env {
    background: color-mix(in srgb, #fbbf24 4%, transparent);
}

.security-blocklist-item--trusted,
.security-blocklist-item--trusted-env {
    background: color-mix(in srgb, #6ee7b7 4%, transparent);
}

.security-blocklist-ip--trusted {
    color: #6ee7b7;
}

.security-blocklist-ip {
    display: block;
    font-size: 0.9rem;
    color: #93c5fd;
    overflow-wrap: anywhere;
}

.security-blocklist-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.84rem;
    color: var(--text);
}

.security-blocklist-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-top: 0.45rem;
    font-size: 0.78rem;
}

.security-tools-list a {
    display: block;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--stroke);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.security-tools-list li:last-child a {
    border-bottom: none;
}

.security-tools-link:hover {
    background: color-mix(in srgb, var(--bg1) 70%, white 30%);
}

.security-tools-link-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
}

.security-tools-link-desc {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.security-table-ip code {
    font-size: 0.88em;
    color: #93c5fd;
}

.security-event {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 80%, transparent);
    color: var(--text);
}

.security-event--login {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
}

.security-event--login_failed {
    color: #fca5a5;
    border-color: color-mix(in srgb, #fca5a5 35%, var(--stroke));
}

.security-event--logout {
    color: #93c5fd;
    border-color: color-mix(in srgb, #93c5fd 35%, var(--stroke));
}

.ip-block-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1.1rem 1.1rem;
}

.ip-block-add-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ip-block-add-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.ip-block-add-input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--bg1) 88%, white 12%);
    color: var(--text);
    font: inherit;
}

.ip-block-add-input:focus {
    outline: 2px solid color-mix(in srgb, #93c5fd 55%, transparent);
    outline-offset: 1px;
}

.ip-block-add-submit,
.security-ip-btn {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 70%, transparent);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.ip-block-add-submit {
    width: 100%;
}

.security-ip-btn--block {
    color: #fca5a5;
    border-color: color-mix(in srgb, #fca5a5 35%, var(--stroke));
}

.security-ip-btn--unblock,
.security-ip-btn--untrust {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
}

.security-ip-btn--trust-prefill {
    width: 100%;
    color: #93c5fd;
    border-color: color-mix(in srgb, #93c5fd 35%, var(--stroke));
}

.ip-block-add-submit--trust {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
}

.security-ip-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.security-ip-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fca5a5;
    border: 1px solid color-mix(in srgb, #fca5a5 35%, var(--stroke));
}

.security-ip-badge--trusted {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
}

.security-source {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid var(--stroke);
}

.security-source--env {
    color: #fbbf24;
    border-color: color-mix(in srgb, #fbbf24 35%, var(--stroke));
}

.security-source--db {
    color: #93c5fd;
    border-color: color-mix(in srgb, #93c5fd 35%, var(--stroke));
}

.security-source--trusted,
.security-source--trusted-env {
    color: #6ee7b7;
    border-color: color-mix(in srgb, #6ee7b7 35%, var(--stroke));
}

.security-muted {
    color: var(--muted);
    font-size: 0.82rem;
}

.security-tools {
    margin: 0;
}

.security-tools a {
    color: #93c5fd;
    text-decoration: none;
}

@media (max-width: 980px) {
    .security-layout {
        grid-template-columns: 1fr;
    }

    .security-panel--logs {
        max-height: none;
    }

    .security-hero-stats {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .security-hero-stats {
        grid-template-columns: 1fr;
    }

    .security-log-summary {
        grid-template-columns: auto 1fr;
    }

    .security-log-item-action {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .security-log-meta {
        grid-template-columns: 1fr;
    }

    .security-log-detail-panel {
        padding-left: 1.1rem;
    }

    .security-log-detail-item {
        grid-template-columns: 4.25rem 1fr;
    }

    .security-log-detail-user {
        grid-column: 1 / -1;
        text-align: left;
    }

    .security-blocklist-item {
        grid-template-columns: 1fr;
    }
}

/* —— Beszel Monitoring (Startseite, Bottom Bar) —— */
body:has(.beszel-bar) {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
}

.beszel-bar {
    --beszel-bar-height: 5.25rem;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    border-top: 1px solid color-mix(in srgb, #6ee7b7 14%, var(--stroke));
    background: color-mix(in srgb, var(--bg0) 88%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -8px 32px -12px rgba(0, 0, 0, 0.55);
    font-size: 0.875rem;
    color: var(--muted);
}

.beszel-bar-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "host metrics link";
    align-items: center;
    gap: 0.7rem 1.25rem;
    width: 100%;
    max-width: 1120px;
    min-height: calc(var(--beszel-bar-height) - 2.35rem);
    margin: 0 auto;
    padding: 0.75rem clamp(1rem, 3vw, 1.35rem) 0.65rem;
}

.beszel-bar-top:last-child {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.beszel-bar-top:has(.beszel-bar-error) {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: var(--beszel-bar-height);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

.beszel-bar-error {
    flex: 1;
    margin: 0;
    color: #fca5a5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.beszel-bar-top:has(.beszel-bar-error) .beszel-bar-link {
    margin-left: auto;
}

.beszel-bar-host {
    grid-area: host;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    min-width: 0;
}

.beszel-bar-host-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
}

.beszel-bar-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: #64748b;
}

.beszel-bar-dot--is-ok {
    background: #34d399;
    box-shadow: 0 0 8px color-mix(in srgb, #34d399 55%, transparent);
}

.beszel-bar-dot--is-off {
    background: #f87171;
}

.beszel-bar-dot--is-warn {
    background: #fbbf24;
}

.beszel-bar-dot--is-muted {
    background: #64748b;
}

.beszel-bar-metrics {
    grid-area: metrics;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem 1.35rem;
    min-width: 0;
}

.beszel-bar-metric {
    display: grid;
    grid-template-columns: auto minmax(3.5rem, 1fr) auto;
    align-items: center;
    gap: 0.4rem 0.55rem;
    width: 7.25rem;
    flex: 0 0 auto;
}

.beszel-bar-metric-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.beszel-bar-metric-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.beszel-bar-metric-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #34d399;
}

.beszel-metric--warn .beszel-bar-metric-fill {
    background: #fbbf24;
}

.beszel-metric--crit .beszel-bar-metric-fill {
    background: #f87171;
}

.beszel-bar-metric-value {
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
    white-space: nowrap;
}

.beszel-metric--warn .beszel-bar-metric-value {
    color: #fcd34d;
}

.beszel-metric--crit .beszel-bar-metric-value {
    color: #fca5a5;
}

.beszel-bar-divider {
    display: none;
}

.beszel-bar-containers-row {
    width: 100%;
    border-top: 1px solid var(--stroke);
    padding: 0.5rem clamp(1rem, 3vw, 1.35rem);
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.beszel-bar-containers {
    display: flex;
    align-items: center;
    gap: 0.65rem 0.85rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.beszel-bar-containers::-webkit-scrollbar {
    display: none;
}

.beszel-bar-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem 0.65rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.22);
    white-space: nowrap;
    flex-shrink: 0;
}

.beszel-bar-container-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e2e8f0;
}

.beszel-bar-container-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.beszel-bar-container-stat {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: #cbd5e1;
    font-weight: 500;
}

.beszel-bar-link {
    grid-area: link;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    justify-self: end;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    color: #6ee7b7;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.beszel-bar-link svg {
    width: 0.85rem;
    height: 0.85rem;
}

.beszel-bar-link:hover,
.beszel-bar-link:focus-visible {
    color: #a7f3d0;
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 720px) {
    body:has(.beszel-bar) {
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
    }

    .beszel-bar {
        --beszel-bar-height: 6.5rem;
    }

    .beszel-bar-top {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "host link"
            "metrics metrics";
        gap: 0.55rem 0.85rem;
        min-height: auto;
        padding-bottom: 0.55rem;
    }

    .beszel-bar-metrics {
        flex-wrap: wrap;
        gap: 0.65rem 1rem;
    }

    .beszel-bar-metric {
        width: calc(33.333% - 0.7rem);
        min-width: 6.5rem;
    }
}

@media (max-width: 520px) {
    .beszel-bar-host-label {
        max-width: 4.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* —— Anime-Liste —— */

.anime-wrap {
    max-width: 100%;
}

.anime-hero {
    margin-bottom: 1.5rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.anime-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.anime-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f472b6;
}

.anime-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.anime-lead {
    margin: 0;
    color: var(--muted);
    max-width: 42rem;
}

.anime-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.anime-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.65rem;
}

.anime-kpi {
    padding: 0.75rem 0.85rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.02);
}

.anime-kpi--accent {
    border-color: color-mix(in srgb, #f472b6 35%, var(--stroke));
}

.anime-kpi-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.anime-kpi-value {
    font-size: 1.35rem;
    font-weight: 600;
}

.anime-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: end;
    margin-bottom: 1rem;
}

.anime-filter-search {
    flex: 1 1 14rem;
}

.anime-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 7rem;
}

.anime-filter--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.4rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.anime-filter-label {
    font-size: 0.75rem;
    color: var(--muted);
}

.anime-input,
.anime-textarea {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border-radius: calc(var(--radius) - 6px);
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
}

.anime-textarea {
    resize: vertical;
    min-height: 4rem;
}

.anime-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: calc(var(--radius) - 6px);
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.anime-btn:hover,
.anime-btn:focus-visible {
    border-color: color-mix(in srgb, #f472b6 35%, var(--stroke));
}

.anime-btn--primary {
    background: color-mix(in srgb, #f472b6 18%, rgba(255, 255, 255, 0.04));
    border-color: color-mix(in srgb, #f472b6 40%, var(--stroke));
}

.anime-btn--ghost {
    background: transparent;
}

.anime-btn--danger {
    color: #fb7185;
    border-color: color-mix(in srgb, #fb7185 35%, var(--stroke));
}

.anime-table-card {
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    overflow: hidden;
}

.anime-table-scroll {
    overflow-x: auto;
}

.anime-table {
    width: 100%;
    min-width: 72rem;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.anime-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.65rem 0.55rem;
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e9d5ff;
    background: #4c1d95;
    white-space: nowrap;
}

.anime-table tbody td {
    padding: 0.5rem 0.55rem;
    border-top: 1px solid var(--stroke);
    vertical-align: middle;
}

.anime-table tbody tr:nth-child(even) {
    background: rgba(244, 114, 182, 0.04);
}

.anime-row {
    cursor: pointer;
    transition: background 0.12s ease;
}

.anime-row:hover,
.anime-row:focus-visible {
    background: rgba(244, 114, 182, 0.1) !important;
}

.anime-col-poster {
    width: 4.25rem;
    padding-right: 0.35rem;
}

.anime-poster {
    display: block;
    width: 3.75rem;
    height: 5.35rem;
    object-fit: cover;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.anime-poster--empty {
    display: inline-block;
}

.anime-col-title {
    min-width: 10rem;
    max-width: 16rem;
}

.anime-title-stack {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.anime-title-alt {
    display: block;
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--muted);
}

.anime-title-alt--native {
    font-family: inherit;
}

.anime-col-rating,
.anime-col-overall {
    text-align: center;
    vertical-align: middle;
}

.anime-table thead th.anime-col-rating,
.anime-table thead th.anime-col-overall {
    text-align: center;
}

.anime-col-rating {
    background: color-mix(in srgb, var(--anime-cat-accent, #7c9cff) 8%, transparent);
}

.anime-rating-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-inline: auto;
}

.anime-rating-cell.is-low {
    background: rgba(251, 113, 133, 0.22);
    color: #fecdd3;
}

.anime-rating-cell.is-mid {
    background: rgba(250, 204, 21, 0.18);
    color: #fde68a;
}

.anime-rating-cell.is-high {
    background: rgba(52, 211, 153, 0.2);
    color: #a7f3d0;
}

.anime-rating-cell.is-empty {
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.anime-rating-cell--overall {
    background: rgba(45, 212, 191, 0.15);
}

.anime-audio {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.anime-audio--sub {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
}

.anime-audio--dub-en {
    background: rgba(52, 211, 153, 0.18);
    color: #6ee7b7;
}

.anime-audio--dub-de {
    background: rgba(251, 191, 36, 0.18);
    color: #fcd34d;
}

.anime-status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.anime-status--planned {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
}

.anime-status--watching {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}

.anime-status--completed {
    background: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}

.anime-status--on_hold {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

.anime-status--dropped {
    background: rgba(251, 113, 133, 0.15);
    color: #fda4af;
}

.anime-platform {
    color: var(--platform-color, var(--text));
    font-weight: 500;
}

.anime-genre-tag {
    display: inline-block;
    margin: 0.1rem 0.15rem 0.1rem 0;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.anime-episodes {
    display: inline-block;
    min-width: 2.5rem;
    font-variant-numeric: tabular-nums;
}

.anime-progress {
    display: block;
    margin-top: 0.2rem;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.anime-progress::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    background: linear-gradient(90deg, #f472b6, #c084fc);
}

.anime-anilist-score {
    font-variant-numeric: tabular-nums;
    color: #a5b4fc;
}

.anime-ext-link {
    margin-left: 0.25rem;
    color: var(--muted);
    text-decoration: none;
}

.anime-ext-link:hover {
    color: #c4b5fd;
}

.anime-muted {
    color: var(--muted);
}

.anime-empty-row td {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}

.anime-cards {
    display: none;
    gap: 0.75rem;
}

.anime-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    cursor: pointer;
}

.anime-card-poster {
    width: 3.5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

.anime-card-poster--empty {
    display: block;
}

.anime-card-body {
    min-width: 0;
}

.anime-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.anime-card-title {
    margin: 0;
    font-size: 1rem;
}

.anime-card-season {
    color: var(--muted);
    font-weight: 400;
}

.anime-card-score {
    font-weight: 600;
    color: #2dd4bf;
}

.anime-card-meta {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

body.anime-modal-open {
    overflow: hidden;
}

.anime-modal-dialog--wide {
    width: min(100%, 42rem);
}

.anime-form-section {
    margin: 0.5rem 0;
    padding-top: 0.35rem;
    border-top: 1px solid var(--stroke);
}

.anime-form-section-title {
    margin: 0 0 0.55rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.anime-form-grid {
    margin-top: 0.35rem;
}

.anime-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.anime-field--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
}

.anime-field-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.anime-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.anime-ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.55rem;
}

.anime-anilist-results {
    display: grid;
    gap: 0.35rem;
    max-height: 14rem;
    overflow: auto;
    margin-top: 0.35rem;
    padding: 0.35rem;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.15);
}

.anime-anilist-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.45rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 6px);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.anime-anilist-item:hover,
.anime-anilist-item:focus-visible {
    border-color: color-mix(in srgb, #f472b6 35%, var(--stroke));
    background: rgba(244, 114, 182, 0.08);
}

.anime-anilist-thumb {
    width: 2rem;
    height: 2.85rem;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.anime-anilist-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.anime-anilist-item-meta {
    font-size: 0.78rem;
    color: var(--muted);
}

.anime-anilist-empty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.anime-form-error {
    color: #fb7185;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .anime-table-card {
        display: none;
    }

    .anime-cards {
        display: grid;
    }
}

/* —— Push / ntfy —— */
.notifications-wrap {
    padding-bottom: 2.5rem;
}

.notifications-hero {
    margin-top: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.notifications-eyebrow {
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.notifications-title {
    margin: 0 0 0.55rem;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.notifications-lead {
    margin: 0;
    max-width: 42rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
}

.notifications-panel {
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.notifications-section-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.notifications-dl {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.notifications-dl > div {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.75rem;
    align-items: baseline;
}

.notifications-dl dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.notifications-dl dd {
    margin: 0;
    font-size: 0.9rem;
}

.notifications-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.notifications-badge--ok {
    color: #34d399;
    background: color-mix(in srgb, #34d399 14%, transparent);
}

.notifications-badge--warn,
.notifications-badge--degraded {
    color: #fbbf24;
    background: color-mix(in srgb, #fbbf24 14%, transparent);
}

.notifications-badge--error {
    color: #fb7185;
    background: color-mix(in srgb, #fb7185 14%, transparent);
}

.notifications-badge--skipped {
    color: var(--muted);
    background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.notifications-hint {
    margin: 1rem 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted);
}

.notifications-form {
    display: grid;
    gap: 0.85rem;
}

.notifications-field {
    display: grid;
    gap: 0.35rem;
}

.notifications-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.notifications-input,
.notifications-textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid var(--stroke);
    background: color-mix(in srgb, var(--card) 92%, white 8%);
    color: inherit;
    font: inherit;
}

.notifications-textarea {
    resize: vertical;
    min-height: 4.5rem;
}

.notifications-actions {
    display: flex;
    gap: 0.65rem;
}

.notifications-btn {
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    background: var(--accent, #7c9cff);
    color: #0b1020;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.notifications-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.notifications-feedback {
    margin: 0;
    font-size: 0.88rem;
}

.notifications-feedback.is-ok {
    color: #34d399;
}

.notifications-feedback.is-error {
    color: #fb7185;
}

.security-tools {
    margin-top: 1rem;
    font-size: 0.88rem;
}

.security-tools a {
    color: var(--accent, #7c9cff);
}

@media (max-width: 640px) {
    .notifications-dl > div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

/* —— Kalender —— */
.cal-wrap {
    max-width: 1800px;
}

.cal-hero {
    margin-bottom: 1.5rem;
}

.cal-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cal-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.cal-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
}

.cal-month-nav {
    flex-wrap: wrap;
}

.cal-today-btn {
    margin-left: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 0.82rem;
    text-decoration: none;
}

.cal-today-btn:hover,
.cal-today-btn:focus-visible {
    border-color: rgba(124, 156, 255, 0.45);
    background: rgba(124, 156, 255, 0.12);
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
}

.cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.72);
}

.cal-legend-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.cal-legend-item--firma .cal-legend-dot { background: #60a5fa; }
.cal-legend-item--home-office .cal-legend-dot { background: #fb923c; }
.cal-legend-item--urlaub .cal-legend-dot { background: #34d399; }
.cal-legend-item--krank .cal-legend-dot { background: #f87171; }
.cal-legend-item--feiertag .cal-legend-dot { background: #c084fc; }
.cal-legend-item--weekend-free .cal-legend-dot { background: #94a3b8; }
.cal-legend-item--weekend-duty .cal-legend-dot { background: #fbbf24; }

.cal-grid-wrap {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.cal-grid {
    width: 100%;
}

.cal-grid-head,
.cal-grid-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.65rem;
}

.cal-grid-head {
    margin-bottom: 0.65rem;
}

.cal-grid-head-cell {
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.cal-day {
    display: flex;
    flex-direction: column;
    min-height: 10.5rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.cal-day--outside {
    opacity: 0.45;
}

.cal-day--today {
    border-color: rgba(124, 156, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(124, 156, 255, 0.25);
}

.cal-day--work-firma { --cal-work-accent: #60a5fa; }
.cal-day--work-home-office { --cal-work-accent: #fb923c; }
.cal-day--work-urlaub { --cal-work-accent: #34d399; }
.cal-day--work-krank { --cal-work-accent: #f87171; }
.cal-day--work-feiertag { --cal-work-accent: #c084fc; }
.cal-day--work-weekend-free { --cal-work-accent: #94a3b8; }
.cal-day--work-weekend-duty { --cal-work-accent: #fbbf24; }

.cal-day-num {
    padding: 0.45rem 0.7rem 0.2rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.cal-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
    min-height: 0;
}

.cal-half:hover,
.cal-half:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.cal-half--work {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: color-mix(in srgb, var(--cal-work-accent, transparent) 18%, transparent);
}

.cal-half--work.cal-half--has-note {
    background: color-mix(in srgb, #38bdf8 22%, var(--cal-work-accent, transparent) 12%);
    box-shadow: inset 3px 0 0 #38bdf8;
}

.cal-half--private {
    background: rgba(255, 255, 255, 0.02);
}

.cal-half--private.cal-half--has-note {
    background: rgba(232, 121, 249, 0.14);
    box-shadow: inset 3px 0 0 #e879f9;
}

.cal-half-label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.cal-half-value {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.cal-half-note {
    font-size: 0.78rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cal-half--work.cal-half--has-note .cal-half-note {
    color: #7dd3fc;
    font-weight: 500;
}

.cal-half--private.cal-half--has-note .cal-half-value {
    color: #f0abfc;
    font-weight: 500;
}

.cal-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
}

.cal-status.is-ok { color: #34d399; }
.cal-status.is-error { color: #fb7185; }

.cal-popover {
    position: absolute;
    z-index: 200;
    width: min(22rem, calc(100vw - 1.5rem));
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1a1f2e;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cal-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
}

.cal-popover-close {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.cal-popover-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cal-popover-label {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.cal-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.cal-type-btn {
    padding: 0.45rem 0.5rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
}

.cal-type-btn:hover,
.cal-type-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}

.cal-type-btn.is-active {
    border-color: rgba(124, 156, 255, 0.55);
    background: rgba(124, 156, 255, 0.18);
}

.cal-type-btn--firma.is-active { border-color: #60a5fa; background: rgba(96, 165, 250, 0.2); }
.cal-type-btn--home-office.is-active { border-color: #fb923c; background: rgba(251, 146, 60, 0.2); }
.cal-type-btn--urlaub.is-active { border-color: #34d399; background: rgba(52, 211, 153, 0.2); }
.cal-type-btn--krank.is-active { border-color: #f87171; background: rgba(248, 113, 113, 0.2); }
.cal-type-btn--feiertag.is-active { border-color: #c084fc; background: rgba(192, 132, 252, 0.2); }
.cal-type-btn--weekend-free.is-active { border-color: #94a3b8; background: rgba(148, 163, 184, 0.2); }
.cal-type-btn--weekend-duty.is-active { border-color: #fbbf24; background: rgba(251, 191, 36, 0.2); }

.cal-type-clear,
.cal-popover-save {
    padding: 0.45rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.cal-popover-save {
    border-color: rgba(124, 156, 255, 0.45);
    background: rgba(124, 156, 255, 0.18);
}

.cal-popover-textarea {
    width: 100%;
    resize: vertical;
    min-height: 3rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font: inherit;
}

.cal-popover-actions {
    display: flex;
    gap: 0.45rem;
}

@media (max-width: 768px) {
    .cal-wrap {
        max-width: none;
    }

    .cal-grid {
        min-width: 680px;
    }

    .cal-day {
        min-height: 7rem;
    }

    .cal-half-value,
    .cal-half-note {
        -webkit-line-clamp: 2;
    }
}

/* --- Upcoming (games timeline) --- */

.gatcha-wrap {
    max-width: 52rem;
}

.gatcha-hero {
    margin-bottom: 1.5rem;
}

.gatcha-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.25rem;
}

.gatcha-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.gatcha-title {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gatcha-lead {
    margin: 0.55rem 0 0;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
    line-height: 1.55;
}

.gatcha-hero-actions {
    flex-shrink: 0;
}

.gatcha-sync-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(157, 138, 255, 0.45);
    background: rgba(157, 138, 255, 0.16);
    color: inherit;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.gatcha-sync-btn:hover:not(:disabled) {
    background: rgba(157, 138, 255, 0.24);
    border-color: rgba(157, 138, 255, 0.65);
}

.gatcha-sync-btn:disabled,
.gatcha-sync-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
}

.gatcha-sync-status {
    min-height: 1.25rem;
    margin: 0.85rem 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
}

.gatcha-sync-status.is-error {
    color: #fca5a5;
}

.gatcha-toolbar {
    margin-bottom: 1.25rem;
}

.gatcha-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.gatcha-filter-btn {
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.gatcha-filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.gatcha-filter-btn.is-active {
    border-color: color-mix(in srgb, var(--accent, #7c9cff) 55%, transparent);
    background: color-mix(in srgb, var(--accent, #7c9cff) 18%, transparent);
    color: #fff;
}

.gatcha-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gatcha-item {
    display: grid;
    grid-template-columns: 4px 1fr;
    gap: 0;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gatcha-item.is-past {
    opacity: 0.48;
}

.gatcha-item-accent {
    background: var(--accent, #7c9cff);
}

.gatcha-item-body {
    padding: 0.9rem 1rem 1rem;
}

.gatcha-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.gatcha-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gatcha-badge--game {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
}

.gatcha-badge--type {
    background: rgba(124, 156, 255, 0.14);
    color: #c7d2fe;
}

.gatcha-badge--patch { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.gatcha-badge--banner { background: rgba(250, 204, 21, 0.16); color: #fde047; }
.gatcha-badge--preview { background: rgba(192, 132, 252, 0.16); color: #d8b4fe; }
.gatcha-badge--maintenance { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
.gatcha-badge--event { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.gatcha-badge--news { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; }

.gatcha-countdown {
    margin-left: auto;
    font-size: 0.76rem;
    font-weight: 600;
    color: #a5b4fc;
}

.gatcha-countdown.is-past {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 500;
}

.gatcha-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.gatcha-item-date {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.48);
}

.gatcha-item-summary {
    margin: 0.65rem 0 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.68);
}

.gatcha-item-link {
    display: inline-flex;
    margin-top: 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #93c5fd;
    text-decoration: none;
}

.gatcha-item-link:hover {
    text-decoration: underline;
}

.gatcha-past-divider {
    list-style: none;
    margin: 0.35rem 0 0.15rem;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
}

.gatcha-empty {
    margin-top: 0.5rem;
}

.gatcha-error {
    color: #fca5a5;
}

@media (max-width: 640px) {
    .gatcha-countdown {
        margin-left: 0;
        width: 100%;
    }
}

.gatcha-wrap--wide {
    max-width: 72rem;
}

.gatcha-hero--compact {
    margin-bottom: 1rem;
}

.gatcha-hero--compact .gatcha-title {
    font-size: clamp(1.65rem, 3vw, 2rem);
}

.gatcha-inline-link {
    color: #93c5fd;
    text-decoration: none;
}

.gatcha-inline-link:hover {
    text-decoration: underline;
}

.gatcha-sync-btn--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.gatcha-subnav {
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gatcha-subnav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gatcha-subnav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
}

.gatcha-subnav-link:hover {
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.gatcha-subnav-link.is-active {
    border-color: rgba(124, 156, 255, 0.45);
    background: rgba(124, 156, 255, 0.14);
    color: #fff;
}

.gatcha-cal-section {
    margin-top: 0.25rem;
}

.gatcha-cal-header {
    margin-bottom: 0.85rem;
}

.gatcha-cal-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.gatcha-cal-nav-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0.55rem;
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.gatcha-cal-nav-btn:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.gatcha-cal-nav-btn--icon {
    min-width: 2rem;
    padding-inline: 0.55rem;
    font-size: 1.1rem;
    line-height: 1;
}

.gatcha-cal-month {
    margin: 0 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.gatcha-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.gatcha-cal-weekday {
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.gatcha-cal-day {
    min-height: 6.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.35rem 0.4rem 0.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gatcha-cal-day.is-outside {
    opacity: 0.42;
}

.gatcha-cal-day.is-today {
    border-color: rgba(124, 156, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(124, 156, 255, 0.22);
}

.gatcha-cal-day-num {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.gatcha-cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.gatcha-cal-event {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.22rem 0.38rem;
    border-radius: 0.45rem;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    font-size: 0.68rem;
    line-height: 1.25;
    color: rgba(255, 255, 255, 0.9);
}

.gatcha-cal-event.is-future {
    opacity: 0.72;
    border-style: dashed;
}

.gatcha-cal-event.is-current {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

.gatcha-cal-event-dot {
    width: 0.45rem;
    height: 0.45rem;
    margin-top: 0.12rem;
    border-radius: 999px;
    background: var(--accent);
    flex-shrink: 0;
}

.gatcha-cal-event-text {
    min-width: 0;
    word-break: break-word;
}

.gatcha-cal-footnote {
    margin: 0.85rem 0 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.42);
}

@media (max-width: 900px) {
    .gatcha-cal-grid {
        overflow-x: auto;
        grid-template-columns: repeat(7, minmax(6.5rem, 1fr));
    }
}

@media (max-width: 640px) {
    .gatcha-cal-day {
        min-height: 5.5rem;
    }

    .gatcha-cal-event {
        font-size: 0.62rem;
    }
}

/* —— Anime Status-Tabs & Schauend-Ansicht —— */

.anime-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.35rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--stroke);
}

.anime-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.85rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.anime-status-tab:hover,
.anime-status-tab:focus-visible {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
}

.anime-status-tab.is-active {
    color: #fdf2f8;
    background: linear-gradient(135deg, color-mix(in srgb, #f472b6 55%, #be185d) 0%, #be185d 100%);
    box-shadow: 0 8px 24px -12px color-mix(in srgb, #f472b6 45%, transparent);
}

.anime-status-tab-count {
    min-width: 1.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.22);
}

.anime-status-tab.is-active .anime-status-tab-count {
    background: rgba(255, 255, 255, 0.16);
}

.anime-watching-panel {
    margin-bottom: 1rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    overflow: hidden;
}

.anime-watching-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.anime-watching-toggle:hover,
.anime-watching-toggle:focus-visible {
    background: rgba(244, 114, 182, 0.06);
}

.anime-watching-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
    font-weight: 600;
}

.anime-watching-toggle-count {
    min-width: 1.4rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(244, 114, 182, 0.18);
    color: #f9a8d4;
}

.anime-watching-toggle-chevron {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--muted);
    transition: transform 0.18s ease;
    flex-shrink: 0;
}

.anime-watching-panel.is-collapsed .anime-watching-toggle-chevron {
    transform: rotate(-90deg);
}

.anime-watching-panel.is-collapsed .anime-watching-list {
    display: none;
}

.anime-watching-list {
    display: grid;
    gap: 0.85rem;
    padding: 0 0.85rem 0.85rem;
}

.anime-watching-panel .anime-watching-empty {
    border: 0;
    background: transparent;
}

.anime-watching-empty {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
}

.anime-watching-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem;
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--stroke);
    background: var(--card);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.anime-watching-row:hover,
.anime-watching-row:focus-visible {
    border-color: color-mix(in srgb, #f472b6 35%, var(--stroke));
    background: rgba(244, 114, 182, 0.06);
}

.anime-watching-poster-wrap {
    flex-shrink: 0;
}

.anime-watching-poster {
    display: block;
    width: 5.5rem;
    height: 7.85rem;
    object-fit: cover;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.anime-watching-poster--empty {
    display: block;
}

.anime-watching-main {
    min-width: 0;
}

.anime-watching-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 600;
    line-height: 1.25;
}

.anime-watching-subtitle {
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.anime-watching-meta {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.anime-progress--large {
    height: 6px;
    margin-top: 0;
}

.anime-watching-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    min-width: 9rem;
}

.anime-ep-stepper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.anime-ep-stepper--large {
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.03);
}

.anime-ep-stepper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--stroke);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.anime-ep-stepper--large .anime-ep-stepper-btn {
    width: 2.75rem;
    height: 2.75rem;
}

.anime-ep-stepper-btn:hover:not(:disabled),
.anime-ep-stepper-btn:focus-visible:not(:disabled) {
    border-color: color-mix(in srgb, #f472b6 40%, var(--stroke));
    background: rgba(244, 114, 182, 0.12);
}

.anime-ep-stepper-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.anime-ep-stepper-value {
    min-width: 4.5rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.anime-ep-stepper--large .anime-ep-stepper-value {
    font-size: 1.15rem;
}

.anime-watching-edit-btn {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.anime-watching-edit-btn:hover,
.anime-watching-edit-btn:focus-visible {
    color: var(--text);
    border-color: color-mix(in srgb, #f472b6 35%, var(--stroke));
}

@media (max-width: 760px) {
    .anime-watching-row {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "poster main"
            "actions actions";
    }

    .anime-watching-poster-wrap {
        grid-area: poster;
    }

    .anime-watching-main {
        grid-area: main;
    }

    .anime-watching-actions {
        grid-area: actions;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
    }
}

@media (max-width: 900px) {
    .anime-wrap:has(.anime-watching-panel:not([hidden])) .anime-cards {
        display: none;
    }
}

/* —— Haushalt-Statistiken —— */
.stats-wrap {
    max-width: 1040px;
}

.stats-page-header {
    margin-bottom: 1.25rem;
    text-align: center;
}

p.stats-page-eyebrow {
    margin: 0 0 0.35rem;
    max-width: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7dd3fc;
}

h1.stats-page-title {
    margin: 0 0 0.45rem;
    font-family: "Roboto", system-ui, sans-serif;
    font-weight: 500;
    font-size: clamp(1.65rem, 3.5vw, 2.1rem);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #f0f2f8 0%, #7dd3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

p.stats-page-lead {
    margin: 0 auto;
    max-width: 36em;
    font-size: 0.92rem;
    font-weight: 300;
    color: var(--muted);
}

.stats-error {
    margin-top: 1rem;
}

.stats-subnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
}

.stats-subnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.18);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.stats-subnav-link:hover,
.stats-subnav-link:focus-visible {
    color: #7dd3fc;
    border-color: color-mix(in srgb, #38bdf8 35%, var(--stroke));
    background: color-mix(in srgb, #38bdf8 8%, rgba(0, 0, 0, 0.18));
}

.stats-subnav-link.is-active {
    color: #f0f9ff;
    border-color: color-mix(in srgb, #38bdf8 55%, var(--stroke));
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.stats-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.stats-panel-title {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

p.stats-panel-lead {
    margin: 0;
    max-width: none;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--muted);
}

.stats-panel-badge {
    flex-shrink: 0;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #bae6fd;
    border: 1px solid color-mix(in srgb, #38bdf8 30%, var(--stroke));
    background: color-mix(in srgb, #38bdf8 10%, transparent);
}

.stats-temp-hero {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.15rem 1.2rem 1.2rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--stats-accent, #38bdf8) 22%, var(--stroke));
    --stats-accent: #38bdf8;
}

.stats-temp-hero--freeze { --stats-accent: #7dd3fc; }
.stats-temp-hero--cold { --stats-accent: #38bdf8; }
.stats-temp-hero--mild { --stats-accent: #5eead4; }
.stats-temp-hero--warm { --stats-accent: #fbbf77; }
.stats-temp-hero--hot { --stats-accent: #fb7185; }

@media (min-width: 860px) {
    .stats-temp-hero {
        grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
        align-items: stretch;
    }
}

.stats-temp-hero-label {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.stats-temp-hero-kpi {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.stats-temp-hero-value {
    font-size: clamp(2.4rem, 6vw, 3.2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--stats-accent);
}

.stats-temp-hero-unit {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--muted);
}

.stats-temp-delta {
    margin: 0.45rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.stats-temp-delta.is-up {
    color: #fbbf77;
}

.stats-temp-delta.is-down {
    color: #7dd3fc;
}

.stats-temp-meta {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.stats-temp-stale {
    color: #fbbf77;
}

.stats-temp-chart-card {
    min-width: 0;
}

.stats-range-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.stats-range-tab {
    appearance: none;
    cursor: pointer;
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--stroke);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.stats-range-tab:hover,
.stats-range-tab:focus-visible {
    color: #e2e8f0;
    border-color: color-mix(in srgb, var(--stats-accent, #38bdf8) 35%, var(--stroke));
}

.stats-range-tab.is-active {
    color: #f8fafc;
    border-color: color-mix(in srgb, var(--stats-accent, #38bdf8) 50%, var(--stroke));
    background: color-mix(in srgb, var(--stats-accent, #38bdf8) 18%, rgba(0, 0, 0, 0.18));
}

.stats-temp-chart-wrap {
    position: relative;
    height: min(260px, 42vw);
    min-height: 200px;
}

.stats-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.stats-kpi {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--stroke);
}

.stats-kpi-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stats-kpi-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

.stats-kpi-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--muted);
}

@media (max-width: 560px) {
    .stats-panel-header {
        flex-direction: column;
    }
}

