/* ==========================================================================
   PflegeZentrale / Pflege Vibe – Responsive Layout System: POLISH (Feinschliff nach UI-Prüfung 22.11.)
   Wird als letzte responsive Datei geladen. Regeln immer seitenbezogen eingrenzen (Body-Klassen),
   globale Regeln nur für Shell-Elemente (schwebende Buttons, Typografie-Umbruch).
   ========================================================================== */

/* ==========================================================================
   1. SCHWEBENDE BUTTONS (KI-Berater + Nach oben) – eine Spur rechts unten
      „Nach oben“ steht ÜBER dem KI-Knopf (statt links daneben). Zustände setzt das Skript in _Layout.cshtml:
        body.pz-fab-away       Touch: beim Abwärtsscrollen sanft nach unten weggeschoben
        body.pz-fab-typing     Touch: ein Eingabefeld hat den Fokus (Bildschirmtastatur)
        body.pz-fab-yield-ai   im Ruhezustand läge der KI-Knopf über einem Bedienelement → weicht aus
        body.pz-fab-yield-top  dasselbe für „Nach oben“
        body.pz-fab-compact    Desktop: KI-Pille als runder 48-px-Knopf (Text nur oben auf der Seite)
      Anhebungen (--pz-fab-bottom, tp-fab-lift, pz-savebar-docked) und das Ausblenden bei Menü/Modal/
      Dropdown/Cookie-Banner (pz-shell.css, !important) bleiben unverändert wirksam.
   ========================================================================== */
@media (min-width: 1200px) {
    :root {
        --pz-fab-size: 48px;    /* runder KI-Knopf beim Scrollen */
    }
}

.pz-ai-fab,
#backToTopBtn.bc-back-top.is-visible + .pz-ai-fab {
    right: var(--pz-fab-right);
}
#backToTopBtn.bc-back-top {
    bottom: calc(var(--pz-fab-bottom) + var(--pz-safe-bottom) + var(--pz-fab-size) + var(--pz-fab-gap)) !important;
    right: calc(var(--pz-fab-right) + (var(--pz-fab-size) - var(--pz-top-size)) / 2) !important;
}
/* Angehobene Knöpfe (Speicherleiste Firmenprofil, Fachkräfte-Profil/Postfach): „Nach oben“ bleibt darüber gestapelt */
body.pz-c-dashboard.pz-a-profile.pz-savebar-docked #backToTopBtn.bc-back-top {
    bottom: calc(var(--pz-savebar-lift, 96px) + var(--pz-fab-size) + var(--pz-fab-gap)) !important;
}
body.pz-c-talent.pz-a-myprofile.tp-fab-lift #backToTopBtn.bc-back-top,
body.pz-c-talent.pz-a-inbox.tp-fab-lift #backToTopBtn.bc-back-top {
    bottom: calc(var(--tp-fab-lift) + var(--pz-fab-size) + var(--pz-fab-gap)) !important;
}

.pz-ai-fab {
    transition: right 0.26s cubic-bezier(0.22, 1, 0.36, 1), transform 0.2s ease, box-shadow 0.2s ease, opacity 0.22s ease,
        translate 0.32s cubic-bezier(0.22, 1, 0.36, 1), height 0.26s ease, padding 0.26s ease, gap 0.26s ease;
}

/* Weggeschoben / ausgewichen / Eingabe: nach unten aus dem Bild, nicht anklickbar */
body.pz-fab-away .pz-ai-fab,
body.pz-fab-away #backToTopBtn.bc-back-top,
body.pz-fab-typing .pz-ai-fab,
body.pz-fab-typing #backToTopBtn.bc-back-top,
body.pz-fab-yield-ai .pz-ai-fab,
body.pz-fab-yield-top #backToTopBtn.bc-back-top {
    translate: 0 calc(var(--pz-fab-bottom) + var(--pz-safe-bottom) + 2 * var(--pz-fab-size) + var(--pz-fab-gap) + 24px);
    opacity: 0;
    pointer-events: none;
}
/* Tastatur: ein fokussierter Knopf ist immer sichtbar */
body:is(.pz-fab-away, .pz-fab-typing, .pz-fab-yield-ai) .pz-ai-fab:focus-visible,
body:is(.pz-fab-away, .pz-fab-typing, .pz-fab-yield-top) #backToTopBtn.bc-back-top.is-visible:focus-visible {
    translate: none;
    opacity: 1;
    pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
    body.pz-fab-away .pz-ai-fab,
    body.pz-fab-away #backToTopBtn.bc-back-top,
    body.pz-fab-typing .pz-ai-fab,
    body.pz-fab-typing #backToTopBtn.bc-back-top,
    body.pz-fab-yield-ai .pz-ai-fab,
    body.pz-fab-yield-top #backToTopBtn.bc-back-top {
        translate: none;
    }
}

