/* =====================================================================================
   Runde 3 · Team T6 · Design-System
   Loaded right after site.css in _Layout, _AuthLayout and _PublicLayout. Contents:
    1. Global tokens, readability, contrast, focus, touch, overflow
    2. App shell: topbar logo, profile button, sidebar admin, footer (§ 312k), focus mode
    3. Chips          .a4f-chip, --premium, --locked, --status-{open|draw|sent|confirmed|past|archived}
    4. Plan lock      _PlanLock: chip + ONE button, same height / baseline
    5. Teaser         _LockedTeaser  (.a4f-teaser)
    6. Empty state    _EmptyState    (.a4f-empty)
    7. Stepper        .a4f-stepper > .a4f-stepper__step.is-done|is-current|is-upcoming
    8. Action bar     .a4f-actionbar (fixed on the phone, with safe area)
    9. Sheet          .a4f-sheet  (open: [data-a4f-sheet-open=ID], a4f-ui.js)
   10. Confirm dialog dialog.a4f-dialog ([data-confirm], a4f-ui.js)
   11. Toast          A4F.toast(text, kind)
   12. Date/time picker (a4f-datetime.js)
   ===================================================================================== */

/* ---------- 1. Global ---------- */
:root {
    color-scheme: dark;
    --a4f-focus: #e8e8e8;
    --a4f-focus-glow: rgba(255, 107, 0, .35);
    --a4f-muted: #a0a0a0;
    --a4f-legal: #9a9a9a;
    --a4f-bottom-nav-h: 64px;
    --a4f-z-nav: 100;
    --a4f-z-actionbar: 95;
    --a4f-z-sheet: 1090;
    --a4f-z-dialog: 1100;
}

/* Native pickers stay readable on dark until a4f-datetime.js takes over */
input::-webkit-calendar-picker-indicator {
    filter: invert(.8);
    cursor: pointer;
}

.form-text,
.text-muted {
    color: var(--a4f-muted) !important;
}

.form-text {
    font-family: var(--font-body);
    font-size: .875rem;
    line-height: 1.5;
}

.text-secondary {
    color: var(--a4f-muted) !important;
}

/* Foreign blue (#0d6efd / #0077cc / .link-primary) -> calm grey, hover orange */
.link-primary,
a.link-primary {
    color: var(--white-dim) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

.link-primary:hover,
a.link-primary:hover {
    color: var(--accent) !important;
}

a.text-primary,
.text-primary {
    color: var(--accent) !important;
}

code {
    color: var(--accent-hover);
    background: rgba(255, 107, 0, .08);
    padding: .1em .35em;
    border-radius: 3px;
    font-family: var(--font-mono);
    overflow-wrap: anywhere;
}

pre,
table {
    max-width: 100%;
}

pre {
    overflow-x: auto;
}

/* Focus: visible ring only for keyboard users, no jumping buttons */
.btn:focus {
    box-shadow: none;
    transform: none;
}

.btn:focus-visible,
.fab:focus-visible,
.bottom-nav__item:focus-visible,
.app-nav-link:focus-visible,
.app-profile-btn:focus-visible,
.dropdown-item:focus-visible,
.a4f-chip:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--a4f-focus-glow);
}

/* Touch targets */
@media (pointer: coarse) {
    .btn,
    .btn-sm,
    [data-copy] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* No sideways scrolling */
.app-main {
    min-width: 0;
}

.app-content {
    min-width: 0;
    max-width: 100%;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

/* ---------- 2. App shell ---------- */
.app-topbar-logo {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--white);
    text-decoration: none;
}

.app-topbar-logo .app-logo-icon {
    width: 30px;
    height: 30px;
}

.app-topbar-logo__text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: .06em;
    line-height: 1;
}

.app-topbar-logo:hover {
    color: var(--accent);
}

@media (max-width: 991.98px) {
    .app-topbar-logo {
        display: inline-flex;
    }

    .app-topbar {
        padding-left: 16px;
        padding-right: 16px;
        padding-top: env(safe-area-inset-top);
        height: calc(60px + env(safe-area-inset-top));
    }
}

/* Profile button: name + plan, chevron; aria-label says "Profilmenü: Name, Tarif X" */
.app-profile-btn {
    min-height: 44px;
    max-width: 100%;
}

