/* ==========================================================================
   GYP-Radeln – Design System
   Ein einziges Stylesheet für alle Seiten. Aufbau:
   1. Tokens   2. Basis   3. Layout   4. Navigation   5. Komponenten
   6. Seiten   7. Animationen   8. Utilities
   ========================================================================== */

/* ---------- 0. Schrift (selbst gehostet, OFL – siehe /fonts/OFL.txt) ---------- */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 1. Tokens ---------- */
:root {
    color-scheme: light dark;

    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Markenfarben */
    --green-50: #EEF7F1;
    --green-100: #D6EEDF;
    --green-200: #AEDCBF;
    --green-300: #7CC49B;
    --green-400: #4CA977;
    --green-500: #2E8B5A;
    --green-600: #237049;
    --green-700: #1C5A3B;
    --green-800: #17462F;
    --green-900: #12372A;
    --amber-400: #F5B83D;
    --amber-500: #E39B17;

    /* Semantik – hell */
    --bg: #F4F7F5;
    --surface: #FFFFFF;
    --surface-2: #F1F5F2;
    --surface-3: #E7EEE9;
    --border: #E0E8E2;
    --border-strong: #C9D5CD;
    --text: #0F2419;
    --text-muted: #4F6357;
    --text-subtle: #7C8E84;
    --primary: var(--green-600);
    --primary-hover: var(--green-700);
    --on-primary: #FFFFFF;
    --primary-soft: var(--green-50);
    --primary-soft-text: var(--green-700);
    --accent: var(--amber-500);
    --accent-soft: #FDF2DC;
    --accent-soft-text: #8A5A06;
    --danger: #C93B3B;
    --danger-hover: #AD2F2F;
    --danger-soft: #FCEBEB;
    --danger-soft-text: #A12C2C;
    --success-soft: var(--green-50);
    --success-soft-text: var(--green-700);
    --warning-soft: #FDF2DC;
    --warning-soft-text: #7D5208;
    --ring: color-mix(in srgb, var(--green-500) 35%, transparent);
    --heat-0: var(--surface-2);
    --heat-1: #CDEBD8;
    --heat-2: #8FD0A9;
    --heat-3: #47AE76;
    --heat-4: #237049;
    --overlay: rgba(9, 23, 16, 0.45);

    /* Form */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 2px rgba(15, 36, 25, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 36, 25, 0.07), 0 1px 2px rgba(15, 36, 25, 0.04);
    --shadow-md: 0 8px 20px -6px rgba(15, 36, 25, 0.14), 0 2px 6px rgba(15, 36, 25, 0.05);
    --shadow-lg: 0 24px 48px -12px rgba(15, 36, 25, 0.28);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --topbar-h: 64px;
    --tabbar-h: 64px;
    --container: 1040px;
    --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0A120E;
        --surface: #111B16;
        --surface-2: #17231D;
        --surface-3: #1E2D25;
        --border: #213129;
        --border-strong: #2E4338;
        --text: #E6EFE9;
        --text-muted: #A3B5AA;
        --text-subtle: #74887C;
        --primary: #4CC184;
        --primary-hover: #6AD29B;
        --on-primary: #05170D;
        --primary-soft: rgba(76, 193, 132, 0.12);
        --primary-soft-text: #7DD9A6;
        --accent: var(--amber-400);
        --accent-soft: rgba(245, 184, 61, 0.14);
        --accent-soft-text: #F7C964;
        --danger: #EF6461;
        --danger-hover: #F47F7C;
        --danger-soft: rgba(239, 100, 97, 0.13);
        --danger-soft-text: #F59A97;
        --success-soft: rgba(76, 193, 132, 0.12);
        --success-soft-text: #7DD9A6;
        --warning-soft: rgba(245, 184, 61, 0.13);
        --warning-soft-text: #F7C964;
        --heat-0: var(--surface-2);
        --heat-1: #1B4A33;
        --heat-2: #24734A;
        --heat-3: #33A065;
        --heat-4: #5CD392;
        --overlay: rgba(0, 0, 0, 0.6);
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
    }
}

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

[hidden] { display: none !important; }

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-wrap: balance;
}

h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
a:hover { color: var(--primary-hover); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

img, svg { display: block; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: var(--green-200); color: var(--green-900); }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 12px; }

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

