.sg-rating-host {
    width: min(100%, 1120px);
}

.courier-shell > .sg-rating-host {
    margin: 1rem auto 0;
}

.archive-shell > .sg-rating-host,
.bloom-shell > .sg-rating-host,
.diner-shell > .sg-rating-host,
.td-shell > .sg-rating-host,
.stellar-shell > .sg-rating-host,
.sky-shell > .sg-rating-host,
.sg-rating-host--standalone {
    margin: 1rem auto 0;
}

body.sg-rating-page--standalone {
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
    flex-direction: column !important;
    gap: 1rem;
    padding: 1rem 0 !important;
}

.sg-rating {
    --sg-rating-paper: var(--text-main, var(--paper, #edf3ff));
    --sg-rating-soft: var(--text-soft, var(--soft, #a6b5d5));
    --sg-rating-muted: var(--text-muted, #7b89ab);
    --sg-rating-gold: var(--accent-gold, var(--gold, #ffd93d));
    --sg-rating-cool: var(--accent-cool, var(--cool, #4d96ff));
    --sg-rating-warm: var(--accent-warm, var(--warm, #ff6b6b));
    width: 100%;
    display: grid;
    gap: 0.95rem;
    padding: 1.05rem 1.15rem;
    border: 1px solid rgba(255, 217, 61, 0.18);
    border-radius: 20px;
    color: var(--sg-rating-paper);
    background:
        radial-gradient(circle at top right, rgba(255, 217, 61, 0.09), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
        rgba(10, 14, 32, 0.78);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
}

.sg-rating__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.sg-rating__title {
    margin: 0;
    color: var(--sg-rating-gold);
    font-size: 1.06rem;
    line-height: 1.2;
}

.sg-rating__summary,
.sg-rating__selected,
.sg-rating__status {
    margin: 0;
    color: var(--sg-rating-soft);
    font-size: 0.86rem;
    line-height: 1.5;
}

.sg-rating__summary {
    text-align: right;
}

.sg-rating__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
}

.sg-rating__stars {
    display: inline-flex;
    gap: 0.22rem;
}

.sg-rating__star {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: none;
    color: rgba(166, 181, 213, 0.48);
    cursor: pointer;
    font-size: 1.55rem;
    line-height: 1;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.sg-rating__star:hover,
.sg-rating__star:focus-visible,
.sg-rating__star.is-filled {
    color: var(--sg-rating-gold);
    border-color: rgba(255, 217, 61, 0.5);
    background: rgba(255, 217, 61, 0.1);
}

.sg-rating__star:hover {
    transform: translateY(-1px);
}

.sg-rating__star:focus-visible {
    outline: 2px solid var(--sg-rating-cool);
    outline-offset: 2px;
}

.sg-rating__star.is-chosen {
    box-shadow: inset 0 0 0 1px rgba(255, 217, 61, 0.42), 0 0 16px rgba(255, 217, 61, 0.12);
}

.sg-rating__challenge {
    max-width: min(100%, 340px);
}

.sg-rating__status[data-state="success"] {
    color: #6bcb77;
}

.sg-rating__status[data-state="error"] {
    color: var(--sg-rating-warm);
}

.sg-rating__status[data-state="busy"] {
    color: var(--sg-rating-cool);
}

@media (max-width: 640px) {
    .sg-rating {
        padding: 0.9rem 0.8rem;
    }

    .sg-rating__head {
        display: grid;
        gap: 0.38rem;
    }

    .sg-rating__summary {
        text-align: left;
    }

    .sg-rating__body {
        display: grid;
        gap: 0.55rem;
    }

    .sg-rating__stars {
        width: 100%;
        justify-content: space-between;
        gap: 0.18rem;
    }

    .sg-rating__star {
        width: calc((100vw - 4.15rem) / 5);
        max-width: 52px;
        min-width: 44px;
        min-height: 48px;
    }
}