.app-profile-btn__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    min-width: 0;
}

.app-profile-btn__name {
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .875rem;
}

.app-avatar-circle {
    flex-shrink: 0;
    border-radius: 50%;
}

.app-profile-menu {
    min-width: 220px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    font-size: .95rem;
    text-align: left;
    background: none;
    border: 0;
}

.dropdown-item:focus {
    background: var(--black-lighter);
    color: var(--white);
}

.dropdown-item__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dropdown-item--admin,
.dropdown-item--admin:hover {
    color: var(--cyan);
}

@media (max-width: 380px) {
    .app-profile-btn__text {
        display: none;
    }

    .app-topbar {
        gap: 8px;
        padding-inline: 12px;
    }

    .app-topbar-right {
        gap: 8px;
    }

    .app-profile-btn {
        padding: 6px 8px;
        gap: 6px;
    }
}

@media (max-width: 575.98px) {
    .app-profile-btn__name {
        max-width: 10ch;
    }
}

/* Sidebar */
.app-nav-icon svg,
.bottom-nav__icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-nav-link--admin,
.app-nav-link--admin:hover {
    color: var(--cyan);
}

.app-nav-link--admin::before {
    background: var(--cyan);
}

.app-nav-link--admin.active {
    color: var(--cyan);
    border-color: var(--cyan);
}

/* Bottom nav: 5 entries, fits 320 px, labels may wrap to two lines */
.bottom-nav {
    height: calc(var(--a4f-bottom-nav-h) + env(safe-area-inset-bottom));
    z-index: var(--a4f-z-nav);
}

.bottom-nav__inner {
    max-width: 640px;
}

.bottom-nav__item {
    min-width: 0;
    padding: 6px 2px;
    gap: 3px;
    position: relative;
}

.bottom-nav__icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0;
}

.bottom-nav__item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: var(--accent);
}

.bottom-nav__label {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* FAB: above the bottom nav, never over the footer link (footer has bottom padding) */
.fab {
    bottom: calc(var(--a4f-bottom-nav-h) + env(safe-area-inset-bottom) + 16px);
    border-radius: 50%;
}

/* Footer of every app page (§ 312k BGB: cancel link always reachable) */
.app-footer {
    padding: 8px var(--spacing-md) 16px;
    border-top: 1px solid var(--gray-dark);
    text-align: center;
}

.app-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 2px;
}

.app-footer__links a {
    color: var(--a4f-legal);
    font-size: .8125rem;
    padding: 12px 6px;
    text-decoration: none;
    line-height: 1.2;
}

.app-footer__links a:hover,
.app-footer__links a:focus-visible {
    color: var(--white);
    text-decoration: underline;
}

.app-footer__sep {
    color: #6a6a6a;
    font-size: .8125rem;
}

.app-sidebar-footer {
    border-top: 0;
}

@media (max-width: 991.98px) {
    .app-content {
        padding-bottom: 24px;
    }

    /* Nothing below the bottom nav, FAB or a fixed action bar: the footer (last element)
       keeps this distance, so it stays readable above the bottom nav */
    .has-bottom-nav .app-footer,
    .a4f-focus-mode .app-footer {
        padding-bottom: calc(140px + env(safe-area-inset-bottom));
    }
}

/* Focus mode (ViewData["FocusMode"] = true: wizard, edit) */
.a4f-focus-mode .bottom-nav,
.a4f-focus-mode .fab {
    display: none !important;
}

/* Help modal (moved from an inline <style>) */
.help-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--a4f-z-dialog);
}

.help-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .8);
}

.help-modal__content {
    position: relative;
    background: var(--black-lighter);
    border: 1px solid var(--gray-dark);
    width: calc(100% - 2rem);
    max-width: 480px;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

.help-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-dark);
}

.help-modal__title {
    font-size: 1.4rem;
    margin: 0;
}

.help-modal__close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.75rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    line-height: 1;
}

.help-modal__body {
    padding: 1.25rem;
}

.help-modal__footer {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.auth-lang-btn__chevron {
    margin-left: 4px;
}

/* ---------- 3. Chips ---------- */
.a4f-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--gray);
    border-radius: 999px;
    background: var(--black-lighter);
    color: var(--white);
    font-family: var(--font-body);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    text-transform: none;
}