/* ---------- 3. Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

.container-narrow { max-width: 680px; }

.main { flex: 1; }

.page {
    padding-top: 32px;
    padding-bottom: 56px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-header-text { min-width: 0; }

.eyebrow {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-subtle);
}

.lead {
    margin-top: 6px;
    color: var(--text-muted);
}

.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 32px 0 12px;
}
.section-title h2 { font-size: 1.05rem; }

/* ---------- 4. Navigation ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border);
    view-transition-name: topbar;
}

.topbar-inner {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.brand:hover { color: var(--text); }

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--green-500), var(--green-800));
    color: #D6F5E3;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), var(--shadow-sm);
    transition: transform 0.4s var(--ease-spring);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.topnav {
    display: flex;
    gap: 4px;
}

.topnav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 0.15s, background-color 0.15s;
}
.topnav-link .icon { width: 18px; height: 18px; }
.topnav-link:hover {
    color: var(--text);
    background: var(--surface-2);
}
.topnav-link.is-active {
    color: var(--primary-soft-text);
    background: var(--primary-soft);
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Account-Menü */
.menu { position: relative; }

.user-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.user-button:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.user-button-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-button-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-subtle);
    transition: transform 0.25s var(--ease-out);
}
.menu.is-open .user-button-chevron { transform: rotate(180deg); }

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.18s var(--ease-out), transform 0.22s var(--ease-out), visibility 0s 0.22s;
}
.menu.is-open .menu-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.18s var(--ease-out), transform 0.22s var(--ease-out), visibility 0s;
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
}
.menu-header-text { display: grid; min-width: 0; }
.menu-header-text strong {
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-header-text span { font-size: 0.78rem; color: var(--text-subtle); }

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.12s;
}
.menu-item .icon { width: 18px; height: 18px; color: var(--text-subtle); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--text); outline: none; }
.menu-item.is-active { color: var(--primary-soft-text); }
.menu-item-danger, .menu-item-danger .icon { color: var(--danger); }
.menu-item-danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu-separator { height: 1px; margin: 6px 4px; background: var(--border); }

/* Mobile Tab-Leiste */
.tabbar { display: none; }

@media (max-width: 720px) {
    .topnav { display: none; }
    .user-button-name { display: none; }
    .user-button { padding: 3px 8px 3px 3px; }

    .has-tabbar .main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

    .tabbar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--surface) 88%, transparent);
        backdrop-filter: saturate(1.6) blur(14px);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
        border-top: 1px solid var(--border);
        view-transition-name: tabbar;
    }

    .tabbar-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-subtle);
        font-size: 0.7rem;
        font-weight: 600;
    }
    .tabbar-link:hover { color: var(--text-muted); }

    .tabbar-icon {
        display: grid;
        place-items: center;
        width: 52px;
        height: 30px;
        border-radius: var(--radius-full);
        transition: background-color 0.2s, transform 0.3s var(--ease-spring);
    }
    .tabbar-icon .icon { width: 21px; height: 21px; }
    .tabbar-link:active .tabbar-icon { transform: scale(0.9); }
    .tabbar-link.is-active { color: var(--primary-soft-text); }
    .tabbar-link.is-active .tabbar-icon { background: var(--primary-soft); }
}

@media (max-width: 380px) {
    .layout-auth .topbar-actions .btn-ghost,
    .layout-landing .topbar-actions .btn-ghost { display: none; }
}

/* ---------- 5. Komponenten ---------- */

/* Buttons */
.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-border: var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-md);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s, transform 0.15s var(--ease-out);
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: scale(0.97); }
.btn .icon { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.55; pointer-events: none; }

.btn-primary {
    --btn-bg: var(--primary);
    --btn-fg: var(--on-primary);
    --btn-border: transparent;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover { --btn-bg: var(--primary-hover); box-shadow: var(--shadow-md); }

.btn-secondary { box-shadow: var(--shadow-xs); }
.btn-secondary:hover { --btn-bg: var(--surface-2); }

.btn-ghost {
    --btn-bg: transparent;
    --btn-border: transparent;
    --btn-fg: var(--text-muted);
}
.btn-ghost:hover, .btn-ghost.is-active { --btn-bg: var(--surface-2); --btn-fg: var(--text); }

.btn-danger {
    --btn-bg: var(--danger);
    --btn-fg: #FFFFFF;
    --btn-border: transparent;
}
.btn-danger:hover { --btn-bg: var(--danger-hover); }

.btn-danger-soft {
    --btn-bg: transparent;
    --btn-fg: var(--danger);
    --btn-border: color-mix(in srgb, var(--danger) 35%, transparent);
}
.btn-danger-soft:hover { --btn-bg: var(--danger-soft); }

.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 34px; min-height: 34px; }

