/* ============================================================
   PsychoBerlin – M3 Components
   ============================================================ */

/* ── Keyboard focus baseline ───────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
[data-document-upload]:focus-visible,
[data-pb-focus-layer="active"]:focus-visible {
    outline: 3px solid var(--md-sys-color-primary);
    outline-offset: 3px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 24px;
    font-family: var(--md-sys-typescale-font-family);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    letter-spacing: var(--md-sys-typescale-label-large-tracking);
    line-height: 1.43;
    border: none;
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    min-height: 44px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover { text-decoration: none; }

.btn:focus-visible {
    outline: 2px solid var(--md-sys-color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-accent) 88%, #3A0A22);
    box-shadow: var(--md-sys-elevation-1);
    color: var(--md-sys-color-on-accent);
}

.btn-accent {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
}

.btn-accent:hover {
    background-color: color-mix(in srgb, var(--md-sys-color-accent) 88%, #3A0A22);
    box-shadow: var(--md-sys-elevation-1);
    color: var(--md-sys-color-on-accent);
}

.btn-secondary {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.btn-secondary:hover {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}

.btn-text {
    background-color: transparent;
    color: var(--md-sys-color-primary);
    padding: 10px 12px;
}

.btn-text:hover {
    background-color: var(--md-sys-color-primary-container);
}

.btn-tonal {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.btn-tonal:hover {
    box-shadow: var(--md-sys-elevation-1);
}

.btn-error {
    background-color: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--md-sys-typescale-label-medium-size);
    min-height: 36px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: var(--md-sys-typescale-body-large-size);
    min-height: 48px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 10px;
    border-radius: var(--md-sys-shape-corner-full);
}

.btn .material-symbols-outlined {
    font-size: 18px;
}

/* ── FAB (Floating Action Button) ───────────────────────────── */
.fab {
    position: fixed;
    bottom: 88px; /* über Mobile Nav */
    right: var(--spacing-md);
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    z-index: var(--z-fixed);
}

.fab:hover {
    box-shadow: var(--md-sys-elevation-4);
}

@media (min-width: 905px) {
    .fab { bottom: var(--spacing-lg); }
}

.crisis-fab {
    position: fixed;
    bottom: 88px;
    right: var(--spacing-md);
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-large);
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
    border: none;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
                transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    z-index: var(--z-fixed);
    text-decoration: none;
}

.crisis-fab:hover {
    box-shadow: var(--md-sys-elevation-4);
    transform: scale(1.05);
    color: var(--md-sys-color-on-accent);
    text-decoration: none;
}

@media (min-width: 905px) {
    .crisis-fab { bottom: var(--spacing-lg); }
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--spacing-md);
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    border: 1px solid var(--md-sys-color-outline);
}

.card-elevated {
    border: none;
    box-shadow: var(--md-sys-elevation-1);
}

.card-elevated:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.card-filled {
    background-color: var(--md-sys-color-surface-container-highest);
    border: none;
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    box-shadow: var(--md-sys-elevation-2);
}

.card-clickable a {
    color: inherit;
    text-decoration: none;
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: var(--md-sys-typescale-title-large-weight);
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--spacing-xs);
}

.card-subtitle {
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
}

.card-body {
    margin-bottom: var(--spacing-md);
}

.card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ── Chips ──────────────────────────────────────────────────── */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 400;
    border-radius: var(--md-sys-shape-corner-small);
    border: 1px solid var(--md-sys-color-outline);
    background: transparent;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
    white-space: nowrap;
    text-decoration: none;
    min-height: 32px;
}

.chip:hover {
    background-color: var(--md-sys-color-surface-container-high);
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

.chip.active, .chip[aria-selected="true"],
.chip:checked + label {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
    border-color: transparent;
    font-weight: 600;
}
.chip.active:hover, .chip[aria-selected="true"]:hover {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
    opacity: 0.9;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}
.chip-group--centered { justify-content: center; }

/* Welle-19.1: Generic-Utilities (cross-Surface, nicht diary-spezifisch) */

/* Material-Symbol Icon-Sizing-Utilities (16px ist häufigster Inline-Style) */
.material-symbols-outlined.icon-16,
.icon-16 .material-symbols-outlined { font-size: 16px; }
.icon-14 .material-symbols-outlined { font-size: 14px; }
.material-symbols-outlined.icon-14 { font-size: 14px; }

/* Empty-State Italic-Caption (häufiger Pattern in Multi-Standort-Profilen) */
.empty-italic-faint {
    color: var(--md-sys-color-on-surface-variant);
    font-style: italic;
    font-size: 13px;
}

/* Welle-19.2: Provider-Detail-Patterns (cross-Surface generisch) */

/* Pivot-Panel-Hidden (Multi-Standort-Tab-Switch, Default sichtbar nur Index 0) */
.pivot-panel.is-hidden { display: none; }

/* Generic Text-Utilities (Cross-Surface, nicht diary-spezifisch) */
.text-13 { font-size: 13px; }
.text-12 { font-size: 12px; }
.text-12-faint {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
}
.text-13-faint {
    font-size: 13px;
    font-weight: 400;
    color: var(--md-sys-color-on-surface-variant);
}
.text-12-mt-faint {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}
.text-accent { color: var(--md-sys-color-accent); }

/* Section-H4-Pattern (Provider-Detail, Tab-Header etc.) */
.section-h4 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Generic Margin-Utilities */
.mb-0 { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.ml-30 { margin-left: 30px; }

/* Cursor-Pointer-Utility */
.cursor-pointer { cursor: pointer; }

/* Hidden Checkbox (für Custom-Toggle-Patterns) */
.checkbox-hidden {
    width: 18px;
    height: 18px;
    display: none;
}

/* Clickable-Row (mit Hover-Padding-Pattern für interaktive Listen) */
.clickable-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}

/* Welle-21: Badge fuer Angehoerigen-SHGs (auf provider-detail.php) */
.provider-relatives-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 10px;
    background: var(--md-sys-color-accent-container);
    color: var(--md-sys-color-on-accent-container);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}