.a4f-chip--premium {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

.a4f-chip--locked {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.a4f-chip--status-open {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(34, 197, 94, .45);
    color: #4ade80;
}

.a4f-chip--status-draw {
    background: rgba(139, 92, 246, .16);
    border-color: rgba(167, 139, 250, .5);
    color: #c4b5fd;
}

.a4f-chip--status-sent {
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .45);
    color: #fbbf24;
}

.a4f-chip--status-confirmed {
    background: #22c55e;
    border-color: #22c55e;
    color: #0a0a0a;
}

.a4f-chip--status-past,
.a4f-chip--status-archived {
    background: var(--black-lighter);
    border-color: var(--gray);
    color: var(--a4f-muted);
}

.a4f-chip--status-archived {
    border-style: dashed;
}

/* ---------- 4. Plan lock (_PlanLock): chip + ONE button on one baseline ---------- */
.plan-lock {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    vertical-align: middle;
    line-height: 1;
}

.plan-lock .a4f-chip,
.plan-lock .plan-lock__badge {
    height: 32px;
    padding: 0 12px;
    font-size: .8125rem;
    margin: 0;
}

.a4f-lock-btn,
.plan-lock .plan-lock__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-height: 32px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--gray);
    border-radius: 999px;
    background: transparent;
    color: var(--white);
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
}

.a4f-lock-btn:hover,
.plan-lock .plan-lock__preview:hover {
    border-color: var(--white);
    color: var(--white);
}

.a4f-lock-btn:focus-visible,
.plan-lock .plan-lock__preview:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: 3px;
}

@media (pointer: coarse) {
    .plan-lock .a4f-chip,
    .plan-lock .plan-lock__badge,
    .a4f-lock-btn,
    .plan-lock .plan-lock__preview {
        height: 44px;
        min-height: 44px;
    }
}

/* ---------- 5. Locked teaser (_LockedTeaser) ---------- */
.a4f-teaser {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 16px;
    margin: 12px 0;
    border: 1px dashed var(--gray);
    background: linear-gradient(135deg, rgba(255, 107, 0, .06), transparent 60%), var(--black-light);
}

.a4f-teaser__body {
    flex: 1 1 260px;
    min-width: 0;
}

.a4f-teaser__title {
    margin: 8px 0 2px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--white);
}

.a4f-teaser__text {
    margin: 0;
    color: var(--a4f-muted);
    font-size: .9rem;
}

.a4f-teaser__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 575.98px) {
    .a4f-teaser__actions {
        width: 100%;
    }

    .a4f-teaser__actions .btn {
        flex: 1 1 0;
    }
}

/* ---------- 6. Empty state (_EmptyState) ---------- */
.a4f-empty {
    text-align: center;
    padding: 48px 16px;
    border: 1px dashed var(--gray-dark);
    background: var(--black-light);
}

.a4f-empty__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--accent);
}

.a4f-empty__icon svg {
    width: 100%;
    height: 100%;
}

.a4f-empty__icon--text {
    font-size: 2.5rem;
    line-height: 56px;
}

.a4f-empty__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: .04em;
    margin: 0 0 6px;
    color: var(--white);
}

.a4f-empty__text {
    max-width: 44ch;
    margin: 0 auto 20px;
    color: var(--a4f-muted);
}

/* ---------- 7. Stepper ---------- */
.a4f-stepper {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: a4f-step;
}

.a4f-stepper__step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--a4f-muted);
    font-size: .9rem;
    position: relative;
}

.a4f-stepper__marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: 2px solid var(--gray);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 700;
    color: var(--a4f-muted);
    background: var(--black);
}

.a4f-stepper__label {
    color: inherit;
}

a.a4f-stepper__label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.a4f-stepper__step.is-done,
.a4f-stepper__step--done {
    color: var(--white);
}

.a4f-stepper__step.is-done .a4f-stepper__marker,
.a4f-stepper__step--done .a4f-stepper__marker {
    background: var(--success);
    border-color: var(--success);
    color: #0a0a0a;
}

.a4f-stepper__step.is-current,
.a4f-stepper__step--current {
    color: var(--white);
    font-weight: 700;
}