/* Karten */
.card {
    position: relative;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card.card-flush { padding: 0; overflow: hidden; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.card-flush .card-header { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--border); }

.card-title { font-size: 1.05rem; font-weight: 700; }
.card-subtitle { margin-top: 2px; font-size: 0.88rem; color: var(--text-muted); }

/* Statistik-Kacheln */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}
.stat-icon .icon { width: 20px; height: 20px; }
.stat-icon-accent { background: var(--accent-soft); color: var(--accent-soft-text); }

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.stat-unit {
    margin-left: 3px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-subtle);
    letter-spacing: 0;
}

.stat-hero {
    color: #EAF8EF;
    border-color: transparent;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(124, 196, 155, 0.45) 0%, transparent 55%),
        linear-gradient(150deg, var(--green-600), var(--green-900));
    box-shadow: var(--shadow-md);
}
.stat-hero .stat-label { color: rgba(234, 248, 239, 0.8); }
.stat-hero .stat-unit { color: rgba(234, 248, 239, 0.7); }
.stat-hero .stat-icon { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
.stat-hero::after {
    content: '';
    position: absolute;
    right: -30px;
    bottom: -40px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 18px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

/* Formulare */
.form { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; }

.field-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text);
}

.field-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.field-row a { font-size: 0.85rem; }

.input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.input::placeholder { color: var(--text-subtle); opacity: 1; }
.input:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border-strong)); }
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
}

.input-wrap { position: relative; }
.input-wrap > .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-subtle);
    pointer-events: none;
    transition: color 0.15s;
}
.input-wrap > .icon + .input { padding-left: 42px; }
.input-wrap:focus-within > .icon { color: var(--primary); }

.input-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
    font-weight: 600;
    pointer-events: none;
}
.input-wrap:has(.input-suffix) .input { padding-right: 48px; }

.input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.input-lg { min-height: 58px; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.form-actions > .btn { flex: 1; }

.form-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Passwort-Stärke (gesteuert über data-score durch password-strength.js) */
.pw-strength { display: grid; gap: 6px; margin-top: 2px; }
.pw-strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-strength-seg {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    transition: background-color 0.3s;
}
.pw-strength[data-score="0"] .pw-strength-seg:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-score="1"] .pw-strength-seg:nth-child(-n+2) { background: #E8792B; }
.pw-strength[data-score="2"] .pw-strength-seg:nth-child(-n+3) { background: var(--amber-500); }
.pw-strength[data-score="3"] .pw-strength-seg:nth-child(-n+4) { background: var(--green-400); }
.pw-strength[data-score="4"] .pw-strength-seg:nth-child(-n+4) { background: var(--green-600); }

.pw-strength-label {
    display: block;
    height: 1.3em;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-subtle);
}
.pw-strength[data-score="0"] .pw-strength-label { color: var(--danger); }
.pw-strength[data-score="1"] .pw-strength-label { color: #D2691E; }
.pw-strength[data-score="2"] .pw-strength-label { color: var(--accent-soft-text); }
.pw-strength[data-score="3"] .pw-strength-label,
.pw-strength[data-score="4"] .pw-strength-label { color: var(--primary-soft-text); }

/* Hinweise */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    animation: pop-in 0.35s var(--ease-out);
}
.alert > .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.alert-error { background: var(--danger-soft); color: var(--danger-soft-text); }
.alert-success { background: var(--success-soft); color: var(--success-soft-text); }
.alert-warning { background: var(--warning-soft); color: var(--warning-soft-text); }
.alert-info { background: var(--surface-2); color: var(--text-muted); }

.alert-banner {
    align-items: center;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.alert-banner .btn { margin-left: auto; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--text-muted);
}
.badge .icon { width: 12px; height: 12px; }
.badge-primary { background: var(--primary-soft); color: var(--primary-soft-text); }
.badge-accent { background: var(--accent-soft); color: var(--accent-soft-text); }

/* Avatare */
.avatar {
    --hue: 150;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--hue) 55% 90%);
    color: hsl(var(--hue) 45% 28%);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.72rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar-xl { width: 76px; height: 76px; font-size: 1.5rem; }

