body {
    overflow: auto;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: rgba(255, 255, 255, 0.92);
    background:
        radial-gradient(circle at top right, rgba(147, 51, 234, 0.18), transparent 42%),
        radial-gradient(circle at bottom left, rgba(255, 182, 193, 0.08), transparent 38%),
        #0a0f1a;
}

.reviews-page {
    width: min(720px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 16px 40px;
}

.reviews-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.reviews-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(196, 132, 252, 0.3);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(216, 180, 254, 0.12) 100%);
    color: #e9d5ff;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    transition: background 0.2s ease, transform 0.2s ease;
}

.reviews-back:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.32) 0%, rgba(216, 180, 254, 0.22) 100%);
    transform: translateY(-1px);
}

.reviews-heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reviews-title {
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f3e8ff;
}

.reviews-limit {
    font-size: 0.85rem;
    color: rgba(216, 180, 254, 0.75);
    letter-spacing: 0.03em;
}

.reviews-limit.is-limit {
    color: rgba(251, 191, 191, 0.85);
}

.reviews-compose {
    padding: 16px;
    margin-bottom: 28px;
    border-radius: 18px;
    border: 1px solid rgba(196, 132, 252, 0.24);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(147, 51, 234, 0.08) 100%);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.reviews-compose.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.reviews-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    color: rgba(233, 213, 255, 0.8);
}

.reviews-input,
.review-edit-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(196, 132, 252, 0.22);
    background: rgba(10, 15, 26, 0.65);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 110px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reviews-input:focus,
.review-edit-input:focus {
    border-color: rgba(196, 132, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.reviews-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.reviews-char-count {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.reviews-submit-btn,
.reviews-modal-btn-primary {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(147, 51, 234, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.reviews-submit-btn:hover,
.reviews-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(147, 51, 234, 0.42);
}

.reviews-submit-btn:active,
.reviews-modal-btn-primary:active {
    transform: scale(0.98);
}

.reviews-submit-btn:disabled,
.reviews-modal-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.reviews-empty {
    text-align: center;
    padding: 28px 12px;
    color: rgba(216, 180, 254, 0.65);
    font-size: 0.92rem;
    letter-spacing: 0.03em;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-card {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(196, 132, 252, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.review-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(196, 132, 252, 0.35);
}

.review-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(216, 180, 254, 0.25));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.review-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.review-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: #f3e8ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.review-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.review-text {
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    white-space: pre-wrap;
    word-break: break-word;
}

.review-edit-input {
    display: none;
    min-height: 96px;
    margin-bottom: 10px;
}

.review-edit-actions {
    display: none;
    gap: 8px;
    margin-bottom: 10px;
}

.review-card.is-editing .review-text {
    display: none;
}

.review-card.is-editing .review-edit-input {
    display: block;
}

.review-card.is-editing .review-edit-actions {
    display: flex;
}

.review-card.is-editing .review-own-actions {
    display: none;
}

.review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.review-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(196, 132, 252, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.review-like-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.review-like-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(196, 132, 252, 0.4);
}

.review-like-btn.is-liked {
    color: #f9a8d4;
    border-color: rgba(249, 168, 212, 0.45);
    background: rgba(236, 72, 153, 0.12);
}

.review-like-btn:active {
    transform: scale(0.96);
}

.review-own-actions {
    display: flex;
    gap: 8px;
}

.review-action-btn {
    padding: 7px 11px;
    border-radius: 10px;
    border: 1px solid rgba(196, 132, 252, 0.22);
    background: transparent;
    color: rgba(233, 213, 255, 0.85);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.review-action-btn:hover {
    background: rgba(168, 85, 247, 0.14);
}

.review-action-danger {
    color: rgba(252, 165, 165, 0.9);
    border-color: rgba(248, 113, 113, 0.25);
}

.review-action-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

.reviews-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.reviews-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.reviews-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 16, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.reviews-modal-dialog {
    position: relative;
    width: min(380px, 100%);
    padding: 22px 20px;
    border-radius: 18px;
    border: 1px solid rgba(196, 132, 252, 0.28);
    background: linear-gradient(160deg, rgba(30, 15, 45, 0.96) 0%, rgba(15, 10, 28, 0.98) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.reviews-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f3e8ff;
    margin-bottom: 6px;
}

.reviews-modal-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.reviews-modal-input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid rgba(196, 132, 252, 0.25);
    background: rgba(10, 15, 26, 0.75);
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
}

.reviews-modal-input:focus {
    border-color: rgba(196, 132, 252, 0.55);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.reviews-avatar-field {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.reviews-avatar-preview {
    width: 64px;
    height: 64px;
    padding: 0;
    border-radius: 50%;
    border: 2px dashed rgba(196, 132, 252, 0.45);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(216, 180, 254, 0.85);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.reviews-avatar-preview:hover {
    border-color: rgba(216, 180, 254, 0.7);
    transform: scale(1.03);
}

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

.reviews-avatar-preview.has-image {
    border-style: solid;
}

.avatar-placeholder {
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 0 6px;
}

.reviews-avatar-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.reviews-avatar-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.reviews-avatar-clear {
    width: fit-content;
    padding: 0;
    border: none;
    background: none;
    color: rgba(252, 165, 165, 0.85);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.reviews-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.reviews-modal-btn {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(196, 132, 252, 0.22);
    background: transparent;
    color: rgba(233, 213, 255, 0.9);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}

.reviews-modal-btn:hover {
    background: rgba(168, 85, 247, 0.12);
}

.reviews-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    z-index: 300;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(20, 12, 35, 0.94);
    border: 1px solid rgba(196, 132, 252, 0.28);
    color: #f3e8ff;
    font-size: 0.85rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    max-width: min(90vw, 420px);
    text-align: center;
}

.reviews-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.reviews-toast.is-error {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.reviews-toast.is-success {
    border-color: rgba(167, 243, 208, 0.35);
    color: #bbf7d0;
}

@media (max-width: 480px) {
    .reviews-page {
        padding: 16px 12px 32px;
    }

    .reviews-compose {
        padding: 14px;
        border-radius: 16px;
    }

    .reviews-compose-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .reviews-submit-btn {
        width: 100%;
    }

    .review-card {
        padding: 14px;
    }

    .review-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-own-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .reviews-modal-dialog {
        padding: 18px 16px;
    }

    .reviews-avatar-field {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reviews-modal,
    .reviews-toast,
    .reviews-back,
    .reviews-submit-btn,
    .review-like-btn {
        transition: none;
    }
}