.a4f-stepper__step.is-current .a4f-stepper__marker,
.a4f-stepper__step--current .a4f-stepper__marker {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

@media (min-width: 768px) {
    .a4f-stepper {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }

    .a4f-stepper__step {
        flex: 1 1 0;
        min-width: 0;
    }

    .a4f-stepper__step:not(:last-child)::after {
        content: '';
        flex: 1 1 auto;
        height: 2px;
        min-width: 16px;
        margin: 0 10px;
        background: var(--gray-dark);
    }

    .a4f-stepper__step.is-done:not(:last-child)::after,
    .a4f-stepper__step--done:not(:last-child)::after {
        background: var(--success);
    }

    .a4f-stepper__label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ---------- 8. Action bar ---------- */
.a4f-actionbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-top: 16px;
    border-top: 1px solid var(--gray-dark);
    background: var(--black);
}

@media (min-width: 992px) {
    .a4f-actionbar {
        position: sticky;
        bottom: 0;
        z-index: 5;
    }
}

@media (max-width: 991.98px) {
    .a4f-actionbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--a4f-z-actionbar);
        margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: rgba(10, 10, 10, .96);
        border-top: 1px solid var(--gray);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, .5);
    }

    /* Above the bottom nav when it is visible */
    .has-bottom-nav:not(.a4f-focus-mode) .a4f-actionbar {
        bottom: calc(var(--a4f-bottom-nav-h) + env(safe-area-inset-bottom));
        padding-bottom: 10px;
    }

    .a4f-actionbar > .btn {
        flex: 1 1 0;
    }

    .a4f-actionbar ~ .fab,
    body:has(.a4f-actionbar) .fab {
        display: none;
    }
}

/* ---------- 9. Sheet (.a4f-sheet) ---------- */
.a4f-sheet {
    position: fixed;
    inset: 0;
    z-index: var(--a4f-z-sheet);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.a4f-sheet[hidden] {
    display: none;
}

.a4f-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .65);
}

.a4f-sheet__panel {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85dvh;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--black-lighter);
    border: 1px solid var(--gray);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .6);
    animation: a4fSheetUp .2s ease-out;
}

.a4f-sheet__handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 2px;
    background: var(--gray-light);
}

.a4f-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.a4f-sheet__title {
    margin: 0;
    font-size: 1.5rem;
}

.a4f-sheet__close {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--white);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

@media (min-width: 768px) {
    .a4f-sheet {
        align-items: center;
    }

    .a4f-sheet__panel {
        border-radius: 12px;
        border-bottom: 1px solid var(--gray);
        padding-bottom: 20px;
        animation-name: a4fFadeIn;
    }

    .a4f-sheet__handle {
        display: none;
    }
}

@keyframes a4fSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes a4fFadeIn {
    from { opacity: 0; transform: scale(.98); }
    to { opacity: 1; transform: none; }
}

body.a4f-scroll-lock {
    overflow: hidden;
    overscroll-behavior: none;
}

/* ---------- 10. Confirm dialog ---------- */
dialog.a4f-dialog {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--gray);
    background: var(--black-lighter);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

dialog.a4f-dialog::backdrop {
    background: rgba(0, 0, 0, .75);
}

.a4f-dialog__body {
    padding: 20px 20px 8px;
}

.a4f-dialog__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.a4f-dialog__text {
    margin: 0;
    color: var(--white);
    white-space: pre-line;
}

.a4f-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 20px 20px;
}

@media (max-width: 575.98px) {
    .a4f-dialog__actions .btn {
        flex: 1 1 0;
    }
}

/* ---------- 11. Toast ---------- */
.toast-container {
    left: auto;
    max-width: calc(100vw - 32px);
}

.toast {
    min-width: 0;
    width: min(400px, calc(100vw - 32px));
    max-width: none;
    font-family: var(--font-body);
}

.toast__title {
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 0;
}

.toast__message {
    font-size: .875rem;
}

.toast__close {
    width: 32px;
    height: 32px;
    margin: -6px -8px 0 0;
}

@media (max-width: 991.98px) {
    .toast-container {
        right: 16px;
        bottom: calc(var(--a4f-bottom-nav-h) + env(safe-area-inset-bottom) + 12px);
    }
}

/* ---------- 12. Date / time picker (a4f-datetime.js) ---------- */
.a4f-dt {
    position: relative;
    display: block;
}

