.rrvi-wrap,
.rrvi-editor-wrap {
    --rrvi-bg: #ffffff;
    --rrvi-soft: #f6f7f9;
    --rrvi-border: rgba(20, 20, 30, 0.10);
    --rrvi-text: #15171c;
    --rrvi-muted: #6f7480;
    --rrvi-accent: #111827;
    --rrvi-radius: 22px;
    position: relative;
    color: var(--rrvi-text);
    margin: 28px 0;
}

.rrvi-header,
.rrvi-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    margin-bottom: 14px;
    border: 1px solid var(--rrvi-border);
    border-radius: var(--rrvi-radius);
    background: linear-gradient(135deg, #ffffff, #f7f8fb);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}

.rrvi-title {
    margin: 0 0 4px;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.15;
}

.rrvi-description,
.rrvi-editor-header p {
    margin: 0;
    color: var(--rrvi-muted);
}

.rrvi-pill,
.rrvi-type,
.rrvi-editor-index {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef0f4;
    color: #343842;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.rrvi-list {
    display: grid;
    gap: 14px;
}

.rrvi-card,
.rrvi-editor-card {
    display: grid;
    grid-template-columns: 54px 62px 1fr;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--rrvi-border);
    border-radius: var(--rrvi-radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rrvi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
    border-color: rgba(20, 20, 30, 0.16);
}

.rrvi-rank {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--rrvi-soft);
    font-weight: 800;
    color: #4b5563;
}

.rrvi-vote {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.rrvi-vote-btn {
    width: 42px;
    height: 34px;
    border: 1px solid var(--rrvi-border);
    border-radius: 12px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: transform .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}

.rrvi-vote-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: #111827;
}

.rrvi-vote-btn.is-active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.rrvi-vote-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.rrvi-score {
    font-size: 18px;
    line-height: 1;
}

.rrvi-body {
    min-width: 0;
}

.rrvi-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rrvi-login {
    font-size: 13px;
    color: #4b5563;
    text-decoration: none;
}

.rrvi-item-title {
    margin: 0 0 12px;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.25;
}

.rrvi-embed {
    overflow: hidden;
    border-radius: 18px;
    background: #000;
}

.rrvi-embed iframe {
    width: 100%;
    max-width: 100%;
    display: block;
}

.rrvi-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    background: #f3f4f6;
}

.rrvi-text {
    color: #30343b;
}

.rrvi-text p:last-child {
    margin-bottom: 0;
}

.rrvi-muted {
    color: var(--rrvi-muted);
}

.rrvi-link-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--rrvi-border);
    border-radius: 16px;
    background: var(--rrvi-soft);
    text-decoration: none;
    color: var(--rrvi-text);
}

.rrvi-link-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rrvi-link-card strong {
    white-space: nowrap;
}

.rrvi-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99999;
    max-width: min(360px, calc(100vw - 44px));
    padding: 13px 16px;
    border-radius: 16px;
    background: #111827;
    color: #fff;
    box-shadow: 0 18px 50px rgba(0,0,0,.20);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.rrvi-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.rrvi-toast.is-error {
    background: #991b1b;
}

.rrvi-editor-wrap {
    padding: 4px;
}

.rrvi-editor-card {
    display: block;
    margin: 14px 0;
}

.rrvi-editor-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.rrvi-editor-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rrvi-editor-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 14px;
}

.rrvi-editor-empty {
    padding: 22px;
    border: 1px dashed var(--rrvi-border);
    border-radius: var(--rrvi-radius);
    text-align: center;
}

.rrvi-editor-image-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.rrvi-editor-preview-img {
    max-width: 260px;
    height: auto;
    border-radius: 14px;
    margin: 8px 0 14px;
    border: 1px solid var(--rrvi-border);
}

@media (max-width: 700px) {
    .rrvi-card {
        grid-template-columns: 44px 48px 1fr;
        gap: 10px;
        padding: 12px;
        border-radius: 18px;
    }

    .rrvi-rank {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 13px;
    }

    .rrvi-vote-btn {
        width: 36px;
        height: 32px;
    }

    .rrvi-header,
    .rrvi-editor-header {
        flex-direction: column;
    }

    .rrvi-editor-grid,
    .rrvi-editor-image-row {
        grid-template-columns: 1fr;
    }
}
