/* ============================================================
   RESCORE SCAN PLANNER — Frontend CSS
   Brand: Gold #ffd700 · Green #4CAF50 · Blue #2196F3
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Background wrapper — 70% on laptop, 100% on mobile ── */
#rspApp {
    font-family:'DM Sans','Outfit',system-ui,sans-serif;
    width:70%;
    max-width:1300px;
    margin:0 auto;
    padding:0 16px 80px;
    color:#1a1a2e;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
    position:relative;
    z-index:1;
}
/* Tablet: 85% */
@media (max-width: 1024px) { #rspApp { width:88%; } }
/* Mobile: 100% */
@media (max-width: 600px)  { #rspApp { width:100%; padding:0 12px 80px; } }
#rspApp * { box-sizing:border-box; }

/* Decorative background — visible on wide screens */
#rspApp::before {
    content:'';
    position:fixed;
    top:0; left:0; right:0; bottom:0;
    z-index:-1;
    background-color:#f5f7f9;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234CAF50' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        /* Side glow accents */
        radial-gradient(ellipse at 0% 30%, rgba(255,215,0,.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 50%, rgba(76,175,80,.07) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 80%, rgba(33,150,243,.06) 0%, transparent 40%),
        radial-gradient(ellipse at 100% 90%, rgba(255,215,0,.05) 0%, transparent 40%);
    pointer-events:none;
}

/* Floating decorative blobs */
#rspApp::after {
    content:'';
    position:fixed;
    top:120px; right:30px;
    width:200px; height:200px;
    border-radius:50%;
    background:radial-gradient(circle, rgba(76,175,80,.06) 0%, rgba(33,150,243,.03) 50%, transparent 70%);
    filter:blur(30px);
    z-index:-1;
    pointer-events:none;
}

.rsp-screen { animation:rspFadeIn .4s ease; }

/* Header */
.rsp-header { text-align:center; padding:24px 0 12px; }
.rsp-logo { font-family:'Outfit'; font-weight:800; font-size:14px; letter-spacing:2px; text-transform:uppercase; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.rsp-title { font-family:'Outfit'; font-weight:700; font-size:22px; color:#141B23; margin-top:4px; }
.rsp-subtitle { font-size:13px; color:#4b5563; margin-top:2px; }

/* Setup */
.rsp-step-label { text-align:center; font-size:14px; color:#555; margin:16px 0 12px; }
.rsp-exam-picks { display:flex; gap:12px; justify-content:center; margin:16px 0; flex-wrap:wrap; }
.rsp-exam-btn { padding:14px 28px; border:2px solid #e5e7eb; border-radius:14px; background:#fff; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; transition:all .2s; color:#333; }
.rsp-exam-btn:hover { border-color:#4CAF50; }
.rsp-exam-btn.active { border-color:#4CAF50; background:linear-gradient(135deg,rgba(255,215,0,.08),rgba(76,175,80,.08)); }

/* Sortable items */
.rsp-subj-group { margin-bottom:16px; }
.rsp-subj-label { font-family:'Outfit'; font-weight:700; font-size:13px; padding:6px 12px; border-radius:8px; margin-bottom:6px; display:inline-flex; align-items:center; gap:5px; }
.rsp-sort-list { list-style:none; padding:0; margin:0; min-height:30px; }
.rsp-sort-item { display:flex; align-items:center; gap:10px; padding:10px 14px; margin:4px 0; background:#fff; border:1px solid #f0f0f0; border-radius:10px; cursor:grab; font-size:14px; transition:all .15s; }
.rsp-sort-item:hover { border-color:#d0d0d0; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.rsp-drag { color:#c0c0c0; font-size:16px; flex-shrink:0; }
.rsp-num { width:24px; height:24px; border-radius:7px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; flex-shrink:0; color:#fff; }
.rsp-ch-label { flex:1; font-weight:500; }
.sortable-ghost { opacity:.3; }
.sortable-chosen { box-shadow:0 4px 16px rgba(0,0,0,.12); transform:scale(1.02); }

/* Buttons */
.rsp-save-row { text-align:center; margin:24px 0; }
.rsp-btn-primary { display:inline-flex; align-items:center; gap:8px; padding:14px 36px; border:none; border-radius:14px; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); color:#141B23; transition:all .2s; }
.rsp-btn-primary:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(76,175,80,.25); }
.rsp-btn-primary:disabled { opacity:.5; cursor:wait; }
.rsp-btn-secondary { display:inline-flex; align-items:center; gap:6px; padding:10px 20px; border:1.5px solid #e0e0e0; border-radius:12px; background:#fff; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; color:#555; transition:all .2s; }
.rsp-btn-secondary:hover { border-color:#4CAF50; color:#333; }

/* Setup action bar — always visible above chapter list */
.rsp-setup-actions { display:flex; gap:12px; justify-content:center; margin:14px 0 10px; position:sticky; top:0; z-index:5; background:#f5f7f9; padding:8px 0; }
.rsp-btn-skip { padding:10px 22px; border:1.5px solid #d0d5db; border-radius:20px; background:#fff; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; color:#4b5563; transition:all .2s; }
.rsp-btn-skip:hover { border-color:#5a6472; color:#374151; }
.rsp-setup-save { padding:10px 22px; border:none; border-radius:20px; background:#4CAF50; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; color:#fff; transition:all .2s; }
.rsp-setup-save:hover { background:#43A047; box-shadow:0 2px 8px rgba(76,175,80,.3); }
.rsp-setup-save:disabled { opacity:.5; cursor:wait; }

/* Scrollable chapter list in setup */
.rsp-setup-scroll { max-height:420px; overflow-y:auto; border:1.5px solid #e8e8e8; border-radius:14px; padding:12px; background:#fff; }
.rsp-setup-scroll::-webkit-scrollbar { width:4px; }
.rsp-setup-scroll::-webkit-scrollbar-track { background:transparent; }
.rsp-setup-scroll::-webkit-scrollbar-thumb { background:rgba(0,0,0,.15); border-radius:4px; }
.rsp-setup-scroll::-webkit-scrollbar-thumb:hover { background:rgba(0,0,0,.25); }
.rsp-setup-scroll { scrollbar-width:thin; scrollbar-color:rgba(0,0,0,.15) transparent; }

/* Login prompt */
.rsp-login-prompt { text-align:center; padding:40px; font-family:system-ui; }

/* ═════ TABS — Variant-Aware (matches scan-planner green+blue+gold theme) ═════ */
/* Stack as two full-width blocks — guaranteed alignment */
.rsp-tabs-wrap { display:flex; flex-direction:column; gap:8px; margin:14px 0; width:100%; }
.rsp-tabs-left { display:flex; gap:4px; background:linear-gradient(135deg,rgba(255,215,0,.08),rgba(76,175,80,.08),rgba(33,150,243,.08)); border-radius:14px; padding:5px; width:100%; box-sizing:border-box; }
.rsp-tabs-right { display:flex; gap:4px; background:rgba(0,0,0,.035); border-radius:14px; padding:5px; width:100%; box-sizing:border-box; }
/* Each tab inside a group takes equal share */
.rsp-tabs-left .rsp-tab, .rsp-tabs-right .rsp-tab { flex:1 1 0; min-width:0; justify-content:center; text-align:center; }

.rsp-tab { padding:10px 16px; border:none; background:transparent; border-radius:11px; font-family:inherit; font-size:13px; font-weight:600; color:#4b5563; cursor:pointer; transition:all .25s; white-space:nowrap; display:inline-flex; align-items:center; gap:5px; }
.rsp-tab:hover { color:#2E7D32; }

/* Active (free/meta) tabs — matches existing rsp-btn-primary gradient (gold→green→blue) */
.rsp-tabs-left .rsp-tab.active { background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); color:#141B23; box-shadow:0 2px 10px rgba(76,175,80,.30); }
.rsp-tabs-left .rsp-tab.active:hover { color:#141B23; }

/* Locked tabs — greyed with lock */
.rsp-tabs-right .rsp-tab { color:#8a8a8a; opacity:.85; }
.rsp-tabs-right .rsp-tab .rsp-lock-ico { width:13px; height:13px; flex-shrink:0; }
.rsp-tabs-right .rsp-tab.active { background:#fff; color:#141B23; box-shadow:0 2px 8px rgba(0,0,0,.10); opacity:1; }

/* Free count badge on first tab */
.rsp-tab-badge { display:inline-block; padding:1px 7px; border-radius:10px; background:#fff; color:#2E7D32; font-size:11px; font-weight:800; margin-left:3px; box-shadow:0 1px 3px rgba(0,0,0,.10); }
.rsp-tabs-left .rsp-tab.active .rsp-tab-badge { background:#141B23; color:#ffd700; }

/* Mobile locked dropdown button */
.rsp-locked-dropdown-btn { padding:10px 14px; border:1.5px dashed rgba(76,175,80,.40); border-radius:11px; background:rgba(76,175,80,.04); font-size:13px; font-weight:600; color:#2E7D32; cursor:pointer; display:none; align-items:center; gap:6px; white-space:nowrap; }
.rsp-locked-dropdown-btn:hover { background:rgba(76,175,80,.10); }
.rsp-locked-count { background:#ffd700; color:#141B23; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:800; }

/* Mobile: hide right-tab group, show dropdown instead */
@media (max-width: 600px) {
    .rsp-tabs-left .rsp-tab { font-size:12px; padding:10px 6px; }
    .rsp-tabs-right { display:none; }
    .rsp-locked-dropdown-btn { display:inline-flex; align-self:flex-start; }
}

/* Mobile slide-up panel for locked tabs */
.rsp-locked-sheet { position:fixed; left:0; right:0; bottom:-100%; background:#fff; border-top-left-radius:20px; border-top-right-radius:20px; box-shadow:0 -4px 32px rgba(0,0,0,.18); padding:18px 16px 24px; z-index:9999; transition:bottom .3s ease; max-height:75vh; overflow-y:auto; }
.rsp-locked-sheet.open { bottom:0; }
.rsp-locked-sheet-hdr { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.rsp-locked-sheet-title { font-size:15px; font-weight:700; color:#141B23; }
.rsp-locked-sheet-close { background:none; border:none; font-size:24px; color:#5a5a5a; cursor:pointer; }
.rsp-locked-sheet-item { display:flex; align-items:center; justify-content:space-between; padding:14px 10px; border-bottom:1px solid #f0f0f0; cursor:pointer; transition:background .15s; }
.rsp-locked-sheet-item:hover { background:#f8fafc; }
.rsp-locked-sheet-item:last-child { border-bottom:none; }
.rsp-locked-sheet-item-name { font-weight:600; color:#141B23; font-size:14px; display:flex; align-items:center; gap:8px; }
.rsp-locked-sheet-item-arrow { color:#0C54A0; font-size:16px; }
.rsp-locked-sheet-cta { display:block; text-align:center; margin-top:14px; padding:13px; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); color:#141B23; font-weight:700; border-radius:12px; text-decoration:none; }
.rsp-locked-sheet-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:9998; opacity:0; pointer-events:none; transition:opacity .3s; }
.rsp-locked-sheet-backdrop.open { opacity:1; pointer-events:auto; }

/* Status banner — green→blue gradient matching scan planner theme */
.rsp-variant-banner { background:linear-gradient(135deg,#4CAF50,#2196F3); color:#fff; border-radius:14px; padding:14px 18px; margin:10px 0; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; box-shadow:0 3px 12px rgba(76,175,80,.18); }
.rsp-variant-banner .rsp-vb-text { font-size:14.5px; font-weight:600; }
.rsp-variant-banner .rsp-vb-text strong { color:#ffd700; font-weight:800; font-size:17px; }
.rsp-variant-banner .rsp-vb-cta { background:#ffd700; color:#141B23; padding:8px 16px; border-radius:10px; font-weight:700; font-size:13px; text-decoration:none; white-space:nowrap; transition:all .2s; }
.rsp-variant-banner .rsp-vb-cta:hover { background:#ffdc4f; transform:translateY(-1px); box-shadow:0 4px 12px rgba(255,215,0,.35); }
@media (max-width: 480px) {
    .rsp-variant-banner { flex-direction:column; align-items:flex-start; }
    .rsp-variant-banner .rsp-vb-cta { align-self:stretch; text-align:center; }
}

/* Admin preview-mode notice */
.rsp-preview-notice { background:#fff8e1; border:1.5px solid #ffd700; border-radius:10px; padding:10px 14px; margin:10px 0; font-size:13px; color:#5d4400; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.rsp-preview-notice strong { color:#141B23; }
.rsp-preview-notice .rsp-pn-exit { color:#0C54A0; text-decoration:none; font-weight:600; font-size:12.5px; }
.rsp-preview-notice .rsp-pn-exit:hover { text-decoration:underline; }

/* ═════ LOCKED SCAN TYPE TEASER PANEL ═════ */
.rsp-locked-panel { background:linear-gradient(160deg,#fff,#f4faf5); border-radius:20px; padding:32px 24px; text-align:center; border:1px solid rgba(76,175,80,.12); }
.rsp-locked-panel-ico { width:72px; height:72px; margin:0 auto 16px; background:linear-gradient(135deg,rgba(255,215,0,.18),rgba(76,175,80,.15),rgba(33,150,243,.15)); border-radius:50%; display:flex; align-items:center; justify-content:center; }
.rsp-locked-panel-ico svg { width:36px; height:36px; stroke:#2E7D32; }
.rsp-locked-panel-count { font-family:'Outfit',sans-serif; font-weight:800; font-size:42px; color:#2E7D32; line-height:1; margin-bottom:4px; }
.rsp-locked-panel-label { font-size:16px; font-weight:700; color:#141B23; margin-bottom:8px; }
.rsp-locked-panel-desc { font-size:14px; color:#4b5563; max-width:440px; margin:0 auto 20px; line-height:1.55; }
.rsp-locked-panel-list { text-align:left; max-width:360px; margin:0 auto 20px; padding:14px 18px; background:#fff; border-radius:12px; border:1px solid #eef2f7; }
.rsp-locked-panel-list-title { font-size:12px; font-weight:700; color:#2E7D32; text-transform:uppercase; letter-spacing:.8px; margin-bottom:8px; }
.rsp-locked-panel-list ul { list-style:none; padding:0; margin:0; }
.rsp-locked-panel-list li { padding:5px 0; font-size:13.5px; color:#444; display:flex; justify-content:space-between; }
.rsp-locked-panel-list li span:last-child { color:#555; font-size:12.5px; }
.rsp-locked-panel-cta { display:inline-flex; align-items:center; gap:8px; padding:14px 32px; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); color:#141B23; border:none; border-radius:14px; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; box-shadow:0 4px 16px rgba(76,175,80,.30); text-decoration:none; transition:all .2s; }
.rsp-locked-panel-cta:hover { transform:translateY(-1px); box-shadow:0 6px 22px rgba(76,175,80,.40); }

/* ═════ FREEBIE VAULT — full-screen first-visit overlay ═════ */
.rsp-freebie-vault { position:fixed; inset:0; background:linear-gradient(135deg,rgba(12,84,160,.97),rgba(46,125,50,.97) 60%,rgba(255,215,0,.95)); z-index:99999; display:flex; align-items:center; justify-content:center; padding:24px; animation:rspFvIn .4s ease; }
@keyframes rspFvIn { from{opacity:0} to{opacity:1} }
.rsp-fv-card { background:#fff; border-radius:24px; padding:48px 36px 36px; max-width:540px; width:100%; text-align:center; box-shadow:0 20px 80px rgba(0,0,0,.30); position:relative; animation:rspFvSlideUp .5s ease; }
@keyframes rspFvSlideUp { from{transform:translateY(40px); opacity:0} to{transform:translateY(0); opacity:1} }
.rsp-fv-close { position:absolute; top:14px; right:18px; background:none; border:none; font-size:32px; color:#5a5a5a; cursor:pointer; line-height:1; padding:4px 10px; border-radius:50%; transition:all .15s; }
.rsp-fv-close:hover { background:#f3f4f6; color:#141B23; }
.rsp-fv-badge { display:inline-block; background:linear-gradient(135deg,#ffd700,#FED34F); color:#141B23; padding:8px 18px; border-radius:99px; font-size:12.5px; font-weight:800; letter-spacing:1.2px; margin-bottom:24px; }
.rsp-fv-counter { font-family:'Outfit',sans-serif; font-size:96px; font-weight:800; line-height:1; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; letter-spacing:-2px; margin-bottom:4px; }
.rsp-fv-label { font-size:22px; font-weight:800; color:#141B23; margin-bottom:8px; letter-spacing:-.3px; }
.rsp-fv-tagline { font-size:13px; font-weight:700; color:#2E7D32; letter-spacing:1px; margin-bottom:24px; }
.rsp-fv-breakdown { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-bottom:28px; padding:14px 8px; background:#f8fafc; border-radius:14px; }
.rsp-fv-bd-item { font-size:13.5px; color:#5f6c7e; font-weight:600; }
.rsp-fv-bd-item strong { color:#0C54A0; font-weight:800; font-size:15px; }
.rsp-fv-cta { display:inline-flex; align-items:center; gap:8px; padding:18px 36px; background:linear-gradient(135deg,#ffd700,#4CAF50,#2196F3); color:#141B23; border:none; border-radius:14px; font-family:inherit; font-size:17px; font-weight:800; cursor:pointer; box-shadow:0 6px 24px rgba(76,175,80,.30); transition:all .25s; width:100%; max-width:380px; justify-content:center; }
.rsp-fv-cta:hover { transform:translateY(-2px); box-shadow:0 10px 32px rgba(76,175,80,.42); }
.rsp-fv-trust { font-size:12.5px; color:#5f6c7e; margin-top:14px; font-weight:600; }
.rsp-fv-chapters { font-size:11.5px; color:#555; margin-top:18px; padding-top:18px; border-top:1px solid #f0f2f5; line-height:1.5; }
.rsp-fv-chapters strong { color:#5f6c7e; }
@media (max-width:480px) {
    .rsp-fv-card { padding:36px 22px 28px; }
    .rsp-fv-counter { font-size:72px; }
    .rsp-fv-label { font-size:19px; }
    .rsp-fv-cta { padding:16px 24px; font-size:15px; }
}

/* ═════ PANELS ═════ */
.rsp-panel { display:none; animation:rspFadeIn .3s ease; }
.rsp-panel.active { display:block; }

/* Stats */
.rsp-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:12px 0; }
.rsp-stat { text-align:center; padding:14px 8px; background:#fff; border-radius:12px; border:1px solid #f0f0f0; }
.rsp-stat-val { font-family:'Outfit'; font-weight:800; font-size:22px; }
.rsp-stat-lbl { font-size:11px; color:#4b5563; margin-top:2px; font-weight:600; }

/* Daily view */
.rsp-daily-header { display:flex; align-items:center; gap:8px; padding:10px 0; }
.rsp-pulse-dot { width:8px; height:8px; border-radius:50%; background:#4CAF50; animation:rspPulse 2s infinite; }
.rsp-daily-header span { font-weight:700; font-size:14px; color:#141B23; }
.rsp-hint { font-size:13px; color:#4b5563; margin:8px 0 12px; }

/* Rec cards */
.rsp-rec-card { background:#fff; border-radius:14px; padding:16px; margin:8px 0; border:1px solid #f0f0f0; transition:all .2s; }
.rsp-rec-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.06); }
.rsp-rec-top { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.rsp-rec-badge { padding:3px 10px; border-radius:8px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.rsp-rec-badge.revisit { background:rgba(244,67,54,.1); color:#c62828; }
.rsp-rec-badge.new { background:rgba(33,150,243,.1); color:#1565C0; }
.rsp-rec-badge.upgrade { background:rgba(255,152,0,.1); color:#E65100; }
.rsp-rec-subj { padding:3px 10px; border-radius:8px; font-size:11px; font-weight:600; }
.rsp-rec-name { font-weight:700; font-size:16px; color:#141B23; }
.rsp-rec-reason { font-size:13px; color:#4b5563; margin:4px 0 10px; }
.rsp-rec-actions { display:flex; gap:6px; flex-wrap:wrap; }
.rsp-scan-link { display:inline-flex; align-items:center; gap:4px; padding:7px 14px; border-radius:9px; border:none; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; text-decoration:none; transition:all .15s; background:rgba(33,150,243,.1); color:#1565C0; }
.rsp-scan-link:hover { transform:translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,.08); }
.rsp-scan-link.disabled { opacity:.4; cursor:default; pointer-events:none; }
.rsp-mark-btn { display:inline-flex; align-items:center; gap:4px; padding:7px 12px; border-radius:9px; border:1.5px dashed #d0d0d0; background:transparent; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; color:#555; }
.rsp-mark-btn:hover { border-color:#4CAF50; color:#4CAF50; }

/* Filter bar */
.rsp-filter-bar { display:flex; gap:6px; margin:10px 0; flex-wrap:wrap; }
.rsp-filter { padding:6px 14px; border-radius:10px; border:1.5px solid #e8e8e8; background:#fff; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; color:#666; transition:all .15s; }
.rsp-filter.active { border-color:#4CAF50; color:#141B23; background:rgba(76,175,80,.06); }

/* Chapter rows */
.rsp-ch-row { display:flex; align-items:center; gap:10px; padding:12px 14px; margin:5px 0; background:#fff; border-radius:12px; border:1px solid #f0f0f0; transition:all .2s; cursor:pointer; }
.rsp-ch-row:hover { box-shadow:0 2px 10px rgba(0,0,0,.05); }
.rsp-ch-row.expanded { border-color:#d0d0d0; border-radius:12px 12px 0 0; }

/* Ring */
.rsp-ring-wrap { width:42px; height:42px; flex-shrink:0; position:relative; }
.rsp-ring-wrap svg { width:42px; height:42px; transform:rotate(-90deg); }
.rsp-ring-bg { fill:none; stroke:#f0f0f0; stroke-width:3.5; }
.rsp-ring-fill { fill:none; stroke-width:3.5; stroke-linecap:round; transition:stroke-dashoffset .6s ease; }
.rsp-ring-pct { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:11px; font-weight:800; font-family:'Outfit'; }

.rsp-ch-info { flex:1; min-width:0; }
.rsp-ch-name { font-weight:600; font-size:14px; color:#141B23; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rsp-ch-meta { display:flex; align-items:center; gap:8px; margin-top:2px; }
.rsp-ch-health { font-size:11px; font-weight:700; }
.rsp-ch-days { font-size:11px; color:#5a6472; }
.rsp-ch-counts { font-size:11px; color:#666; }
.rsp-ch-arrow { flex-shrink:0; color:#ccc; transition:transform .2s; }
.rsp-ch-row.expanded .rsp-ch-arrow { transform:rotate(90deg); }

/* Chapter detail panel */
.rsp-ch-detail { display:none; margin:-4px 0 5px; background:#fafafa; border:1px solid #f0f0f0; border-top:none; border-radius:0 0 12px 12px; overflow:hidden; }
.rsp-ch-detail.open { display:block; animation:rspSlideDown .25s ease; }
.rsp-scan-group-label { padding:8px 14px; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#555; background:#f5f5f5; border-bottom:1px solid #eee; }
.rsp-scan-group-bar { display:flex; align-items:center; gap:6px; padding:0 14px 6px; font-size:11px; color:#666; }
.rsp-scan-group-bar .rsp-mini-bar { flex:1; max-width:120px; height:4px; background:#e8e8e8; border-radius:2px; overflow:hidden; }
.rsp-scan-group-bar .rsp-mini-fill { height:100%; background:#4CAF50; border-radius:2px; transition:width .3s; }
/* Clean thin scrollbar */
.rsp-scan-list::-webkit-scrollbar { width:4px; }
.rsp-scan-list::-webkit-scrollbar-track { background:transparent; }
.rsp-scan-list::-webkit-scrollbar-thumb { background:rgba(0,0,0,.15); border-radius:4px; }
.rsp-scan-list::-webkit-scrollbar-thumb:hover { background:rgba(0,0,0,.25); }
.rsp-scan-list { scrollbar-width:thin; scrollbar-color:rgba(0,0,0,.15) transparent; }

#rspApp ::-webkit-scrollbar { width:4px; }
#rspApp ::-webkit-scrollbar-track { background:transparent; }
#rspApp ::-webkit-scrollbar-thumb { background:rgba(0,0,0,.15); border-radius:4px; }
#rspApp ::-webkit-scrollbar-thumb:hover { background:rgba(0,0,0,.25); }

.rsp-plan-overlay ::-webkit-scrollbar { width:4px; }
.rsp-plan-overlay ::-webkit-scrollbar-track { background:transparent; }
.rsp-plan-overlay ::-webkit-scrollbar-thumb { background:rgba(0,0,0,.15); border-radius:4px; }
.rsp-plan-overlay ::-webkit-scrollbar-thumb:hover { background:rgba(0,0,0,.25); }
.rsp-plan-modal-body { scrollbar-width:thin; scrollbar-color:rgba(0,0,0,.15) transparent; }

.rsp-scan-list { max-height:360px; overflow-y:auto; }
.rsp-scan-item { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid #f0f0f0; }
.rsp-scan-item:last-child { border-bottom:none; }
.rsp-scan-item-info { flex:1; min-width:0; }
.rsp-scan-item-name { font-size:13px; font-weight:600; color:#333; }
.rsp-scan-item-meta { font-size:11px; color:#5a5a5a; margin-top:1px; }
.rsp-scan-item-status { font-size:11px; font-weight:700; }
.rsp-scan-item-status.done { color:#4CAF50; }
.rsp-scan-item-status.pending { color:#777; }
.rsp-scan-start { padding:6px 14px; border-radius:8px; border:none; font-family:inherit; font-size:11px; font-weight:600; cursor:pointer; text-decoration:none; background:rgba(33,150,243,.1); color:#1565C0; transition:all .15s; flex-shrink:0; }
.rsp-scan-start:hover { background:rgba(33,150,243,.2); }
.rsp-scan-plan-btn:hover { border-color:#2196F3 !important; color:#2196F3 !important; background:rgba(33,150,243,.05) !important; }

/* Empty state */
.rsp-empty { text-align:center; padding:40px 20px; }
.rsp-empty-icon { font-size:48px; margin-bottom:12px; }
.rsp-empty-text { font-size:14px; color:#4b5563; }

/* Multi-chapter scans section */
.rsp-multi-section { margin-top:20px; padding-top:16px; border-top:2px solid #f0f0f0; }
.rsp-multi-title { font-family:'Outfit'; font-weight:700; font-size:14px; color:#141B23; margin-bottom:10px; }

/* Reorder */
.rsp-reorder-actions { text-align:center; margin:20px 0; }

/* ════════════════════════════════════════
   CALENDAR
   ════════════════════════════════════════ */
.rsp-cal-header { display:flex; align-items:center; justify-content:space-between; padding:8px 0 12px; }
.rsp-cal-month { font-family:'Outfit'; font-weight:700; font-size:17px; color:#141B23; }
.rsp-cal-nav { display:flex; gap:6px; }
.rsp-cal-nav button { width:32px; height:32px; border:1.5px solid #e0e0e0; border-radius:10px; background:#fff; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .15s; color:#555; }
.rsp-cal-nav button:hover { border-color:#4CAF50; color:#4CAF50; }
.rsp-cal-today-btn { padding:6px 14px; border:1.5px solid #e0e0e0; border-radius:10px; background:#fff; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; color:#555; transition:all .15s; }
.rsp-cal-today-btn:hover { border-color:#4CAF50; color:#4CAF50; }

.rsp-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.rsp-cal-day-label { text-align:center; font-size:11px; font-weight:700; color:#5a6472; padding:6px 0; text-transform:uppercase; letter-spacing:.5px; }
.rsp-cal-cell { min-height:52px; background:#fff; border-radius:8px; padding:4px; cursor:pointer; border:1.5px solid transparent; transition:all .15s; position:relative; }
.rsp-cal-cell:hover { border-color:#e0e0e0; box-shadow:0 2px 8px rgba(0,0,0,.04); }
.rsp-cal-cell.today { border-color:#4CAF50; background:rgba(76,175,80,.04); }
.rsp-cal-cell.selected { border-color:#2196F3; background:rgba(33,150,243,.06); }
.rsp-cal-cell.other-month { opacity:.3; }
.rsp-cal-date { font-size:12px; font-weight:600; color:#333; padding:1px 4px; }
.rsp-cal-cell.today .rsp-cal-date { color:#4CAF50; font-weight:800; }
.rsp-cal-dots { display:flex; gap:2px; flex-wrap:wrap; padding:0 2px; margin-top:1px; }
.rsp-cal-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.rsp-cal-dot.completed { background:#4CAF50; }
.rsp-cal-dot.planned { background:#2196F3; }

/* Day detail panel */
.rsp-cal-detail { background:#fff; border-radius:14px; padding:16px; margin:10px 0; border:1px solid #f0f0f0; animation:rspFadeIn .2s ease; }
.rsp-cal-detail-date { font-family:'Outfit'; font-weight:700; font-size:15px; color:#141B23; margin-bottom:10px; }
.rsp-cal-detail-empty { font-size:13px; color:#666; text-align:center; padding:12px 0; }
.rsp-cal-scan-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #f5f5f5; }
.rsp-cal-scan-row:last-child { border-bottom:none; }
.rsp-cal-scan-status { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.rsp-cal-scan-status.completed { background:#4CAF50; }
.rsp-cal-scan-status.planned { background:#2196F3; }
.rsp-cal-scan-info { flex:1; min-width:0; }
.rsp-cal-scan-name { font-size:13px; font-weight:600; color:#333; }
.rsp-cal-scan-chapter { font-size:11px; color:#5a5a5a; }
.rsp-cal-scan-time { font-size:11px; color:#666; flex-shrink:0; }

/* Streak bar */
.rsp-streak-bar { display:flex; align-items:center; gap:10px; background:#fff; border-radius:12px; padding:10px 14px; margin:8px 0; border:1px solid #f0f0f0; }
.rsp-streak-fire { font-size:20px; }
.rsp-streak-info { flex:1; }
.rsp-streak-count { font-family:'Outfit'; font-weight:800; font-size:18px; color:#FF9800; }
.rsp-streak-label { font-size:11px; color:#4b5563; font-weight:600; }
.rsp-streak-dots { display:flex; gap:3px; }
.rsp-streak-dot { width:8px; height:8px; border-radius:50%; background:#e8e8e8; }
.rsp-streak-dot.active { background:#4CAF50; }
.rsp-streak-dot.today { background:#FF9800; box-shadow:0 0 0 2px rgba(255,152,0,.3); }

/* Calendar Legend */
.rsp-cal-legend { display:flex; align-items:center; gap:14px; padding:8px 0 4px; flex-wrap:wrap; }
.rsp-cal-legend-item { display:flex; align-items:center; gap:5px; font-size:11px; font-weight:600; color:#4b5563; }
.rsp-cal-legend-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.rsp-cal-legend-dot.green { background:#4CAF50; }
.rsp-cal-legend-dot.blue { background:#2196F3; }
.rsp-cal-legend-box { width:14px; height:14px; border-radius:4px; border:1.5px solid #4CAF50; flex-shrink:0; }
.rsp-cal-legend-box.today { background:rgba(76,175,80,.06); }
.rsp-cal-legend-box.selected { border-color:#2196F3; background:rgba(33,150,243,.06); }

/* Plan Scan Button */
.rsp-plan-btn { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; padding:10px; border:2px dashed #d0d0d0; border-radius:10px; background:transparent; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; color:#555; transition:all .15s; margin-top:8px; }
.rsp-plan-btn:hover { border-color:#2196F3; color:#2196F3; background:rgba(33,150,243,.03); }

/* Planning Modal Overlay */
.rsp-plan-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.4); z-index:10000; display:flex; align-items:center; justify-content:center; animation:rspFadeIn .2s ease; }
.rsp-plan-modal { background:#fff; border-radius:16px; width:92%; max-width:440px; max-height:80vh; overflow:hidden; box-shadow:0 16px 48px rgba(0,0,0,.2); animation:rspFadeIn .25s ease; display:flex; flex-direction:column; }
.rsp-plan-modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 18px; border-bottom:1px solid #f0f0f0; }
.rsp-plan-modal-title { font-family:'Outfit'; font-weight:700; font-size:16px; color:#141B23; }
.rsp-plan-modal-close { width:32px; height:32px; border:none; background:rgba(0,0,0,.05); border-radius:8px; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; color:#666; transition:all .15s; }
.rsp-plan-modal-close:hover { background:rgba(0,0,0,.1); }
.rsp-plan-modal-body { padding:14px 18px; overflow-y:auto; flex:1; }
.rsp-plan-modal-footer { padding:12px 18px; border-top:1px solid #f0f0f0; display:flex; gap:8px; justify-content:flex-end; }

/* Plan step label */
.rsp-plan-step { font-size:12px; font-weight:700; color:#4b5563; text-transform:uppercase; letter-spacing:.5px; margin:0 0 8px; }

/* Chapter picker in modal */
.rsp-plan-ch-item { display:flex; align-items:center; gap:8px; padding:9px 12px; border-radius:10px; cursor:pointer; transition:all .12s; border:1.5px solid transparent; margin:3px 0; }
.rsp-plan-ch-item:hover { background:rgba(0,0,0,.02); border-color:#e8e8e8; }
.rsp-plan-ch-item.selected { border-color:#2196F3; background:rgba(33,150,243,.05); }
.rsp-plan-ch-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.rsp-plan-ch-name { font-size:13px; font-weight:600; color:#333; }
.rsp-plan-ch-subj { font-size:11px; color:#555; margin-left:auto; }

/* Scan picker in modal */
.rsp-plan-scan-item { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; cursor:pointer; transition:all .12s; border:1.5px solid transparent; margin:2px 0; }
.rsp-plan-scan-item:hover { background:rgba(0,0,0,.02); border-color:#e8e8e8; }
.rsp-plan-scan-item.selected { border-color:#2196F3; background:rgba(33,150,243,.05); }
.rsp-plan-scan-name { font-size:13px; font-weight:600; color:#333; }
.rsp-plan-scan-meta { font-size:11px; color:#5a5a5a; }
.rsp-plan-scan-type { font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; }

/* Planned scan row actions */
.rsp-cal-scan-actions { display:flex; gap:4px; flex-shrink:0; }
.rsp-cal-scan-start { padding:4px 10px; border-radius:6px; border:none; font-family:inherit; font-size:11px; font-weight:600; cursor:pointer; text-decoration:none; background:rgba(33,150,243,.1); color:#1565C0; transition:all .15s; }
.rsp-cal-scan-start:hover { background:rgba(33,150,243,.2); }
.rsp-cal-scan-remove { padding:4px 8px; border-radius:6px; border:none; font-family:inherit; font-size:11px; font-weight:600; cursor:pointer; background:rgba(244,67,54,.08); color:#c62828; transition:all .15s; }
.rsp-cal-scan-remove:hover { background:rgba(244,67,54,.15); }

/* Toast */
.rsp-toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(80px); padding:12px 24px; background:#141B23; color:#fff; border-radius:12px; font-family:inherit; font-size:14px; font-weight:600; z-index:9999; transition:transform .3s; box-shadow:0 8px 24px rgba(0,0,0,.2); pointer-events:none; }
.rsp-toast.show { transform:translateX(-50%) translateY(0); }

/* Animations */
@keyframes rspFadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes rspSlideDown { from{opacity:0;max-height:0} to{opacity:1;max-height:400px} }
@keyframes rspPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Responsive */
@media(max-width:480px){
    #rspApp { padding:0 8px 80px; }
    .rsp-stats { grid-template-columns:repeat(2,1fr); }
    .rsp-title { font-size:19px; }
    .rsp-cal-cell { min-height:44px; }
    .rsp-cal-date { font-size:11px; }
    .rsp-setup-actions { flex-direction:column; gap:8px; }
    .rsp-setup-actions button { width:100%; justify-content:center; }
    .rsp-setup-scroll { max-height:350px; }
}