/* The calendar / clock button is 44 px wide at right: 2px -> 48 px padding (Q40: no wasted text width) */
.a4f-dt__input.form-control {
    padding-right: 48px;
}

.a4f-dt__btn {
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--white-dim);
    cursor: pointer;
    border-radius: 4px;
}

.a4f-dt__btn:hover {
    color: var(--accent);
}

.a4f-dt__btn:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: -2px;
}

.a4f-dt__btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.a4f-dt__input[aria-invalid="true"] {
    border-color: var(--error);
}

.a4f-dt__hint {
    display: block;
    margin-top: 6px;
    font-size: .875rem;
    color: var(--warning);
}

.a4f-dt__hint:empty {
    display: none;
}

.a4f-dt__error {
    display: block;
    margin-top: 6px;
    font-size: .8125rem;
    color: #f87171;
}

.a4f-dt__error:empty {
    display: none;
}

/* Quick picks */
.a4f-dt-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.a4f-dt-quick__chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--gray);
    border-radius: 999px;
    background: var(--black-light);
    color: var(--white);
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.a4f-dt-quick__chip:hover {
    border-color: var(--accent);
}

.a4f-dt-quick__chip:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: 2px;
}

.a4f-dt-quick__chip[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

.a4f-dt-quick__chip[aria-disabled="true"] {
    color: #7a7a7a;
    border-style: dashed;
    cursor: not-allowed;
    text-decoration: line-through;
}

.a4f-dt-quick__reason {
    flex-basis: 100%;
    font-size: .8125rem;
    color: var(--a4f-muted);
}

.a4f-dt-quick__reason:empty {
    display: none;
}

@media (pointer: coarse) {
    .a4f-dt-quick__chip {
        min-height: 44px;
    }
}

/* Popover / sheet root */
.a4f-dt-layer {
    position: fixed;
    inset: 0;
    z-index: var(--a4f-z-sheet);
}

.a4f-dt-layer.is-inline {
    position: static;
    inset: auto;
}

.a4f-dt-layer.is-inline .a4f-dt-pop {
    z-index: var(--a4f-z-sheet);
    padding: 4px;
}

.a4f-dt-layer__backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
}

.a4f-dt-pop {
    position: fixed;
    width: 320px;
    max-width: calc(100vw - 16px);
    padding: 12px;
    background: var(--black-lighter);
    border: 1px solid var(--gray);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
    color: var(--white);
    font-family: var(--font-body);
    animation: a4fFadeIn .15s ease-out;
}

.a4f-dt-layer.is-sheet .a4f-dt-layer__backdrop {
    background: rgba(0, 0, 0, .65);
}

.a4f-dt-layer.is-sheet .a4f-dt-pop {
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 85dvh;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    animation: a4fSheetUp .2s ease-out;
}

.a4f-dt-pop__handle {
    display: none;
    width: 40px;
    height: 4px;
    margin: 4px auto 10px;
    border-radius: 2px;
    background: var(--gray-light);
}

.a4f-dt-layer.is-sheet .a4f-dt-pop__handle {
    display: block;
}

.a4f-dt-pop__label {
    margin: 0 0 6px;
    font-size: .8125rem;
    color: var(--a4f-muted);
    text-align: center;
}

.a4f-dt-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.a4f-dt-cal__month {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.a4f-dt-cal__nav,
.a4f-dt-pop__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--gray);
    border-radius: 6px;
    background: var(--black);
    color: var(--white);
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}

.a4f-dt-cal__nav:hover,
.a4f-dt-pop__btn:hover {
    border-color: var(--white);
}

.a4f-dt-pop__btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #0a0a0a;
}

.a4f-dt-cal__grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    table-layout: fixed;
}

.a4f-dt-cal__grid th {
    padding: 4px 0;
    font-size: .75rem;
    font-weight: 600;
    color: var(--a4f-muted);
    text-align: center;
}

.a4f-dt-cal__grid td {
    padding: 0;
    text-align: center;
}

.a4f-dt-day {
    width: 100%;
    min-width: 36px;
    height: 40px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--white);
    font-family: var(--font-body);
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.a4f-dt-day:hover {
    background: var(--gray-dark);
}

.a4f-dt-day[aria-current="date"] {
    box-shadow: inset 0 0 0 2px var(--white-dim);
}

.a4f-dt-day.is-in-range {
    background: rgba(255, 107, 0, .18);
}