.provider-relatives-badge .material-symbols-outlined {
    font-size: 14px;
}

/* Welle-20: E-Mail-Spam-Schutz fallback (vor JS-Decode + no-JS) */
.email-protected {
    /* Default-Color fuer noscript-Fallback wie ein normaler Link */
    color: var(--md-sys-color-on-accent-container);
}
.email-protected[data-decoded] { color: inherit; }
.email-reveal-button {
    appearance: none;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0;
    color: var(--md-sys-color-on-accent-container);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.email-reveal-button:hover,
.email-reveal-button:focus-visible {
    text-decoration: none;
}
.email-reveal-button:focus-visible {
    border-radius: 4px;
    outline: 2px solid var(--md-sys-color-on-accent-container);
    outline-offset: 3px;
}
.email-protected[data-revealed] a,
.email-revealed-link {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--md-sys-color-accent);
    font-weight: 400;
    line-height: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.email-protected[data-revealed] a:hover,
.email-protected[data-revealed] a:focus-visible,
.email-revealed-link:hover,
.email-revealed-link:focus-visible {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--md-sys-color-accent);
    text-decoration: none !important;
}
/* Vor JS-Render bleibt der Container leer im DOM (außer noscript). Das
   verhindert FOUC bei sehr schnellen Page-Loads. */

.chip .material-symbols-outlined {
    font-size: 18px;
}

/* ── Search Bar ─────────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 4px 16px;
    min-height: 56px;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.search-bar:focus-within {
    box-shadow: var(--md-sys-elevation-2);
    background-color: var(--md-sys-color-surface-container);
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface);
    outline: none;
    min-height: 32px;
    min-width: 0;
}

.autosuggest-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    left: 0;
    z-index: var(--z-dropdown);
    width: 100%;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--md-sys-color-outline);
    border-top: 0;
    border-radius: 0;
    background: var(--md-sys-color-surface-container);
    box-shadow: none;
    font-size: 12px;
}

.autosuggest-host {
    position: relative;
}

.autosuggest-input-host {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
}

.autosuggest-input-host > input {
    width: 100%;
    min-width: 0;
}

.search-bar .autosuggest-input-host {
    flex: 1 1 auto;
    align-self: stretch;
}

.autosuggest-dropdown [role="option"] {
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autosuggest-group-label {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 9px 14px 7px;
    border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 72%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 52%, transparent);
    background: color-mix(in srgb, var(--md-sys-color-accent) 8%, var(--md-sys-color-surface-container));
    color: var(--md-sys-color-on-surface);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.autosuggest-group-label:first-child {
    border-top: 0;
}

.autosuggest-crisis,
.autosuggest-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.autosuggest-crisis {
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--md-sys-color-accent);
    background: var(--md-sys-color-accent-container);
}

.autosuggest-crisis__icon,
.autosuggest-crisis__cta {
    color: var(--md-sys-color-accent);
}

.autosuggest-crisis__title {
    font-size: 0.9rem;
    font-weight: 500;
}

.autosuggest-crisis__cta {
    margin-left: auto;
    font-size: 12px;
}

.autosuggest-option {
    gap: 8px;
    min-width: 0;
    padding: 10px 16px 10px 12px;
    border-left: 4px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.autosuggest-option:hover,
.autosuggest-option:focus-visible,
.autosuggest-option.is-active,
.autosuggest-crisis.is-active {
    background: var(--md-sys-color-surface-container-high);
}

.autosuggest-option__icon {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 18px;
}

.autosuggest-option__label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.autosuggest-option__subtitle {
    overflow: hidden;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autosuggest-option__type {
    margin-left: auto;
    padding: 4px 9px;
    border-radius: var(--md-sys-shape-corner-full);
    background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 9%, transparent);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.autosuggest-option--provider {
    border-left-color: var(--md-sys-color-accent);
}

.autosuggest-option--provider .autosuggest-option__type,
.autosuggest-group-label--provider {
    background: color-mix(in srgb, var(--md-sys-color-accent) 13%, var(--md-sys-color-surface-container));
    color: var(--md-sys-color-accent);
}

.autosuggest-option--practice {
    border-left-color: color-mix(in srgb, var(--md-sys-color-primary) 76%, var(--md-sys-color-accent));
}

.autosuggest-option--practice .autosuggest-option__type,
.autosuggest-group-label--practice {
    background: color-mix(in srgb, var(--md-sys-color-primary) 11%, var(--md-sys-color-surface-container));
    color: var(--md-sys-color-primary);
}

.autosuggest-option--service {
    border-left-color: color-mix(in srgb, var(--md-sys-color-accent) 70%, var(--md-sys-color-primary));
}

.autosuggest-option--service .autosuggest-option__type,
.autosuggest-group-label--service {
    background: color-mix(in srgb, var(--md-sys-color-accent) 15%, var(--md-sys-color-surface-container));
    color: var(--md-sys-color-accent);
}

.autosuggest-option--topic,
.autosuggest-option--specialization {
    border-left-color: color-mix(in srgb, var(--md-sys-color-primary) 50%, var(--md-sys-color-accent));
}

.autosuggest-highlight {
    color: var(--md-sys-color-accent);
    background: none;
    font-weight: inherit;
    text-decoration: underline;
}

.search-bar input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.search-bar .material-symbols-outlined {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 24px;
}

/* ── Form Elements ──────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: var(--spacing-xs);
}

.required-star {
    color: var(--md-sys-color-accent);
    font-weight: 700;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--md-sys-typescale-font-family);
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface-container);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 44px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--md-sys-color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-accent) 10%, transparent);
}

.form-input.error, .form-select.error, .form-textarea.error,
.form-input.is-invalid, .form-select.is-invalid, .form-textarea.is-invalid,
.form-input[aria-invalid="true"], .form-select[aria-invalid="true"], .form-textarea[aria-invalid="true"] {
    border-color: var(--md-sys-color-error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-error) 12%, transparent);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-helper {
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--spacing-xs);
}

.form-error {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--md-sys-color-on-error-container);
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: 1.45;
}

.form-error:empty,
.form-error[hidden] {
    display: none;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: var(--md-sys-typescale-label-small-size);
    font-weight: var(--md-sys-typescale-label-small-weight);
    border-radius: var(--md-sys-shape-corner-full);
    white-space: nowrap;
}

.badge-success {
    background-color: var(--md-sys-color-success-container);
    color: var(--md-sys-color-success);
}

.badge-warning {
    background-color: var(--md-sys-color-tertiary-container);
    color: var(--md-sys-color-on-tertiary-container);
}

.badge-error {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-error);
}

.badge-neutral {
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
}

.badge-verified {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}


@media (min-width: 905px) {
    .snackbar { bottom: var(--spacing-lg); }
}

/* ── Dialog / Modal ─────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: var(--md-sys-color-scrim);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.modal-backdrop.show,
.modal-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.modal:not(.cropper-modal) {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--spacing-lg);
    z-index: var(--z-modal);
    max-width: 560px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.modal.show:not(.cropper-modal) {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Toggle-Button-Gruppen (Provider-Portal) */
