.feedback-fab {
    position: fixed;
    bottom: calc(92px + env(safe-area-inset-bottom));
    right: 20px;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #111827;
    border: 2px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
    z-index: 905;
    cursor: pointer;
    transition: transform 0.2s;
}
/* Szerokie ekrany: FAB ocen w obrębie max-width contentu (800px) */
@media (min-width: 860px) {
    .feedback-fab {
        right: calc(50% - 400px + 10px);
    }
}

.feedback-fab:active {
    transform: scale(0.95);
}

.feedback-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.feedback-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #111827;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.cfp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 920;
    /* Blokuj scroll tła */
    overflow: hidden;
    overscroll-behavior: contain;
}

/* Na mobile: pełny ekran */
@media (max-width: 600px) {
    .cfp-overlay {
        padding: 0;
        align-items: stretch;
    }
}

/* Na desktop: centrowany modal z paddingiem */
@media (min-width: 601px) {
    .cfp-overlay {
        padding: 20px;
        align-items: center;
    }
}

.cfp-overlay.is-hidden {
    display: none;
}

.cfp-panel {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Na mobile: pełna wysokość, bez zaokrągleń */
@media (max-width: 600px) {
    .cfp-panel {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }
    
    /* Safe area dla nagłówka na urządzeniach z notchem */
    .cfp-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
}

/* Na desktop: max wysokość z ograniczeniem */
@media (min-width: 601px) {
    .cfp-panel {
        max-height: 90vh;
    }
}

.cfp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    /* Nie scrolluje się z body */
    flex-shrink: 0;
}

.cfp-title {
    font-weight: 900;
    color: #111827;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfp-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.cfp-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Scrollowanie zawartości */
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Na mobile: dodatkowy padding na dole dla safe area */
@media (max-width: 600px) {
    .cfp-body {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

.cfp-message {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.3;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.cfp-message.is-hidden {
    display: none;
}

.cfp-message.is-error {
    background: #fff3f3;
    border-color: #f3b1b1;
    color: #8a1f1f;
}

.cfp-message.is-success {
    background: #f0fff4;
    border-color: #b7f0c0;
    color: #1f6b2c;
}

.cfp-section-title {
    font-weight: 900;
    color: #111827;
    margin: 6px 0 2px;
}

.cfp-card {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 10px;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 10px;
}

.cfp-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #f3f4f6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.cfp-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cfp-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfp-name {
    font-weight: 900;
    color: #111827;
    font-size: 0.98rem;
    line-height: 1.2;
}

.cfp-sub {
    font-size: 0.85rem;
    color: #6b7280;
}

.cfp-stars {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.cfp-star {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    color: #9ca3af;
}

/* ============================================== */
/* Niezapisana opinia (prompt 3-opcyjny) */
/* ============================================== */
.cfp-unsavedPrompt {
    position: absolute;
    inset: 0;
    z-index: 930;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cfp-unsavedPrompt.is-hidden {
    display: none;
}

.cfp-unsavedPrompt__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.cfp-unsavedPrompt__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cfp-unsavedPrompt__title {
    font-weight: 900;
    color: #111827;
}

.cfp-unsavedPrompt__message {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.35;
}

.cfp-unsavedPrompt__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 4px;
}

.cfp-unsavedPrompt__btn {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    font-weight: 800;
    cursor: pointer;
}

.cfp-unsavedPrompt__btn--primary {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.cfp-star.is-on {
    color: #f59e0b;
    border-color: #fde68a;
    background: #fffbeb;
}

.cfp-input {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 10px 10px;
    font-size: 0.95rem;
    resize: none;
}

.cfp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cfp-count {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 800;
}

.cfp-submit {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #111827;
    background: #111827;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.cfp-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cfp-empty {
    padding: 12px 10px;
    border: 1px dashed #e5e7eb;
    border-radius: 14px;
    color: #6b7280;
    font-weight: 700;
    text-align: center;
}