.a4f-dt-day[aria-selected="true"] {
    background: #ff6b00;
    color: #0a0a0a;
    font-weight: 700;
}

.a4f-dt-day[aria-disabled="true"] {
    color: #6f6f6f;
    text-decoration: line-through;
    cursor: not-allowed;
    background: transparent;
}

.a4f-dt-day:focus-visible,
.a4f-dt-cal__nav:focus-visible,
.a4f-dt-pop__btn:focus-visible,
.a4f-dt-opt:focus-visible {
    outline: 2px solid #e8e8e8;
    outline-offset: 1px;
}

.a4f-dt-pop__foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.a4f-dt-layer.is-sheet .a4f-dt-day {
    min-width: 44px;
    height: 44px;
}

/* Time list (combobox + listbox) */
.a4f-dt-list {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.a4f-dt-layer.is-sheet .a4f-dt-list {
    max-height: calc(85dvh - 140px);
}

.a4f-dt-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.a4f-dt-layer.is-sheet .a4f-dt-opt {
    min-height: 48px;
    font-size: 1.05rem;
}

.a4f-dt-opt:hover {
    background: var(--gray-dark);
}

.a4f-dt-opt.is-active {
    outline: 2px solid #e8e8e8;
    outline-offset: -2px;
}

.a4f-dt-opt[aria-selected="true"] {
    background: #ff6b00;
    color: #0a0a0a;
    font-weight: 700;
}

.a4f-dt-opt__day {
    margin-left: 6px;
    font-size: .75rem;
    opacity: .75;
}

@media (prefers-reduced-motion: reduce) {
    .a4f-sheet__panel,
    .a4f-dt-pop,
    .a4f-dt-layer.is-sheet .a4f-dt-pop {
        animation: none !important;
    }
}

@media (forced-colors: active) {
    .a4f-dt-day[aria-selected="true"],
    .a4f-dt-opt[aria-selected="true"] {
        outline: 2px solid Highlight;
    }
}

/* ---------- Contrast fixes (AA) ---------- */
/* White on #ef4444 is only ~3.8:1 - danger buttons use #b91c1c (~6.5:1) */
.btn-danger {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: #991b1b;
    border-color: #991b1b;
    color: #fff;
}

/* Plan badges: white on cyan-600 (3.7:1) / on the orange gradient (2.9:1) failed AA */
.plan-badge--basic,
.billing-plan-badge.basic {
    background: #0e7490;
    color: #fff;
}

.plan-badge--premium {
    background: var(--accent);
    color: #0a0a0a;
}

.app-sidebar-footer-text {
    color: #8a8a8a;
}

/* Bootstrap's plaintext field is #212529 (dark on dark, 1.3:1) */
.form-control-plaintext {
    color: var(--white);
    font-family: var(--font-body);
}

/* Bootstrap text-dark / text-body leftovers on the dark theme */
.text-body {
    color: var(--white) !important;
}

/* Auth pages: flag emojis render as "DE" letters on Windows -> "DE DE"; the code is enough */
.auth-lang-btn .flag-icon {
    display: none;
}

/* Auth pages on the phone: the language button must not sit on the card */
@media (max-width: 575.98px) {
    .auth-language-select {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .auth-layout {
        padding-top: 72px;
    }

    .auth-footer__links a:last-child {
        flex-basis: 100%;
        text-align: center;
    }

    .auth-footer__links .auth-footer__sep:nth-last-child(2) {
        display: none;
    }
}

/* Footer on the phone: legal links in one line, the cancel link on its own line */
@media (max-width: 575.98px) {
    .app-footer__links .app-footer__cancel {
        flex-basis: 100%;
        text-align: center;
    }

    .app-footer__links .app-footer__sep:nth-last-child(2) {
        display: none;
    }
}

/* =====================================================================================
   Runde 3 · QA-Fix F5 (design system)
   13. Bebas Neue + "ß"      (Q38)
   14. Button states         (Q39: no Bootstrap blue in focus / active / disabled)
   15. Date / time fields    (Q40, with a4f-datetime.js: longest display text that fits)
   16. Info tip closed       (Q42)
   Checkboxes (Q46): every checkbox carries .form-check-input (site.css "Form Check");
   guarded by R3FIX_F5_DesignSystemTests.
   ===================================================================================== */

/* ---------- 13. Bebas Neue + "ß" ----------
   Bebas Neue has no lower case; its "ß" glyph looks like a "B" ("GAST WEIB", "STRABENFEST").
   RULE: every selector that sets the display font also gets text-transform: uppercase. The
   browser then shows "ß" as "SS" (Unicode upper-casing) - only on screen, the data keeps "ß".
   Visually neutral for Bebas (all its glyphs are capitals anyway). Safety net: fonts.css takes
   U+00DF out of the Bebas unicode-range, so a missed spot shows a real "ß" from the fallback
   font, never a "B". New Bebas selectors: add them here (the test lists the missing ones). */
h1, h2, h3, h4, h5, h6,
.app-logo-title,
.app-topbar-title,
.app-topbar-logo__text,
.app-avatar-circle,
.profile-avatar-placeholder,
.promo-bonus-banner__title,
.promo-explosion__months,
.plan-card-select__trial-badge,
.plan-card-select__name,
.plan-card__name,
.plan-card__amount,
.billing-plan-badge,
.event-slots__plan,
.modal-title,
.upgrade-banner__link,
.data-card__title,
.mobile-card__title,
.empty-state__title,
.a4f-empty__title,
.page-header__title,
.reg-wizard__title,
.stat-card__value,
.edit-section__title,
.t1-card__title,
.t1-step__title,
.adm-title,
.adm-kpi__value,
.t7-card__title,
.t7-switch__summary .h5,
.t7-hero__title,
.t7-tile__value,
.t7-welcome__title,
.toast__title {
    text-transform: uppercase;
}

/* ---------- 14. Button states (Q39) ----------
   site.css styles only the resting state; Bootstrap 5.1's :focus / :active / .active /
   :disabled / .btn-check rules (equal or higher specificity) turned buttons blue
   (#0b5ed7 / #0a58ca / #0d6efd). Same selectors here, loaded after Bootstrap:
   focus = resting look, hover as in site.css, pressed = a bit darker, disabled = resting
   look (Bootstrap keeps its opacity .65). Focus ring only for the keyboard (section 1). */

/* No coloured Bootstrap glow in any state (all variants, also success / warning) */
.btn:focus,
.btn:active:focus,
.btn.active:focus,
.btn-check:focus + .btn,
.btn-check:checked + .btn:focus,
.btn-check:active + .btn:focus,
.show > .btn.dropdown-toggle:focus,
.btn-close:focus {
    box-shadow: none;
}

/* primary */
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-check:focus + .btn-primary,
.btn-primary:disabled,
.btn-primary.disabled,
fieldset:disabled .btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--black);
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary,
.show > .btn-primary.dropdown-toggle {
    background-color: var(--accent-dim);
    border-color: var(--accent-dim);
    color: var(--black);
}

/* secondary */
.btn-secondary:focus,
.btn-secondary:focus-visible,
.btn-check:focus + .btn-secondary,
.btn-secondary:disabled,
.btn-secondary.disabled,
fieldset:disabled .btn-secondary {
    background-color: var(--gray-dark);
    border-color: var(--gray-dark);
    color: var(--white);
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary.active,
.btn-check:checked + .btn-secondary,
.btn-check:active + .btn-secondary,
.show > .btn-secondary.dropdown-toggle {
    background-color: var(--gray);
    border-color: var(--gray);
    color: var(--white);
}

/* outline-primary */
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible,
.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:disabled,
.btn-outline-primary.disabled,
fieldset:disabled .btn-outline-primary {
    background-color: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary,
.show > .btn-outline-primary.dropdown-toggle,
.btn-outline-primary.dropdown-toggle.show {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--black);
}

/* outline-secondary / outline-light (Bootstrap: grey resp. WHITE background when pressed) */
.btn-outline-secondary:focus,
.btn-outline-secondary:focus-visible,
.btn-check:focus + .btn-outline-secondary,
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled,
fieldset:disabled .btn-outline-secondary,
.btn-outline-light:focus,
.btn-outline-light:focus-visible,
.btn-check:focus + .btn-outline-light,
.btn-outline-light:disabled,
.btn-outline-light.disabled,
fieldset:disabled .btn-outline-light {
    background-color: transparent;
    border-color: var(--gray);
    color: var(--white);
}

.btn-outline-secondary:hover,
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--white);
    color: var(--white);
}

