.rl-page {
    min-height: 100vh;
    background: var(--bg);
    padding: 80px 0 60px;
}

/* ── Header ── */
.rl-header {
    background: linear-gradient(180deg, #1a1a2e 0%, var(--bg) 100%);
    padding: 40px 0 0;
    margin-bottom: 0;
}

.rl-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.rl-username {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 20px;
}
.rl-username span { color: var(--accent); }

/* ── Stats bar (desktop tabs) ── */
.rl-stats {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 0;
}

.rl-stat {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s, background 0.2s;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rl-stat:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.rl-stat.active { border-bottom-color: var(--accent); color: var(--text); }

.rl-stat-num {
    display: block;
    font-size: 1.4rem;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    color: var(--text);
    line-height: 1;
    margin-bottom: 2px;
}

.rl-stat.reading    .rl-stat-num { color: #4fc3f7; }
.rl-stat.completed  .rl-stat-num { color: #81c784; }
.rl-stat.plantoread .rl-stat-num { color: #ffb74d; }
.rl-stat.dropped    .rl-stat-num { color: #e57373; }

/* ── Layout switches ── */
.rl-desktop-only { display: block; }
.rl-mobile-only  { display: none; }

/* ── Desktop content area ── */
.rl-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ── Empty state ── */
.rl-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}
.rl-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.rl-empty p { font-size: 0.95rem; margin-bottom: 20px; }
.rl-empty a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}
.rl-empty a:hover { opacity: 0.85; }

/* ── Desktop table ── */
.rl-table {
    width: 100%;
    border-collapse: collapse;
}

.rl-table thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.rl-table thead th.col-score,
.rl-table thead th.col-status,
.rl-table thead th.col-date { text-align: center; }

.rl-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}
.rl-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.rl-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.rl-title-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.rl-cover {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--card-bg);
}

.rl-title-text { min-width: 0; }

.rl-title-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    transition: color 0.15s;
}
.rl-title-link:hover { color: var(--accent); }

.rl-chapters { font-size: 0.75rem; color: var(--muted); margin-top: 3px; }

.col-score, .col-status, .col-date, .col-actions {
    text-align: center;
    white-space: nowrap;
}

.rl-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.rl-status-badge.reading    { background: rgba(79,195,247,0.15);  color: #4fc3f7; }
.rl-status-badge.completed  { background: rgba(129,199,132,0.15); color: #81c784; }
.rl-status-badge.plantoread { background: rgba(255,183,77,0.15);  color: #ffb74d; }
.rl-status-badge.dropped    { background: rgba(229,115,115,0.15); color: #e57373; }

.rl-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.15rem;
    letter-spacing: 1px;
    color: var(--gold, #f5c518);
}
.rl-score.none {
    color: var(--muted);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0;
}

.rl-date { font-size: 0.78rem; color: var(--muted); }

.rl-actions-form { display: inline; }

.rl-btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}
.rl-btn-remove:hover { color: #e57373; }

/* ── Mobile ── */
@media (max-width: 640px) {
    .rl-desktop-only { display: none; }
    .rl-mobile-only  { display: block; }

    /* Tabs scroll horizontally on small screens */
    .rl-stats {
        overflow-x: auto;
        scrollbar-width: none;
        flex-wrap: nowrap;
    }
    .rl-stats::-webkit-scrollbar { display: none; }
    .rl-stat { flex: 0 0 auto; min-width: 100px; padding-left: 16px; padding-right: 16px; }

    /* ── Mobile sections container ── */
    .rl-sections-container {
        display: block;
    }

    .rl-section {
        display: none;
        padding: 20px 20px 32px;
    }

    .rl-section.active {
        display: block;
    }

    .rl-section-hd {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 0 10px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }

    .rl-section-dot {
        width: 9px;
        height: 9px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .rl-section-dot.reading    { background: #4fc3f7; }
    .rl-section-dot.completed  { background: #81c784; }
    .rl-section-dot.plantoread { background: #ffb74d; }
    .rl-section-dot.dropped    { background: #e57373; }

    .rl-section-name {
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: var(--text);
    }

    .rl-section-count {
        margin-left: auto;
        font-size: 0.78rem;
        color: var(--muted);
        background: rgba(255,255,255,0.06);
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 500;
    }

    .rl-section-empty {
        padding: 24px 0;
        text-align: center;
        color: var(--muted);
        font-size: 0.85rem;
        font-style: italic;
    }

    /* ── All view (flat vertical list) ── */
    .rl-all-view {
        display: none;
        padding: 16px 20px 32px;
        overflow-y: auto;
    }

    /* ── Mobile cards ── */
    .rl-cards { display: flex; flex-direction: column; }

    .rl-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .rl-card:last-child { border-bottom: none; }

    .rl-card-cover-wrap { flex-shrink: 0; }

    .rl-card-cover {
        width: 44px;
        height: 62px;
        object-fit: cover;
        border-radius: 5px;
        display: block;
        background: var(--card-bg);
    }

    .rl-card-body { flex: 1; min-width: 0; }

    .rl-card-title {
        color: var(--text);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.35;
        transition: color 0.15s;
    }
    .rl-card-title:hover { color: var(--accent); }

    .rl-card-meta { font-size: 0.75rem; color: var(--muted); margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
    .rl-sep { opacity: 0.45; }

    /* Status dot shown in the all-view cards */
    .rl-card-dot {
        display: inline-block;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .rl-card-dot.reading    { background: #4fc3f7; }
    .rl-card-dot.completed  { background: #81c784; }
    .rl-card-dot.plantoread { background: #ffb74d; }
    .rl-card-dot.dropped    { background: #e57373; }

    /* Remove button always visible on mobile */
    .rl-mobile-only .rl-btn-remove {
        display: flex;
        opacity: 1;
        align-items: center;
        flex-shrink: 0;
    }

    /* Mobile empty state padding */
    .rl-mobile-only .rl-empty { padding: 60px 20px; }
}

/* ── "Add to List" dropdown (detail page) ── */
.atl-dropdown {
    position: relative;
    display: inline-block;
    margin: 12px 0 20px;
}

.atl-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: var(--card-bg, #1e1e2e);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
}
.atl-trigger:hover { border-color: var(--accent); background: rgba(232,68,90,0.06); }
.atl-trigger--active { border-color: var(--accent); background: rgba(232,68,90,0.1); color: var(--accent); }
.atl-trigger--guest { opacity: 0.7; }
.atl-trigger--guest:hover { opacity: 1; color: var(--text); }
.atl-trigger-icon { font-size: 0.9rem; line-height: 1; }

.atl-chevron { transition: transform 0.2s; flex-shrink: 0; opacity: 0.7; }
.atl-dropdown.open .atl-chevron { transform: rotate(180deg); }

.atl-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: #1e1e2e;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 200;
}
.atl-dropdown.open .atl-menu { display: block; }
.atl-menu form { display: contents; }

.atl-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.atl-option:hover { background: rgba(255,255,255,0.06); }
.atl-option--active { color: var(--accent); }
.atl-option--remove { color: #e57373; font-size: 0.8rem; }
.atl-option--remove:hover { background: rgba(229,115,115,0.08); }

.atl-check { margin-left: auto; font-size: 0.75rem; color: var(--accent); }

.atl-option-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.atl-dot-reading    { background: #4fc3f7; }
.atl-dot-completed  { background: #81c784; }
.atl-dot-plantoread { background: #ffb74d; }
.atl-dot-dropped    { background: #e57373; }

.atl-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Inline remove confirmation */
.rl-confirm-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.rl-confirm-label {
    font-size: 0.75rem;
    color: var(--muted);
}
.rl-confirm-yes,
.rl-confirm-no {
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 0.72rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.rl-confirm-yes {
    background: rgba(229,115,115,0.15);
    border-color: #e57373;
    color: #e57373;
}
.rl-confirm-yes:hover { background: rgba(229,115,115,0.3); }
.rl-confirm-no {
    background: rgba(255,255,255,0.06);
    border-color: var(--border);
    color: var(--muted);
}
.rl-confirm-no:hover { background: rgba(255,255,255,0.12); }