/* Desktop: Pille mit Text oben auf der Seite, beim Scrollen runder Knopf (aria-label + title bleiben) */
@media (min-width: 1200px) {
    .pz-ai-fab-label {
        display: inline-block;
        max-width: 9em;
        overflow: hidden;
        transition: max-width 0.26s ease, opacity 0.2s ease;
    }
    body.pz-fab-compact .pz-ai-fab {
        min-width: var(--pz-fab-size);
        height: var(--pz-fab-size);
        padding: 0;
        gap: 0;
        justify-content: center;
        font-size: 1.15rem;
    }
    body.pz-fab-compact .pz-ai-fab-label {
        max-width: 0;
        opacity: 0;
    }
    body.pz-fab-compact .pz-ai-fab .pz-ai-fab-dot {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 9px;
        height: 9px;
        box-shadow: 0 0 0 2px #0b2545;
    }
}

/* ==========================================================================
   2. UMBRÜCHE: ausgewogene Überschriften/Buttons/Kicker, keine einzelnen Wörter oder Pfeile in der letzten Zeile
   ========================================================================== */
h1, h2, h3,
.btn, .bc-btn, [class*="pz-btn"], .b-btn,
.badge, [class*="kicker"] {
    text-wrap: balance;
}
p {
    text-wrap: pretty;
}

/* ==========================================================================
   3. STARTSEITE – Spotlight-Raster: Werbekarte so kompakt wie die Firmenkarten (streckt sie nicht mehr)
   ========================================================================== */
body.is-home-page .ms-native-ad-card.ms-ad-compact {
    padding: 20px 20px 16px;
    gap: 14px;
}
body.is-home-page .ms-ad-compact .ms-ad-top {
    margin-bottom: 14px;
}
body.is-home-page .ms-ad-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
body.is-home-page .ms-ad-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #bae6fd;
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0284c7;
    font-size: 1.35rem;
}
body.is-home-page .ms-ad-title {
    margin: 0;
    color: #071832;
    font-size: clamp(1.02rem, 0.96rem + 0.2vw, 1.12rem);
    line-height: 1.3;
}
body.is-home-page .ms-ad-text {
    margin: 0 0 12px;
    color: #475569;
    font-size: max(13px, 0.84rem);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
body.is-home-page .ms-ad-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
}
body.is-home-page .ms-ad-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1e3a8a;
    font-size: max(12px, 0.76rem);
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}
body.is-home-page .ms-ad-chip i {
    color: #2563eb;
    font-size: 0.9em;
}
body.is-home-page .ms-ad-chip.is-green {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
body.is-home-page .ms-ad-chip.is-green i {
    color: #16a34a;
}
body.is-home-page .ms-ad-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 14px;
    border-top: 1px solid #dbeafe;
}
body.is-home-page .ms-ad-cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    line-height: 1.25;
    font-size: max(13.5px, 0.9rem);
}
body.is-home-page .ms-ad-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    font-size: max(13px, 0.82rem);
    font-weight: 700;
    color: #0284c7;
    text-decoration: none;
}
body.is-home-page .ms-ad-link:hover {
    text-decoration: underline;
}
@media (pointer: coarse) {
    body.is-home-page .ms-ad-link {
        min-height: 44px;
    }
}

/* Firmenkarten (Spotlight + Karussells): gleicher Aufbau in jeder Karte → keine großen Lücken, Knöpfe unten bündig.
   Kategorie-Zeile 1 Zeile (Ort steht ohnehin in der Adresse), Name max. 2 Zeilen (Platz für 2 Zeilen immer reserviert),
   Zeiten max. 2 Zeilen, Adresse 1 Zeile. */