@media (prefers-color-scheme: dark) {
    .avatar { background: hsl(var(--hue) 30% 22%); color: hsl(var(--hue) 60% 80%); }
}

/* Segmentierte Umschalter */
.segmented {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 4px;
    border-radius: var(--radius-md);
    background: var(--surface-3);
}
.segmented::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / var(--count, 2));
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateX(calc(var(--index, 0) * 100%));
    transition: transform 0.35s var(--ease-out);
}
.segmented-item {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}
.segmented-item .icon { width: 17px; height: 17px; }
.segmented-item:hover { color: var(--text); }
.segmented-item.is-active { color: var(--text); }

/* Ranglisten / Listen */
.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rank-row {
    display: grid;
    grid-template-columns: 32px auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    transition: background-color 0.15s;
}
.rank-row:first-child { border-top: 0; }
.rank-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.rank-row.is-me {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}

.rank-pos {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-subtle);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.rank-main { min-width: 0; display: grid; gap: 6px; }

.rank-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    min-width: 0;
    font-weight: 600;
}
.rank-name > span:first-child {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-meta { font-size: 0.8rem; color: var(--text-subtle); font-weight: 500; }

.rank-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.rank-value small { font-size: 0.78rem; font-weight: 600; color: var(--text-subtle); }

.rank-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    overflow: hidden;
}
.bar > span {
    display: block;
    height: 100%;
    width: var(--p, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green-400), var(--primary));
    transform-origin: left;
    animation: grow-x 1s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 50ms + 150ms);
}

/* Leerzustände */
.empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 48px 24px;
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    border-radius: 20px;
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}
.empty-icon .icon { width: 30px; height: 30px; }
.empty h1 { font-size: 1.4rem; }
.empty p { max-width: 420px; color: var(--text-muted); }
.empty .btn { margin-top: 12px; }

/* Dialoge */
.dialog {
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: auto;
}
.dialog-sm { width: min(380px, calc(100vw - 32px)); }

.dialog[open] { animation: dialog-in 0.32s var(--ease-out); }
.dialog[open]::backdrop { animation: fade-in 0.25s ease; }
.dialog.is-closing { animation: dialog-out 0.18s ease-in forwards; }
.dialog.is-closing::backdrop { animation: fade-out 0.18s ease-in forwards; }

.dialog::backdrop {
    background: var(--overlay);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 0;
}

.dialog-body { padding: 22px; }
.dialog-sm .dialog-body { padding-bottom: 8px; text-align: center; }

.dialog-title { font-size: 1.15rem; font-weight: 700; }
.dialog-subtitle { margin-top: 2px; font-size: 0.88rem; color: var(--text-muted); }
.dialog-text { margin-top: 6px; color: var(--text-muted); font-size: 0.93rem; }

.dialog-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}
.dialog-icon .icon { width: 24px; height: 24px; }
.dialog-icon.is-danger { background: var(--danger-soft); color: var(--danger); }

.dialog-actions {
    display: flex;
    gap: 10px;
    padding: 14px 22px 22px;
}
.dialog-actions > .btn { flex: 1; }

.dialog-close { margin: -6px -8px 0 0; color: var(--text-subtle); }

@media (max-width: 560px) {
    /* Auf dem Handy als Bottom-Sheet */
    .dialog:not(.dialog-sm) {
        width: 100vw;
        max-width: 100vw;
        margin: auto 0 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .dialog:not(.dialog-sm)[open] { animation: sheet-in 0.38s var(--ease-out); }
    .dialog:not(.dialog-sm).is-closing { animation: sheet-out 0.22s ease-in forwards; }
}

/* Details/Accordion */
.setting {
    border-top: 1px solid var(--border);
}
.setting:first-of-type { border-top: 0; }

.setting > summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    transition: background-color 0.15s;
}
.setting > summary::-webkit-details-marker { display: none; }
.setting > summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

.setting-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text-muted);
    flex-shrink: 0;
}
.setting-icon .icon { width: 19px; height: 19px; }

.setting-info { flex: 1; min-width: 0; }
.setting-label { display: block; font-size: 0.82rem; color: var(--text-subtle); font-weight: 500; }
.setting-value {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setting-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-subtle);
    transition: transform 0.25s var(--ease-out);
}
.setting[open] .setting-chevron { transform: rotate(180deg); }

.setting-body {
    padding: 4px 20px 20px 72px;
}
.setting[open] .setting-body { animation: rise 0.3s var(--ease-out); }