.pvd-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--spacing-md);
}
.pvd-toggle-group .toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 8px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    flex-direction: row-reverse;
    gap: 12px;
}
.pvd-toggle-group .toggle:hover {
    border-color: var(--pvd-primary, var(--md-sys-color-primary));
    background: var(--md-sys-color-surface-container-low);
}
.pvd-toggle-group .toggle input:checked ~ * {
    color: var(--pvd-primary, var(--md-sys-color-primary));
}

/* Sortable.js Ghost */
.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--pvd-primary, var(--md-sys-color-primary)) !important;
}

/* Sprechzeiten: Kalender-Tiles (5 Werktage + optional 2 Wochenende) */
.pvd-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: var(--spacing-md);
}
.pvd-calendar-grid .pvd-cal-tile {
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 10px;
    padding: 10px;
    min-height: 100px;
}
.pvd-calendar-grid .pvd-cal-tile .pvd-cal-day {
    font-weight: 600;
    font-size: 13px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 8px;
    text-align: center;
}
.pvd-calendar-grid .pvd-cal-weekend {
    display: none;
}
.pvd-calendar-grid.show-weekend .pvd-cal-weekend {
    display: block;
}

/* Cropper.js: Globale Resets aus base.css neutralisieren */
.cropper-container,
.cropper-container * {
    box-sizing: content-box !important;
}
.cropper-container img {
    max-width: none !important;
}
/* Rasterlinien (Rule of Thirds) */
.cropper-dashed {
    opacity: .4 !important;
    border-color: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 60%, transparent) !important;
}
.cropper-line {
    background-color: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 30%, transparent) !important;
}
.cropper-point {
    background-color: var(--pvd-primary, var(--md-sys-color-primary)) !important;
    opacity: .8 !important;
}