body.is-home-page .bc-prem-card .bc-prem-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.is-home-page .bc-prem-card .bc-prem-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: 2.5em;
    text-wrap: balance;
}
body.is-home-page .bc-prem-card .bc-prem-info-line {
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
body.is-home-page .bc-prem-card .bc-prem-info-line:last-child {
    -webkit-line-clamp: 1;
    line-clamp: 1;
}
/* Karussell-Status („Automatisch“/„Pausiert“/„Manuell“) springt nicht in der Breite */
body.is-home-page .ms-gold-shift-status {
    display: inline-block;
    min-width: 6.2em;
}

/* ==========================================================================
   4. STARTSEITE – „Pflegeleistungen nach Bereich“ (5 Karten): gleiche Breiten, untere Reihe zentriert (3 + 2);
      Symbolkreis vollständig sichtbar (nur das Bild wird beschnitten – durch die Karte selbst)
   ========================================================================== */
body.is-home-page .ms-service-grid .sc-img-wrap {
    overflow: visible;
}
@media (min-width: 768px) {
    body.is-home-page .ms-service-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    body.is-home-page .ms-service-grid > .service-card,
    body.is-home-page .ms-service-grid > .service-card:nth-child(n + 4) {
        grid-column: span 2;
    }
    body.is-home-page .ms-service-grid > .service-card:nth-child(4):nth-last-child(2) {
        grid-column: 2 / span 2;
    }
}

/* ==========================================================================
   5. VERZEICHNIS + PROFIL – Brotkrumen, Sortierung, Standort-Knopf, kleine Links, Profil-Knöpfe
   ========================================================================== */
/* Brotkrumen auf dem Handy: seitlich wischbar mit weichem Ausblenden am rechten Rand statt hartem Abschneiden */
@property --pz-crumb-fade {
    syntax: "<length>";
    inherits: false;
    initial-value: 36px;
}
@keyframes pz-crumb-fade {
    0%, 92% { --pz-crumb-fade: 36px; }
    100% { --pz-crumb-fade: 0px; }
}
@media (max-width: 767.98px) {
    body.pz-c-companies .breadcrumb {
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--pz-crumb-fade)), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - var(--pz-crumb-fade)), transparent);
    }
    body.pz-c-companies .breadcrumb::-webkit-scrollbar {
        display: none;
    }
    body.pz-c-companies .breadcrumb > .breadcrumb-item {
        flex: 0 0 auto;
    }
    body.pz-c-companies .breadcrumb > .breadcrumb-item:last-child {
        padding-right: 28px;
    }
    @supports (animation-timeline: scroll()) {
        body.pz-c-companies .breadcrumb {
            animation: pz-crumb-fade linear both;
            animation-timeline: scroll(self inline);
        }
    }
}

/* Sortierung: Auswahlfeld füllt die ganze Pille (Tippfläche ≥ 44 px auf Touch), Abstand zwischen Text und Pfeil */
body.pz-c-companies .pz-sort-box {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
body.pz-c-companies #directorySortSelect {
    min-height: 36px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 34px !important;
    background-position: right 10px center !important;
    cursor: pointer;
}
@media (pointer: coarse), (max-width: 1199.98px) {
    body.pz-c-companies #directorySortSelect {
        min-height: 44px;
    }
}

/* Standort-Knopf im Ortsfeld: 44 × 44 Tippfläche, Optik unverändert */
body.pz-c-companies #btnUseLocation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: -10px -12px -10px -6px !important;
    border-radius: 12px;
}

/* „Inhaber? Profil kostenlos übernehmen“: 44 px Tippfläche über Innenabstand, Optik und Abstände gleich */
body.pz-c-companies a.pz-claim-micro {
    padding-top: 13px;
    padding-bottom: 13px;
    margin-top: -13px;
    margin-bottom: -13px;
}

/* Profil: Aktionsknöpfe mind. 44 px hoch */
body.pz-c-companies .pz-identity-banner .pz-id-actions .b-btn,
body.pz-c-companies .ent-feature .b-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Trust-Leiste (Google/Trustpilot) unter der Navigation: 44 px Tippfläche, Höhe der Leiste bleibt */
.bc-trust-bar .bc-trust-item {
    padding-top: 7px;
    padding-bottom: 7px;
    margin-top: -7px;
    margin-bottom: -7px;
    min-height: 44px;
}

/* ==========================================================================
   6. FORMULARE (Bewerbung, Fachkräfte-Anmeldung, Pflegegesuch) auf Touch
   ========================================================================== */
@media (pointer: coarse), (max-width: 1199.98px) {
    :is(body.pz-c-jobs.pz-a-apply, body.pz-c-talent.pz-a-onboarding, body.pz-c-patientrequests.pz-a-create) .form-check:not(.form-switch) {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        min-height: 44px;
        padding-left: 0;
    }
    :is(body.pz-c-jobs.pz-a-apply, body.pz-c-talent.pz-a-onboarding, body.pz-c-patientrequests.pz-a-create) .form-check:not(.form-switch) .form-check-input {
        float: none;
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
        margin: 1px 0 0 0;
    }
    :is(body.pz-c-jobs.pz-a-apply, body.pz-c-talent.pz-a-onboarding, body.pz-c-patientrequests.pz-a-create) .form-check:not(.form-switch) .form-check-label {
        display: inline-block;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-top: -10px;
        margin-bottom: -12px;
    }
    /* Fachkräfte-Anmeldung: unter dem Label folgt ein Absatz mit Links – Tippfläche nicht darüberlegen */
    body.pz-c-talent.pz-a-onboarding .form-check:not(.form-switch) > div > .form-check-label {
        margin-bottom: 0;
    }
}
/* Fachkräfte-Anmeldung: große Felder auf Touch-Geräten mind. 16 px (sonst zoomt iOS beim Antippen).
   !important nötig gegen „.b-card .form-control { font-size: .9rem !important }“ aus marketplace.css */
@media (pointer: coarse), (max-width: 767.98px) {
    body.pz-c-talent.pz-a-onboarding .form-control-lg,
    body.pz-c-talent.pz-a-onboarding .form-select-lg {
        font-size: 16px !important;
    }
}