.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary,
.show > .btn-outline-secondary.dropdown-toggle,
.btn-outline-secondary.dropdown-toggle.show,
.btn-outline-light:active,
.btn-outline-light.active,
.btn-check:checked + .btn-outline-light,
.btn-check:active + .btn-outline-light,
.show > .btn-outline-light.dropdown-toggle,
.btn-outline-light.dropdown-toggle.show {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--white);
    color: var(--white);
}

/* outline-danger */
.btn-outline-danger:focus,
.btn-outline-danger:focus-visible,
.btn-check:focus + .btn-outline-danger,
.btn-outline-danger:disabled,
.btn-outline-danger.disabled,
fieldset:disabled .btn-outline-danger {
    background-color: transparent;
    border-color: var(--error);
    color: var(--error);
}

.btn-outline-danger:hover,
.btn-outline-danger:active,
.btn-outline-danger.active,
.btn-check:checked + .btn-outline-danger,
.btn-check:active + .btn-outline-danger,
.show > .btn-outline-danger.dropdown-toggle {
    background-color: var(--error);
    border-color: var(--error);
    color: var(--white);
}

/* danger (AA red, see "Contrast fixes") */
.btn-danger:focus,
.btn-check:focus + .btn-danger,
.btn-danger:disabled,
.btn-danger.disabled,
fieldset:disabled .btn-danger {
    background-color: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus-visible,
.btn-danger:active,
.btn-danger.active,
.btn-check:checked + .btn-danger,
.btn-check:active + .btn-danger,
.show > .btn-danger.dropdown-toggle {
    background-color: #991b1b;
    border-color: #991b1b;
    color: #fff;
}

/* link-style buttons: Bootstrap greys / blues them when disabled */
.btn-link:focus,
.btn-link:active,
.btn-link:disabled,
.btn-link.disabled {
    color: var(--accent);
    background: none;
    border-color: transparent;
}

.btn-link:hover {
    color: var(--white);
}

/* Keyboard focus ring: last, so it wins over the pressed / checked combinations above */
.btn:focus-visible,
.btn:active:focus-visible,
.btn.active:focus-visible,
.btn-check:focus-visible + .btn,
.btn-check:checked + .btn:focus-visible,
.btn-check:active + .btn:focus-visible,
.show > .btn.dropdown-toggle:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--a4f-focus-glow);
}

