.rs-main { max-width: 900px; }
.rs-hero { margin-bottom: 20px; }
.rs-title { margin: 0 0 8px; }
.rs-lead { margin: 0; color: var(--text-secondary); line-height: 1.6; font-size: 0.95rem; }
.rs-h2 { margin: 0; font-size: 1.1rem; color: var(--text-primary); }

.rs-panel,
.rs-card,
.rs-history {
    background: var(--card);
    border: 1px solid rgba(0, 178, 45, 0.15);
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(15, 41, 30, 0.06);
}

.rs-panel { padding: 20px; margin-bottom: 20px; }
.rs-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 8px; }

.rs-input {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 96px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 178, 45, 0.25);
    background: var(--main);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rs-input:focus { border-color: #00b22d; box-shadow: 0 0 0 3px rgba(0, 178, 45, 0.15); }

.rs-detect { min-height: 22px; margin: 8px 0 4px; font-size: 0.85rem; color: var(--text-secondary); }
.rs-detect strong { color: var(--text-primary); }

.rs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.rs-btn {
    border: 0;
    border-radius: 10px;
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
}

.rs-btn:active { transform: scale(0.97); }
.rs-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rs-btn-primary { background: #00b22d; color: #fff; margin-left: auto; min-width: 120px; }
.rs-btn-primary:hover:not(:disabled) { background: #009a27; }
.rs-btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid rgba(0, 178, 45, 0.25); }
.rs-btn-ghost:hover:not(:disabled) { background: rgba(0, 178, 45, 0.08); }
.rs-btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.rs-btn:focus-visible, .rs-input:focus-visible, .rs-chip:focus-visible { outline: 2px solid #00b22d; outline-offset: 2px; }

.rs-consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 0.85rem; line-height: 1.5; color: var(--text-secondary); cursor: pointer; }
.rs-consent input { margin-top: 3px; accent-color: #00b22d; }

.rs-gate { text-align: center; padding: 10px 0; color: var(--text-secondary); line-height: 1.6; }
.rs-gate .rs-btn { margin-top: 12px; }

.rs-platforms { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 178, 45, 0.25);
    background: var(--main);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}
.rs-chip-beta { font-size: 0.65rem; padding: 1px 6px; border-radius: 6px; background: #f5a623; color: #1a1a1a; font-weight: 800; }

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

.rs-card { padding: 16px; display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.rs-card-error { grid-template-columns: 1fr; border-color: rgba(220, 53, 69, 0.4); }
.rs-card-loading { grid-template-columns: 1fr; color: var(--text-secondary); }

.rs-thumb {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--main);
    display: block;
}

.rs-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; }

.rs-card-title { margin: 0 0 4px; font-size: 1rem; line-height: 1.4; color: var(--text-primary); overflow-wrap: anywhere; }
.rs-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 12px; }
.rs-meta a { color: inherit; }
.rs-badge { padding: 2px 8px; border-radius: 6px; background: rgba(0, 178, 45, 0.12); color: var(--text-primary); font-weight: 700; font-size: 0.72rem; }
.rs-err-text { margin: 0; color: #dc3545; font-weight: 600; font-size: 0.9rem; line-height: 1.5; overflow-wrap: anywhere; }
.rs-err-src { margin: 4px 0 0; font-size: 0.78rem; color: var(--text-secondary); overflow-wrap: anywhere; }

.rs-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rs-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--main); }
.rs-item-info { flex: 1 1 140px; font-size: 0.85rem; color: var(--text-primary); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rs-item-info small { display: block; font-weight: 400; color: var(--text-secondary); }
.rs-card-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.rs-history { padding: 16px; margin-bottom: 30px; }
.rs-history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rs-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rs-history-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
}
.rs-history-btn:hover { background: rgba(0, 178, 45, 0.08); }
.rs-history-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rs-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.rs-modal[hidden] { display: none; }
.rs-modal-body { max-width: 100%; max-height: 100%; display: flex; }
.rs-modal-body img, .rs-modal-body video { max-width: 100%; max-height: 90vh; border-radius: 10px; background: #000; }
.rs-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 178, 45, 0.25);
    border-top-color: #00b22d;
    border-radius: 50%;
    animation: rs-spin 0.8s linear infinite;
    vertical-align: -3px;
    margin-right: 8px;
}
@keyframes rs-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
    .rs-card { grid-template-columns: 1fr; }
    .rs-thumb { width: 100%; height: 180px; }
    .rs-btn-primary { margin-left: 0; flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner-inline { animation: none; }
    .rs-btn { transition: none; }
}