/* Inline-Bearbeitung (Team- & Benutzername)
   Text und Stift-Button bleiben beim Bearbeiten unsichtbar im Fluss, damit die
   Box ihre Größe behält; das Eingabefeld liegt absolut darüber (kein Layout-Shift). */
.inline-edit {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}
.inline-edit-text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.inline-edit-input {
    position: absolute;
    left: -9px;
    top: 50%;
    z-index: 1;
    display: none;
    height: calc(100% + 6px);
    min-width: 0;
    padding: 0 8px;
    margin: 0;
    transform: translateY(-50%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    line-height: 1;
    letter-spacing: inherit;
    color: inherit;
    box-shadow: 0 0 0 4px var(--ring);
}
.inline-edit-input:focus { outline: none; }
.inline-edit.is-editing .inline-edit-text,
.inline-edit.is-editing .inline-edit-btn { visibility: hidden; }
.inline-edit.is-editing .inline-edit-input { display: block; }

.inline-edit-btn { display: none; }
.inline-edit.is-editing .inline-edit-input { display: block; }

.inline-edit-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-subtle);
    transition: background-color 0.15s, color 0.15s;
}
.inline-edit-btn .icon { width: 16px; height: 16px; }
.inline-edit-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 6. Seiten ---------- */

/* Auth-Seiten */
.auth {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - var(--topbar-h));
    padding: 32px var(--gutter) 48px;
    background:
        radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, var(--green-300) 22%, transparent), transparent 70%),
        radial-gradient(50% 45% at 90% 90%, color-mix(in srgb, var(--amber-400) 14%, transparent), transparent 70%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.auth-head {
    display: grid;
    justify-items: center;
    gap: 6px;
    margin-bottom: 24px;
    text-align: center;
}
.auth-head .brand-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
    border-radius: 16px;
}
.auth-head .brand-mark .icon { width: 28px; height: 28px; }
.auth-head h1 { font-size: 1.5rem; }
.auth-head p { color: var(--text-muted); font-size: 0.93rem; }

@media (max-width: 480px) {
    .auth { place-items: start center; padding-top: 24px; }
    .auth-card { padding: 24px 20px; }
}

/* Startseite */
.layout-landing {
    background:
        radial-gradient(900px 600px at 85% 0%, color-mix(in srgb, var(--green-300) 26%, transparent), transparent 70%),
        radial-gradient(700px 500px at 0% 70%, color-mix(in srgb, var(--amber-400) 13%, transparent), transparent 70%),
        var(--bg);
}

.hero {
    padding: 72px 0 64px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 48px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    box-shadow: var(--shadow-xs);
}
.pill-dot {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}
.pill-dot .icon { width: 13px; height: 13px; }

.hero h1 {
    font-size: clamp(2.3rem, 1.4rem + 3.6vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--green-500), var(--green-300) 60%, var(--amber-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-lead {
    max-width: 520px;
    margin: 20px 0 32px;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Dekorative App-Vorschau */
.preview {
    position: relative;
    display: grid;
    gap: 14px;
    max-width: 380px;
    justify-self: center;
    width: 100%;
}
.preview .card { padding: 18px; box-shadow: var(--shadow-lg); }
.preview-km { animation: float 6s ease-in-out infinite; }
.preview-cal { margin-left: 32px; animation: float 6s ease-in-out -3s infinite; }
.preview-cal .preview-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 12px;
}
.preview-cells span {
    aspect-ratio: 1;
    border-radius: 6px;
    background: var(--heat-0);
    animation: pop-in 0.5s var(--ease-spring) both;
    animation-delay: calc(var(--i) * 35ms + 300ms);
}
.preview-rank {
    margin-right: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: float 6s ease-in-out -1.5s infinite;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 72px;
}
.feature { transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature h3 { margin: 4px 0 6px; font-size: 1.02rem; }
.feature p { font-size: 0.92rem; color: var(--text-muted); }
.feature-step {
    position: absolute;
    top: 20px;
    right: 22px;
    font-size: 2rem;
    font-weight: 800;
    color: var(--surface-3);
    line-height: 1;
}

.site-footer {
    padding: 24px 0 32px;
    border-top: 1px solid var(--border);
    color: var(--text-subtle);
    font-size: 0.85rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .hero { padding: 40px 0 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .preview { max-width: 340px; }
    .features { grid-template-columns: 1fr; padding-bottom: 48px; }
}

@media (max-width: 480px) {
    .hero-actions .btn { flex: 1 1 100%; }
}

/* Dashboard-Kalender */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekday {
    padding-bottom: 2px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-subtle);
}

.cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    min-width: 0;
    height: 76px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--heat-0);
    color: var(--text);
    text-align: left;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
    animation: pop-in 0.45s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 18ms);
}
button.cal-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--primary) 50%, transparent);
}
button.cal-day:active { transform: scale(0.96); }
button.cal-day:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--primary); }