.modal-title {
    font-size: var(--md-sys-typescale-headline-small-size);
    margin-bottom: var(--spacing-md);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

/* ── Mitgliederbereich Modal ────────────────────────────────── */
.member-backdrop {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 50%, transparent);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.member-backdrop.active {
    opacity: 1;
    visibility: visible;
}
.member-modal {
    background: var(--md-sys-color-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: var(--spacing-xl);
    max-width: 440px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    transform: scale(0.92);
    transition: transform 0.25s ease;
    position: relative;
}
.member-backdrop.active .member-modal {
    transform: scale(1);
}
.member-modal-header {
    display: flex;
    justify-content: flex-end;
    margin: calc(-1 * var(--spacing-md)) calc(-1 * var(--spacing-md)) 0 0;
}
.member-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
}
.member-modal-close:hover {
    background: var(--md-sys-color-surface-container);
}
.member-modal-icon {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}
.member-modal-icon .material-symbols-outlined {
    font-size: 48px;
    color: var(--md-sys-color-on-surface);
    opacity: 0.75;
}
.member-modal-title {
    text-align: center;
    font-size: var(--md-sys-typescale-headline-small-size);
    color: var(--md-sys-color-on-surface);
    margin: 0 0 var(--spacing-xs);
}
#memberLoginTitle {
    display: table;
    position: relative;
    margin: 0 auto var(--spacing-lg);
    font-weight: 800;
    letter-spacing: -0.02em;
}
#memberLoginTitle::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -8px;
    height: 4px;
    border-radius: 999px;
    background: var(--md-sys-color-accent);
}
.member-modal-subtitle {
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-medium-size);
    margin: 0 0 var(--spacing-lg);
}
.member-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-lg) var(--spacing-md);
    border: 2px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-large);
    background: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
    font-size: inherit;
}
.member-card:hover {
    border-color: var(--md-sys-color-accent);
    background: var(--md-sys-color-accent-container);
}
.member-card-icon {
    font-size: 36px;
    color: var(--md-sys-color-on-surface);
    opacity: 0.7;
    transition: color 0.2s, opacity 0.2s;
}
.member-card:hover .member-card-icon {
    color: var(--md-sys-color-accent);
    opacity: 1;
}
.member-card strong {
    font-size: var(--md-sys-typescale-title-small-size);
}
.member-card-desc {
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-on-surface-variant);
}
.member-register-link {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    font-size: var(--md-sys-typescale-body-small-size);
}
.member-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
    padding: 0;
    margin-bottom: var(--spacing-md);
    font-family: inherit;
}
.member-back-btn:hover { color: var(--md-sys-color-accent); }
.member-back-btn .material-symbols-outlined { font-size: 18px; }
.member-login-error {
    background: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    font-size: var(--md-sys-typescale-body-small-size);
    margin-top: var(--spacing-sm);
}
.member-login-success {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    font-size: 14px;
}
.member-success-icon {
    color: var(--md-sys-color-accent);
    font-size: 18px;
    vertical-align: middle;
}
.member-inline-link {
    border: 0;
    background: transparent;
    color: var(--md-sys-color-accent);
    cursor: pointer;
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 600;
    padding: 0;
}
.member-muted-link {
    border: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-size: var(--md-sys-typescale-body-small-size);
    padding: 0;
}
.member-secondary-action {
    margin-top: var(--spacing-md);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.member-secondary-action a,
.member-secondary-action button {
    border: 0;
    background: transparent;
    color: var(--md-sys-color-accent);
    cursor: pointer;
    font-size: var(--md-sys-typescale-body-small-size);
    font-weight: 650;
    padding: 0;
    text-decoration: none;
}
.member-secondary-action a:hover,
.member-secondary-action a:focus-visible,
.member-secondary-action button:hover,
.member-secondary-action button:focus-visible {
    color: color-mix(in srgb, var(--md-sys-color-accent) 82%, var(--md-sys-color-on-surface));
    text-decoration: none;
}
.member-muted-copy {
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
}
.member-form-submit,
.member-turnstile {
    margin-top: var(--spacing-sm);
}
.member-turnstile {
    display: flex;
    justify-content: center;
    width: 100%;
}
.member-form-submit {
    margin-top: var(--spacing-md);
}
/* Mobile: Vollbild */
@media (max-width: 600px) {
    .member-modal {
        max-width: 100vw;
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        padding: var(--spacing-lg);
    }
    .member-backdrop {
        align-items: stretch;
    }
    .member-cards {
        grid-template-columns: 1fr;
    }
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--md-sys-shape-corner-full);
    object-fit: cover;
    background-color: var(--md-sys-color-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary-container);
    font-weight: 500;
    flex-shrink: 0;
    border: 3px solid var(--md-sys-color-surface-container-lowest);
    outline: 2px solid var(--md-sys-color-accent);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-sm { width: 40px; height: 40px; }
.avatar-lg { width: 80px; height: 80px; }

/* ── Divider ────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--md-sys-color-outline);
    margin: var(--spacing-md) 0;
}

/* ── Skeleton (Loading Placeholder) ─────────────────────────── */
.skeleton,
.skeleton-line,
.skeleton-text,
.skeleton-title,
.skeleton-avatar,
.skeleton-circle,
.skeleton-pill,
.skeleton-button,
.skeleton-block,
.skeleton-media,
.btn.is-loading,
button.is-loading {
    --pb-skeleton-base: var(--md-sys-color-surface-container-high);
    --pb-skeleton-mid: var(--md-sys-color-surface-container-highest);
    --pb-skeleton-shine: color-mix(in srgb, var(--md-sys-color-surface-container-lowest) 82%, var(--md-sys-color-accent) 18%);
    background-image: linear-gradient(
        90deg,
        var(--pb-skeleton-base) 0%,
        var(--pb-skeleton-mid) 38%,
        var(--pb-skeleton-shine) 50%,
        var(--pb-skeleton-mid) 62%,
        var(--pb-skeleton-base) 100%
    );
    background-size: 220% 100%;
    background-position: -220% 0;
    border-radius: var(--md-sys-shape-corner-small);
    animation: skeleton-loading 1.25s var(--md-sys-motion-easing-emphasized, ease-out) infinite;
}

.skeleton,
.skeleton-line,
.skeleton-text,
.skeleton-title,
.skeleton-avatar,
.skeleton-circle,
.skeleton-pill,
.skeleton-button,
.skeleton-block,
.skeleton-media {
    display: block;
    color: transparent;
    overflow: hidden;
    pointer-events: none;
    user-select: none;
}

@keyframes skeleton-loading {
    0% { background-position: -220% 0; }
    100% { background-position: 220% 0; }
}

.skeleton-line,
.skeleton-text { height: 16px; margin-bottom: var(--spacing-sm); }
.skeleton-title { height: 24px; width: 60%; margin-bottom: var(--spacing-md); }
.skeleton-text--short,
.skeleton-line--short { width: 60%; }
.skeleton-line--tiny { width: 36%; }
.skeleton-line--wide { width: 86%; }
.skeleton-avatar,
.skeleton-circle { width: 56px; height: 56px; border-radius: var(--md-sys-shape-corner-full); }
.skeleton-pill { height: 36px; border-radius: var(--md-sys-shape-corner-full); }
.skeleton-button { width: 120px; height: 40px; border-radius: var(--md-sys-shape-corner-small); }
.skeleton-block { min-height: 96px; }
.skeleton-media { aspect-ratio: 16 / 9; min-height: 120px; }
.skeleton-card {
    min-height: 200px;
    background: var(--md-sys-color-surface-container-lowest);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
}

@media (prefers-reduced-motion: reduce) {
    .skeleton,
    .skeleton-line,
    .skeleton-text,
    .skeleton-title,
    .skeleton-avatar,
    .skeleton-circle,
    .skeleton-pill,
    .skeleton-button,
    .skeleton-block,
    .skeleton-media,
    .btn.is-loading,
    button.is-loading {
        animation: none;
        background-position: 0 0;
    }
}

/* ── Progress / Stepper ─────────────────────────────────────── */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stepper-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 600;
    background-color: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface-variant);
    flex-shrink: 0;
}

