/* Wohnen-Fix – Match-Faktor Popover (ersetzt den Browser-alert) */

.wf-score-pop {
    position: fixed;
    z-index: 9999;
    width: min(320px, calc(100vw - 24px));
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.28), 0 8px 16px -8px rgba(15, 23, 42, 0.18);
    padding: 14px 14px 12px;
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.14s ease, transform 0.14s ease;
    color: #0f172a;
    font-family: inherit;
}

.wf-score-pop.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Pfeil (Tooltip-Caret) */
.wf-score-pop__caret {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.wf-score-pop[data-placement="right"] .wf-score-pop__caret { left: -7px; }
.wf-score-pop[data-placement="left"]  .wf-score-pop__caret { right: -7px; transform: rotate(225deg); }
.wf-score-pop[data-placement="bottom"] .wf-score-pop__caret { top: -7px; }
.wf-score-pop[data-placement="top"]    .wf-score-pop__caret { bottom: -7px; transform: rotate(225deg); }

.wf-score-pop__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 26px;
}

.wf-score-pop__ring {
    --ring-color: #8DC63F;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
    color: #0f172a;
    background:
        radial-gradient(closest-side, #ffffff 78%, transparent 79% 100%),
        conic-gradient(var(--ring-color) calc(var(--score, 0) * 1%), #e8edf2 0);
}

.wf-score-pop__title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    color: #14532d;
}

.wf-score-pop__subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.wf-score-pop__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.wf-score-pop__close:hover { background: #e2e8f0; color: #0f172a; }
.wf-score-pop__close:focus-visible { outline: 2px solid #2e7d32; outline-offset: 2px; }

.wf-score-pop__list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wf-score-pop__item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.wf-score-pop__item:last-child { border-bottom: none; padding-bottom: 0; }

.wf-score-pop__label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.wf-score-pop__points {
    font-size: 12px;
    font-weight: 800;
    color: #2e7d32;
    white-space: nowrap;
}

.wf-score-pop__detail {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
}

/* Mobile: Bottom-Sheet statt Tooltip */
@media (max-width: 560px) {
    .wf-score-pop {
        position: fixed;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        bottom: 12px;
        width: auto;
        transform: translateY(12px);
    }
    .wf-score-pop.is-open { transform: translateY(0); }
    .wf-score-pop__caret { display: none; }
}

/* Backdrop nur auf Mobile (zum Wegtippen) */
.wf-score-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}

@media (max-width: 560px) {
    .wf-score-pop-backdrop { background: rgba(15, 23, 42, 0.4); }
}