.btn-close:focus-visible {
    outline: 2px solid var(--a4f-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--a4f-focus-glow);
    opacity: 1;
}

/* Other Bootstrap pieces with a blue state */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--gray-dark);
    color: var(--white);
}

/* Bootstrap swaps the switch knob for a light-blue one on focus */
.form-switch .form-check-input:focus:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='8' fill='%23a0a0a0'/%3e%3c/svg%3e");
}

/* ---------- 15. Date / time fields (Q40) ----------
   Narrow columns were the cause: date + time below each other on phones (_AllocationFields,
   Export), event date on its own row in Edit. a4f-datetime.js additionally shows the longest
   display variant that fits ("Mo., 14. Dez. 2026" -> "Mo., 14.12.2026" -> "14.12.2026"). */

/* ---------- 16. Info tip / period switch at 320 px (Q42) ----------
   /billing (DE, 320 px) could be moved sideways by 11 px. Two causes:
   a) a closed <details> laid out its bubble (absolute, up to x = 458) -> never lay it out;
   b) the period switch "Monatlich | Jährlich (n Monate gratis)" + "i" was 315 px wide in a 288 px
      row, and the invisible 44 px tap area of the "i" (::before, inset -12px) went past the edge.
   Narrow phones: tighter switch buttons, so switch + "i" + tap area fit; if a long text still
   does not fit, the "i" wraps below instead of widening the page. */
.info-tip:not([open]) > .info-tip__bubble {
    display: none;
}

.plan-cards__switch-wrap {
    flex-wrap: wrap;
    max-width: 100%;
}

@media (max-width: 374.98px) {
    .plan-cards__switch-wrap {
        gap: 0.25rem;
    }

    .plan-cards__switch-btn {
        gap: 0.25rem;
        padding: 0.35rem 0.6rem;
    }
}