.stepper-step.active .stepper-circle {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
}

.stepper-step.completed .stepper-circle {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.stepper-label {
    font-size: var(--md-sys-typescale-label-large-size);
    color: var(--md-sys-color-on-surface-variant);
    display: none;
}

@media (min-width: 600px) {
    .stepper-label { display: block; }
}

.stepper-line {
    flex: 1;
    height: 2px;
    background-color: var(--md-sys-color-outline);
    min-width: 20px;
}

.stepper-step.completed + .stepper-line,
.stepper-step.active + .stepper-line {
    background-color: var(--md-sys-color-primary);
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-xl) 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
    transition: background-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.pagination a:hover {
    background-color: var(--md-sys-color-surface-container-high);
    text-decoration: none;
}

.pagination .active {
    background-color: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
}

.pagination .disabled {
    color: var(--md-sys-color-outline-variant);
    pointer-events: none;
}

/* ── PWA Install Banner ────────────────────────────────────── */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--md-sys-color-surface);
    box-shadow: 0 -4px 20px color-mix(in srgb, var(--md-sys-color-on-surface) 15%, transparent);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateY(100%);
    animation: pwa-slide-up 0.4s ease forwards;
}

@keyframes pwa-slide-up {
    to { transform: translateY(0); }
}

.pwa-install-banner .pwa-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--md-sys-color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-accent);
    flex-shrink: 0;
}

.pwa-install-banner .pwa-text {
    flex: 1;
}

.pwa-install-banner .pwa-text h4 {
    margin: 0;
    font-size: 0.95rem;
}

.pwa-install-banner .pwa-text p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
}

.pwa-install-banner .pwa-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Swipe Hint ────────────────────────────────────────────── */
.swipe-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 70%, transparent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    animation: swipe-hint-fade 3s ease forwards;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

@keyframes swipe-hint-fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Offline Indicator ─────────────────────────────────────── */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
    text-align: center;
    padding: 0.25rem;
    font-size: 0.8rem;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.visible {
    transform: translateY(0);
}

/* ── Form Hint ─────────────────────────────────────────────── */
.form-hint {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

.toggle input {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 24px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    flex-shrink: 0;
}

.toggle input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--md-sys-color-on-surface) 20%, transparent);
}

.toggle input:checked {
    background: var(--md-sys-color-accent);
}

.toggle input:checked::after {
    transform: translateX(24px);
}

.toggle input:focus-visible {
    outline: 2px solid var(--md-sys-color-accent);
    outline-offset: 2px;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--md-sys-color-surface-container-high);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--md-sys-color-on-surface-variant);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    min-height: 44px;
}

.tab:hover {
    color: var(--md-sys-color-on-surface);
}

.tab.active {
    color: var(--md-sys-color-accent);
    border-bottom-color: var(--md-sys-color-accent);
    font-weight: 500;
}

.tab:focus-visible {
    outline: 2px solid var(--md-sys-color-accent);
    outline-offset: -2px;
}

/* ── Modal Header & Close ──────────────────────────────────── */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 { margin: 0; }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    padding: 0.25rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-sys-shape-corner-full);
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--md-sys-color-surface-container-high);
}

.modal-close:focus-visible {
    outline: 2px solid var(--md-sys-color-accent);
    outline-offset: 2px;
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--md-sys-color-on-surface-variant);
}

.empty-state .material-symbols-outlined {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.empty-state p {
    margin: 0 0 1.5rem;
}

/* ── Danger Zone ───────────────────────────────────────────── */
.danger-zone {
    border: 2px solid var(--md-sys-color-error);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: var(--md-sys-color-error);
    margin-top: 0;
}

/* ── Stat Card ─────────────────────────────────────────────── */
.stat-card {
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--md-sys-color-accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 0.25rem;
}


/* ── Snackbar ─────────────────────────────────────── */
.snackbar-container {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    transform: none;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    pointer-events: none;
}
.snackbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--md-sys-shape-corner-small);
    color: var(--md-sys-color-on-accent);
    background: var(--md-sys-color-accent);
    box-shadow: var(--md-sys-elevation-3);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    font-size: var(--md-sys-typescale-body-medium-size);
    width: 90%;
    max-width: 500px;
}
.snackbar-show {
    opacity: 1;
    transform: translateY(0);
}
.snackbar-success, .snackbar-error, .snackbar-info, .snackbar-warning {
    color: var(--md-sys-color-on-accent);
    background: var(--md-sys-color-accent);
}
.snackbar-icon { font-size: 20px; flex-shrink: 0; }
.snackbar-text { flex: 1; }
.snackbar-close {
    background: none;
    border: none;
    color: color-mix(in srgb, var(--md-sys-color-on-surface) 72%, transparent);
    cursor: pointer;
    padding: 4px;
    display: flex;
    flex-shrink: 0;
}
.snackbar-close:hover { color: var(--md-sys-color-on-accent); }