.cal-day-num { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.cal-day-km {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.cal-day-km small { margin-left: 1px; font-size: 0.68rem; font-weight: 600; opacity: 0.75; }

.cal-day-add {
    align-self: center;
    margin: auto;
    color: var(--text-subtle);
    opacity: 0;
    transition: opacity 0.15s;
}
.cal-day-add .icon { width: 18px; height: 18px; }
button.cal-day:hover .cal-day-add, button.cal-day:focus-visible .cal-day-add { opacity: 1; }

.cal-day.level-1 { background: var(--heat-1); }
.cal-day.level-2 { background: var(--heat-2); }
.cal-day.level-3 { background: var(--heat-3); color: #FFFFFF; }
.cal-day.level-4 { background: var(--heat-4); color: #FFFFFF; }
.cal-day.level-3 .cal-day-num, .cal-day.level-4 .cal-day-num { color: rgba(255, 255, 255, 0.8); }
@media (prefers-color-scheme: dark) {
    .cal-day.level-4 { color: #05170D; }
    .cal-day.level-4 .cal-day-num { color: rgba(5, 23, 13, 0.7); }
}

.cal-day.is-today { box-shadow: 0 0 0 2px var(--accent); }
.cal-day.is-today .cal-day-num::after {
    content: 'Heute';
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #2B1B00;
    font-size: 0.62rem;
    font-weight: 700;
    vertical-align: 1px;
}

.cal-day.is-outside {
    background: transparent;
    border: 1px dashed var(--border);
}
.cal-day.is-outside .cal-day-num { color: var(--text-subtle); opacity: 0.6; }
.cal-day.is-future { opacity: 0.55; }

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-subtle);
}
.calendar-legend i {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--heat-0);
}
.calendar-legend i.level-1 { background: var(--heat-1); }
.calendar-legend i.level-2 { background: var(--heat-2); }
.calendar-legend i.level-3 { background: var(--heat-3); }
.calendar-legend i.level-4 { background: var(--heat-4); }

@media (max-width: 560px) {
    .calendar { gap: 5px; }
    .cal-day { height: auto; aspect-ratio: 1 / 1.15; padding: 6px 5px; border-radius: 10px; align-items: center; }
    .cal-day-num { font-size: 0.72rem; }
    .cal-day-km { font-size: 0.8rem; }
    .cal-day-km small { display: none; }
    .cal-day.is-today .cal-day-num::after { display: none; }
    .card-calendar { padding: 18px 14px; }
}

/* Touren-Liste im Tagesdialog */
.tour-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    gap: 8px;
}
.tour-list:empty { display: none; }
.tour-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    animation: rise 0.3s var(--ease-out) both;
    transition: border-color 0.15s, background-color 0.15s;
}
.tour-item.is-editing { border-color: var(--primary); background: var(--primary-soft); }
.tour-item .icon-bubble {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--surface);
    color: var(--primary-soft-text);
}
.tour-item .icon-bubble .icon { width: 17px; height: 17px; }
.tour-dist { flex: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tour-actions { display: flex; gap: 4px; }
.tour-actions .btn-ghost:hover { --btn-bg: var(--surface); }
.tour-actions .btn-delete:hover { --btn-fg: var(--danger); }

.day-total {
    display: flex;
    justify-content: space-between;
    margin: -6px 2px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.day-total strong { color: var(--text); }

/* Rangliste */
.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
}

.podium-place {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 20px 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 0;
    animation: rise 0.5s var(--ease-out) both;
}
.podium-place.place-1 { order: 2; padding-top: 28px; padding-bottom: 28px; animation-delay: 0.05s; }
.podium-place.place-2 { order: 1; animation-delay: 0.15s; }
.podium-place.place-3 { order: 3; animation-delay: 0.25s; }
.podium-place.place-1 {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%);
    box-shadow: var(--shadow-md);
}
.podium-place.is-me { box-shadow: 0 0 0 2px var(--primary), var(--shadow-md); }