/* ── Programmatic Snackbar (showSnackbar) ────────── */
.pb-snackbar {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-accent);
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 100000;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--md-sys-color-accent) 30%, transparent);
    opacity: 0;
    transition: all .3s ease;
    max-width: calc(100vw - 32px);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.pb-snackbar__text { flex-shrink: 0; }
.pb-snackbar__undo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: color-mix(in srgb, var(--md-sys-color-on-surface) 85%, transparent);
    font-size: 13px;
}
.pb-snackbar__undo-btn {
    background: none;
    border: none;
    color: var(--md-sys-color-on-accent);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pb-snackbar__undo-btn:hover { color: var(--md-sys-color-on-accent); }
.pb-snackbar__timer {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transform: rotate(-90deg);
}
.pb-snackbar__timer-circle {
    fill: none;
    stroke: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 70%, transparent);
    stroke-width: 2.5;
    stroke-dasharray: 50.27;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: pb-timer-countdown linear forwards;
}
@keyframes pb-timer-countdown {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: 50.27; }
}

/* ── Confirm-Modal ────────────────────────────────── */
.pb-confirm-overlay {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 50%, transparent);
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pb-confirm-overlay.is-open {
    display: flex;
}
.pb-confirm-box {
    background: var(--md-sys-color-surface-container-lowest);
    border-radius: 16px;
    padding: 28px 32px 20px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--md-sys-elevation-5);
    text-align: center;
}
.pb-confirm__msg {
    font-size: 15px;
    color: var(--md-sys-color-on-surface);
    line-height: 1.6;
    margin-bottom: 24px;
}
.pb-confirm__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.pb-confirm__no {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
    border: none;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.pb-confirm__yes {
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-surface-container-lowest);
    border: none;
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* ── Shared UI components ─────────────────────────── */
.ui-page-header,
.ui-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    width: 100%;
}
.ui-page-header__body,
.ui-toolbar__leading {
    min-width: 0;
}
.ui-page-header__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--md-sys-color-on-surface);
    font-size: 1.55rem;
    line-height: 1.15;
    letter-spacing: 0;
}
.ui-page-header__icon {
    color: var(--md-sys-color-primary);
    font-size: 1.1em;
}
.ui-page-header__subtitle {
    margin: 6px 0 0;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}
.ui-page-header__actions,
.ui-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.ui-toolbar {
    align-items: center;
    padding: 8px 0;
}
.ui-empty-state {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: clamp(24px, 6vw, 48px) var(--spacing-md);
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}
.ui-empty-state__icon {
    color: var(--md-sys-color-primary);
    font-size: 40px;
}
.ui-empty-state__title {
    margin: 0;
    color: var(--md-sys-color-on-surface);
    font-size: 1.15rem;
    line-height: 1.25;
    letter-spacing: 0;
}
.ui-empty-state__body {
    max-width: 58ch;
    margin: 0;
    line-height: 1.55;
}
.ui-empty-state__actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ui-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 999px;
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.ui-filter-chip[aria-pressed="true"] {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}
.ui-filter-chip__icon {
    font-size: 18px;
}
.ui-modal:not([hidden]),
.ui-drawer:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: block;
}
.ui-modal__backdrop,
.ui-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 48%, transparent);
}
.ui-modal__dialog {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    overflow: auto;
    border-radius: 8px;
    background: var(--md-sys-color-surface-container-lowest);
    box-shadow: var(--md-sys-elevation-4);
}
.ui-modal__header,
.ui-drawer__header,
.ui-modal__footer,
.ui-drawer__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
}
.ui-modal__body,
.ui-drawer__body {
    padding: 0 16px 16px;
}
.ui-modal__title,
.ui-drawer__title {
    margin: 0;
    color: var(--md-sys-color-on-surface);
    font-size: 1.1rem;
    line-height: 1.25;
    letter-spacing: 0;
}
.ui-modal__close,
.ui-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
}

/* Modal reveal: blur overlay plus blur-to-sharp dialog entrance */
:root {
    --pb-modal-blur-size: 10px;
    --pb-modal-blur-duration: 220ms;
    --pb-modal-blur-ease: cubic-bezier(0.2, 0, 0, 1);
}

.modal-backdrop.show,
.modal-backdrop.open,
.modal-backdrop.active,
.member-backdrop.active,
.booking-modal-backdrop.active,
.ui-modal:not([hidden]) .ui-modal__backdrop,
.appt-modal:not([hidden]) .modal-overlay,
.msg-modal:not([hidden]),
.legal-modal:not([hidden]),
.settings-cropper-modal:not([hidden]),
.profile-studio-full-modal:not([hidden]),
.admin-provider-studio-modal:not([hidden]),
.entry-cropper-modal:not([hidden]),
.admin-practice-edit-cropper-modal:not([hidden]),
.beta-modal:not([hidden]),
.pvd-cropper-modal:not([hidden]),
.pvd-transit-modal:not([hidden]),
.pvd-wait-modal:not(.hidden),
.save-search-overlay.active,
.share-search-overlay:not(.hidden),
.signature-modal:not(.is-hidden),
.selfhelp-attend-modal:not(.hidden),
.mc-overlay:not([hidden]),
.message-send-draft-modal:not([hidden]) {
    -webkit-backdrop-filter: blur(var(--pb-modal-blur-size));
    backdrop-filter: blur(var(--pb-modal-blur-size));
    animation: pb-modal-backdrop-blur-in var(--pb-modal-blur-duration) var(--pb-modal-blur-ease) both;
}

.modal.show:not(.cropper-modal),
.modal.active:not(.cropper-modal) {
    animation: pb-modal-dialog-blur-in-centered var(--pb-modal-blur-duration) var(--pb-modal-blur-ease) both;
}

.member-backdrop.active .member-modal,
.booking-modal-backdrop.active .booking-modal,
.ui-modal:not([hidden]) .ui-modal__dialog,
.appt-modal:not([hidden]) .modal-content,
.msg-modal:not([hidden]) .msg-modal-content,
.legal-modal:not([hidden]) .legal-modal__dialog,
.settings-cropper-modal:not([hidden]) .settings-cropper-dialog,
.profile-studio-full-modal:not([hidden]) .profile-studio-full-modal__dialog,
.admin-provider-studio-modal:not([hidden]) .admin-provider-studio-modal__dialog,
.entry-cropper-modal:not([hidden]) .entry-cropper-dialog,
.admin-practice-edit-cropper-modal:not([hidden]) .admin-practice-edit-cropper-dialog,
.beta-modal:not([hidden]) .beta-screenshot-dialog,
.beta-modal:not([hidden]) .beta-feedback-dialog,
.pvd-cropper-modal:not([hidden]) .pvd-cropper-dialog,
.pvd-transit-modal:not([hidden]) .pvd-transit-dialog,
.pvd-wait-modal:not(.hidden) .pvd-wait-modal-dialog,
.save-search-overlay.active .save-search-modal,
.share-search-overlay:not(.hidden) .share-search-modal,
.signature-modal:not(.is-hidden) .signature-modal__card,
.selfhelp-attend-modal:not(.hidden) .selfhelp-attend-dialog,
.mc-overlay:not([hidden]) .mc-modal-content,
.message-send-draft-modal:not([hidden]) .message-send-draft-modal-card {
    animation: pb-modal-dialog-blur-in var(--pb-modal-blur-duration) var(--pb-modal-blur-ease) both;
    will-change: opacity, filter, transform;
}

@keyframes pb-modal-backdrop-blur-in {
    from {
        opacity: 0;
        -webkit-backdrop-filter: blur(0);
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        -webkit-backdrop-filter: blur(var(--pb-modal-blur-size));
        backdrop-filter: blur(var(--pb-modal-blur-size));
    }
}

@keyframes pb-modal-dialog-blur-in {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes pb-modal-dialog-blur-in-centered {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: translate(-50%, -48%) scale(0.985);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-backdrop.show,
    .modal-backdrop.open,
    .modal-backdrop.active,
    .member-backdrop.active,
    .booking-modal-backdrop.active,
    .ui-modal:not([hidden]) .ui-modal__backdrop,
    .appt-modal:not([hidden]) .modal-overlay,
    .msg-modal:not([hidden]),
    .legal-modal:not([hidden]),
    .settings-cropper-modal:not([hidden]),
    .profile-studio-full-modal:not([hidden]),
    .admin-provider-studio-modal:not([hidden]),
    .entry-cropper-modal:not([hidden]),
    .admin-practice-edit-cropper-modal:not([hidden]),
    .beta-modal:not([hidden]),
    .pvd-cropper-modal:not([hidden]),
    .pvd-transit-modal:not([hidden]),
    .pvd-wait-modal:not(.hidden),
    .save-search-overlay.active,
    .share-search-overlay:not(.hidden),
    .signature-modal:not(.is-hidden),
    .selfhelp-attend-modal:not(.hidden),
    .mc-overlay:not([hidden]),
    .message-send-draft-modal:not([hidden]),
    .modal.show:not(.cropper-modal),
    .modal.active:not(.cropper-modal),
    .member-backdrop.active .member-modal,
    .booking-modal-backdrop.active .booking-modal,
    .ui-modal:not([hidden]) .ui-modal__dialog,
    .appt-modal:not([hidden]) .modal-content,
    .msg-modal:not([hidden]) .msg-modal-content,
    .legal-modal:not([hidden]) .legal-modal__dialog,
    .settings-cropper-modal:not([hidden]) .settings-cropper-dialog,
    .profile-studio-full-modal:not([hidden]) .profile-studio-full-modal__dialog,
    .admin-provider-studio-modal:not([hidden]) .admin-provider-studio-modal__dialog,
    .entry-cropper-modal:not([hidden]) .entry-cropper-dialog,
    .admin-practice-edit-cropper-modal:not([hidden]) .admin-practice-edit-cropper-dialog,
    .beta-modal:not([hidden]) .beta-screenshot-dialog,
    .beta-modal:not([hidden]) .beta-feedback-dialog,
    .pvd-cropper-modal:not([hidden]) .pvd-cropper-dialog,
    .pvd-transit-modal:not([hidden]) .pvd-transit-dialog,
    .pvd-wait-modal:not(.hidden) .pvd-wait-modal-dialog,
    .save-search-overlay.active .save-search-modal,
    .share-search-overlay:not(.hidden) .share-search-modal,
    .signature-modal:not(.is-hidden) .signature-modal__card,
    .selfhelp-attend-modal:not(.hidden) .selfhelp-attend-dialog,
    .mc-overlay:not([hidden]) .mc-modal-content,
    .message-send-draft-modal:not([hidden]) .message-send-draft-modal-card {
        animation: none;
        filter: none;
    }
}
.ui-drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(420px, 88vw);
    overflow: auto;
    background: var(--md-sys-color-surface-container-lowest);
    box-shadow: var(--md-sys-elevation-4);
}
.ui-drawer--right .ui-drawer__panel {
    right: 0;
}
.ui-drawer--left .ui-drawer__panel {
    left: 0;
}
.ui-form-field {
    display: grid;
    gap: 6px;
}
.ui-form-field__label {
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
}
.ui-form-field__hint,
.ui-upload-field__hint {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.45;
}
.ui-form-field__error {
    margin: 0;
    color: var(--md-sys-color-error);
    font-size: 0.9rem;
    line-height: 1.45;
}
.ui-upload-field {
    display: grid;
    gap: 8px;
}
.ui-upload-field__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 8px;
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
}
.ui-upload-field__input {
    max-width: 100%;
}
.ui-upload-field__icon {
    color: var(--md-sys-color-primary);
}
.ui-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.ui-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--md-sys-color-on-surface);
}
.ui-table caption {
    padding: 0 0 8px;
    color: var(--md-sys-color-on-surface-variant);
    text-align: left;
}
.ui-table th,
.ui-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    text-align: left;
    vertical-align: top;
}
.ui-table th {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.82rem;
    font-weight: 700;
}
.ui-table__empty {
    color: var(--md-sys-color-on-surface-variant);
    text-align: center;
}