.podium-avatar { position: relative; margin-bottom: 4px; }
.podium-medal {
    position: absolute;
    right: -6px;
    bottom: -4px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #FFFFFF;
}
.place-1 .podium-medal { background: linear-gradient(140deg, #F7C64B, #D99211); color: #3A2600; }
.place-2 .podium-medal { background: linear-gradient(140deg, #C5CED6, #8D99A5); }
.place-3 .podium-medal { background: linear-gradient(140deg, #D9A272, #A86B3A); }
.podium-crown { color: var(--accent); margin-bottom: -2px; animation: bob 2.6s ease-in-out infinite; }
.podium-crown .icon { width: 22px; height: 22px; }

.podium-name {
    max-width: 100%;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-value { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.podium-value small { font-size: 0.78rem; font-weight: 600; color: var(--text-subtle); }

@media (max-width: 560px) {
    .podium { gap: 8px; }
    .podium-place { padding: 14px 6px; }
    .podium-place.place-1 { padding-top: 20px; padding-bottom: 20px; }
    .podium-place .avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
    .podium-name { font-size: 0.82rem; }
    .podium-value { font-size: 0.98rem; }
    .rank-row { grid-template-columns: 24px auto minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; }
    .rank-row .avatar { width: 34px; height: 34px; font-size: 0.75rem; }
}

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

/* Team */
.team-title {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.team-title h1 { min-width: 0; }

.team-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 18px;
    background: linear-gradient(140deg, var(--green-400), var(--green-700));
    color: #FFFFFF;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.team-mark .icon { width: 28px; height: 28px; }

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border));
    border-radius: var(--radius-lg);
}
.danger-zone p { font-size: 0.88rem; color: var(--text-muted); }
.danger-zone strong { display: block; color: var(--text); font-size: 0.95rem; }

/* Team-Auswahl */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.toolbar .input-wrap { flex: 1; max-width: 420px; }

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

.team-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: left;
    animation: rise 0.4s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 40ms);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
}
.team-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: var(--shadow-md);
}
.team-card:active { transform: scale(0.98); }
.team-card .avatar { border-radius: 12px; }
.team-card-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.team-card-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-card-meta { display: flex; gap: 12px; font-size: 0.82rem; color: var(--text-subtle); font-weight: 500; }
.team-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.team-card-meta .icon { width: 14px; height: 14px; }
.team-card-go {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-subtle);
    transition: background-color 0.2s, color 0.2s, transform 0.25s var(--ease-out);
}
.team-card-go .icon { width: 16px; height: 16px; }
.team-card:hover .team-card-go { background: var(--primary); color: var(--on-primary); transform: translateX(2px); }

/* Einstellungen */
.profile-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
}
.profile-text { flex: 1; min-width: 0; }
.profile-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.profile-email { color: var(--text-muted); font-size: 0.93rem; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 560px) {
    .setting-body { padding-left: 20px; }
    .profile-card { padding: 20px; gap: 14px; }
    .profile-card .avatar-xl { width: 60px; height: 60px; font-size: 1.2rem; }
}

/* Offline */
.offline {
    display: grid;
    place-items: center;
    min-height: 80dvh;
}

/* ---------- 7. Animationen ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 0.16s ease-in both fade-out; }
::view-transition-new(root) { animation: 0.28s var(--ease-out) both rise-soft; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes rise-soft { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.92); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-4deg); } }

/* Einblenden beim Laden, gestaffelt über --i */
.reveal {
    animation: rise 0.55s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    @view-transition { navigation: none; }
}

/* ---------- 8. Utilities ---------- */
.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.card-row p { font-size: 0.88rem; color: var(--text-muted); }
.setting-value.is-masked { letter-spacing: 0.15em; }

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }

@media (max-width: 560px) {
    .hide-sm { display: none !important; }
    .page { padding-top: 20px; }
    .page-header { margin-bottom: 18px; }
    .card { padding: 18px; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-grid > .stat:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
    .page-header > .segmented { width: 100%; }
    .stat { padding: 14px; }
    .stat-icon { width: 32px; height: 32px; margin-bottom: 8px; border-radius: 9px; }
    .stat-icon .icon { width: 17px; height: 17px; }
    .stat-value { font-size: 1.35rem; }
    .stat-label { font-size: 0.78rem; }
    .page-actions { width: 100%; }
    .page-actions > .btn { flex: 1; }
}