@media (max-width: 720px) {
    .ui-page-header,
    .ui-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ui-page-header__actions,
    .ui-toolbar__actions {
        justify-content: flex-start;
    }
    .ui-page-header__title {
        font-size: 1.35rem;
    }
}


/* Welle Link-Polish: Reveal-Button als Bubble, geoeffnete Adresse als Link */
.email-reveal-button {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-accent) 44%, transparent);
    border-radius: var(--md-sys-shape-corner-full);
    background: color-mix(in srgb, var(--md-sys-color-accent) 8%, transparent);
    color: var(--md-sys-color-accent);
    text-decoration: none !important;
}

.email-reveal-button:hover,
.email-reveal-button:focus-visible {
    background: color-mix(in srgb, var(--md-sys-color-accent) 13%, transparent);
    color: var(--md-sys-color-accent);
    text-decoration: none !important;
}

.email-protected[data-revealed] a,
.email-revealed-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid color-mix(in srgb, var(--md-sys-color-accent) 36%, transparent);
    border-radius: var(--md-sys-shape-corner-full);
    background: color-mix(in srgb, var(--md-sys-color-accent) 7%, transparent);
    color: var(--md-sys-color-accent);
    text-decoration: none !important;
}


/* Welle Button-Kontrast: gefuellte Akzentbuttons behalten immer hellen Text */
.btn-primary,
.btn-accent,
.btn-primary:hover,
.btn-accent:hover,
.btn-primary:focus-visible,
.btn-accent:focus-visible,
.btn-primary:active,
.btn-accent:active {
    color: var(--md-sys-color-on-accent) !important;
}

/* Welle Button V2.2: Accent-Hover niemals rot auf Pink */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-accent,
.btn-accent:hover,
.btn-accent:focus-visible,
.btn-accent:active,
.home-modern-search-submit,
.home-modern-search-submit:hover,
.home-modern-search-submit:focus-visible,
.home-modern-search-submit:active,
a.btn-primary,
a.btn-primary:hover,
a.btn-primary:focus-visible,
a.btn-primary:active,
a.btn-accent,
a.btn-accent:hover,
a.btn-accent:focus-visible,
a.btn-accent:active {
    color: var(--md-sys-color-on-accent, #ffffff) !important;
    text-decoration: none !important;
}


/* Welle Mailto-Polish: Alle echten E-Mail-Links ohne Button-/Bubble-Rahmen */
a[href^="mailto:"],
a[href^="mailto:"]:visited,
.email-protected[data-revealed] a,
.email-revealed-link {
    display: inline !important;
    align-items: initial !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--md-sys-color-accent) !important;
    font-weight: 400 !important;
    line-height: inherit;
    text-decoration: none !important;
    overflow-wrap: anywhere;
}

a[href^="mailto:"]:hover,
a[href^="mailto:"]:focus-visible,
.email-protected[data-revealed] a:hover,
.email-protected[data-revealed] a:focus-visible,
.email-revealed-link:hover,
.email-revealed-link:focus-visible {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--md-sys-color-accent) !important;
    text-decoration: none !important;
}

/* Welle Form-Focus: schlanker, nicht schwarzer Fokusrahmen fuer Formularfelder */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.input:focus-visible,
textarea.input:focus-visible,
select.input:focus-visible {
    outline: 1.5px solid color-mix(in srgb, var(--md-sys-color-accent) 82%, transparent) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-accent) 12%, transparent) !important;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--md-sys-color-accent) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--md-sys-color-accent) 12%, transparent) !important;
}

.pb-address-field-wrap {
    position: relative;
}

.pb-address-suggestions {
    position: absolute;
    z-index: var(--z-dropdown);
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-small);
    box-shadow: var(--md-sys-elevation-2);
}

.pb-address-suggestions.hidden {
    display: none;
}

.pb-address-suggestion,
.pb-address-suggestion-empty {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font: inherit;
    text-align: left;
}

.pb-address-suggestion {
    cursor: pointer;
}

.pb-address-suggestion:hover,
.pb-address-suggestion:focus-visible,
.pb-address-suggestion.is-active {
    background: var(--md-sys-color-surface-container);
    outline: none;
}

.pb-address-suggestion strong,
.pb-address-suggestion small {
    display: block;
}

.pb-address-suggestion strong {
    font-weight: 600;
}

.pb-address-suggestion small,
.pb-address-suggestion-empty {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.85rem;
}
