/* Thought Lab — Design System */
/* Modeled on the Perf Dashboard aesthetic */

:root {
    /* Colors */
    --accent: #ff4500;
    --accent-light: #fff1ec;
    --accent-hover: #e03d00;
    --bg: #f8f9fb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --text: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --success: #059669;
    --success-bg: #ecfdf5;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --warning-bg: #fffbeb;

    /* Tags */
    --tag-post-bg: #ede9fe;
    --tag-post-text: #6d28d9;
    --tag-comment-bg: #dbeafe;
    --tag-comment-text: #1d4ed8;
    --tag-removed-bg: #fee2e2;
    --tag-removed-text: #991b1b;
    --tag-meta-bg: #f3f4f6;
    --tag-meta-text: #374151;

    /* Spacing (8px scale) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;

    /* Typography */
    --font: 'Poppins', system-ui, -apple-system, sans-serif;
    --font-scale: 1.15;
    --radius: 12px;
    --radius-sm: 8px;

    /* Shadows */
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-accent: 0 4px 14px rgba(255,69,0,0.25), 0 2px 4px rgba(255,69,0,0.1);

    /* Transitions */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Animations ─── */
@keyframes rl-fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rl-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes rl-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: calc(14px * var(--font-scale));
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.auth-heading p a {
    font-size: 14px;
}
/* Layout */
.rl-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-4);
    overflow: hidden;
}

/* ─── Top Bar ─── */
.rl-topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.rl-topbar-left { display: flex; align-items: center; gap: var(--space-3); }
.rl-topbar-left-actions { display: flex; align-items: center; gap: var(--space-1); }
.rl-topbar-left-actions .rl-btn-sm { font-size: calc(10px * var(--font-scale)); padding: 2px 6px; }
.rl-topbar h1 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
}
.rl-topbar h1 .preface {
    padding-right: 2px;
}
.rl-topbar .rl-subtitle {
    font-size: calc(13px * var(--font-scale));
    color: var(--text-muted);
}
.rl-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ─── Stat Row ─── */
.rl-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
/* Bento variants */
.rl-stat-card.rl-bento-wide { grid-column: span 2; }
.rl-stat-card.rl-bento-accent-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.rl-stat-card.rl-bento-accent-green::before { background: linear-gradient(90deg, #059669, #34d399); }
.rl-stat-card.rl-bento-accent-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.rl-stat-card {
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    padding: var(--space-4);
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    animation: rl-scaleIn 0.25s ease both;
}
.rl-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ff6b35);
    opacity: 0.7;
}
.rl-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.rl-stat-card:nth-child(1) { animation-delay: 0ms; }
.rl-stat-card:nth-child(2) { animation-delay: 50ms; }
.rl-stat-card:nth-child(3) { animation-delay: 100ms; }
.rl-stat-card:nth-child(4) { animation-delay: 150ms; }
.rl-stat-card:nth-child(5) { animation-delay: 200ms; }
.rl-stat-card:nth-child(6) { animation-delay: 250ms; }
.rl-stat-card:nth-child(7) { animation-delay: 300ms; }
.rl-stat-card:nth-child(8) { animation-delay: 350ms; }
.rl-stat-label {
    font-size: calc(11px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
.rl-stat-value {
    font-size: calc(26px * var(--font-scale));
    font-weight: 600;
    color: var(--text);
}

/* ─── Filter Bar ─── */
.rl-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    animation: rl-fadeIn 0.3s ease 0.1s both;
}
.rl-filter-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.rl-item-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}
.rl-item-actions-bar .rl-pill {
    font-size: calc(11px * var(--font-scale));
    padding: 3px 10px;
}
.rl-filter-bar .rl-sep {
    width: 1px;
    height: 20px;
    background: rgba(0,0,0,0.08);
    margin: 0 var(--space-2);
}
.rl-search-input {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: calc(13px * var(--font-scale));
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    width: 160px;
    outline: none;
    transition: border-color var(--transition);
}
.rl-search-input:focus { border-color: var(--accent); }
.rl-search-input::placeholder { color: var(--text-muted); }
.rl-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 6px 14px;
    font-size: calc(13px * var(--font-scale));
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}
.rl-pill:hover {
    background: #eef0f3;
    color: var(--text);
    transform: translateY(-1px);
}
.rl-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}
.rl-pill.active:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255,69,0,0.3);
}
.rl-pill-group {
    display: flex;
    gap: var(--space-1);
}
.rl-pill-group .rl-pill {
    border-radius: 999px;
}

/* ─── Taxonomy Filter Bar ─── */
.rl-filter-bar-taxonomy {
    margin-top: calc(-1 * var(--space-4));
    margin-bottom: var(--space-5);
}
.rl-taxonomy-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* ─── Subreddit Pills Card ─── */
.rl-sub-card {
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    position: relative;
    overflow: hidden;
    animation: rl-scaleIn 0.25s ease both;
}
.rl-sub-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fb923c);
    opacity: 0.7;
}
.rl-sub-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
    margin-bottom: var(--space-4);
}
.rl-sub-card-header .rl-collapse-arrow {
    font-size: 10px;
    transition: transform var(--transition);
    color: var(--text-muted);
}
.rl-sub-card-header .rl-sub-card-title {
    font-size: calc(15px * var(--font-scale));
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}
.rl-sub-card.collapsed .rl-collapse-arrow {
    transform: rotate(-90deg);
}
.rl-sub-card.collapsed .rl-sub-card-header {
    margin-bottom: 0;
}
.rl-sub-card.collapsed .rl-sub-sections-row {
    display: none;
}
.rl-sub-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}
@media (max-width: 768px) {
    .rl-sub-sections-row { grid-template-columns: 1fr; }
}
.rl-sub-section {
    margin-bottom: 0;
}
.rl-sub-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.rl-sub-section-title {
    font-size: calc(13px * var(--font-scale));
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    flex-shrink: 0;
}
.rl-count-filter {
    display: flex;
    align-items: center;
    gap: 2px;
}
.rl-count-filter .rl-pill {
    padding: 2px 8px;
    font-size: calc(10px * var(--font-scale));
    min-width: 0;
}
.rl-sub-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-4);
}
.rl-sub-pill {
    --pill-scale: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: calc(4px * var(--pill-scale)) calc(12px * var(--pill-scale));
    font-size: calc(12px * var(--font-scale) * var(--pill-scale));
    font-weight: 500;
    color: #4b5563;
    background: #f0f1f4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}
.rl-sub-pill:hover {
    background: #e5e7eb;
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.rl-sub-pill.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
}
.rl-sub-pill-count {
    font-weight: 700;
    opacity: 0.7;
}
.rl-sub-pill.active .rl-sub-pill-count { opacity: 1; }

/* ─── Item Count Row ─── */
.rl-item-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    font-size: calc(12px * var(--font-scale));
    color: var(--text-muted);
}
.rl-item-count-actions {
    display: flex;
    gap: var(--space-2);
}

/* ─── Deleted Stat Card ─── */
.rl-stat-deleted .rl-stat-value { color: var(--text-muted); }
.rl-stat-deleted .rl-stat-label { color: var(--tag-removed-text, #dc2626); }
.rl-stat-deleted::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.rl-stat-removed .rl-stat-value { color: var(--text-muted); }
.rl-stat-removed .rl-stat-label { color: #b45309; }
.rl-stat-removed::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ─── Deleted Tag ─── */
.rl-tag-deleted {
    background: #fef2f2;
    color: #991b1b;
    cursor: default;
}

/* ─── Buttons ─── */
.rl-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 6px;
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.login form,
.index form {
  min-height: 222px;
}
.login .rl-btn,
.index .rl-btn {
    padding: 16px;
    font-size: calc(13px * var(--font-scale));
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    max-width: 229px;
    text-align: center;
    align-items: unset;
    display: unset;
    gap: unset;
    min-width: 100px;
}
.rl-btn:hover { background: var(--bg); text-decoration: none; box-shadow: var(--shadow-sm); }
.rl-btn:active { transform: scale(0.97); transition-duration: 0.1s; }
.rl-btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}
.rl-btn-accent:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(255,69,0,0.3); }
.rl-btn-accent:active { transform: scale(0.96); }
.rl-btn-accent span { color: #fff !important; }
.rl-btn-auth-sm { transform: scale(0.85); }
.rl-btn-sm {
    padding: 4px 10px;
    font-size: calc(11px * var(--font-scale));
}
.rl-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
.rl-btn-ghost:hover { color: var(--text); background: var(--bg); }
a.rl-btn.rl-btn-ghost:hover { color: #ff4500; }
.rl-btn-active { font-weight: 700; background: var(--bg); color: #ff4500; }
a.rl-btn.rl-btn-ghost.rl-btn-active {
    padding: 0 6px;
}
.rl-btn-brand:hover span { opacity: 0.8; }
.rl-btn-brand { text-decoration: none; }
a.rl-btn.rl-btn-ghost.rl-btn-brand { gap: 0; }

/* ─── Cards ─── */
.rl-card {
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.rl-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
/* Cards animate on scroll via IntersectionObserver in app.js — scoped to dashboard only */
#items-container .rl-card { animation: none; opacity: 0; }
#items-container .rl-card.rl-visible { animation: rl-fadeInUp 0.3s ease both; }
@media (prefers-reduced-motion: reduce) {
    #items-container .rl-card { opacity: 1; }
    #items-container .rl-card.rl-visible { animation: none; }
}
.rl-card.removed { opacity: 0.5; }
.rl-card.deleted { opacity: 0.5; }

.rl-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.rl-card-num {
    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
    color: var(--text-light);
    min-width: 28px;
    flex-shrink: 0;
}
.rl-card-title {
    font-size: calc(14px * var(--font-scale));
    font-weight: 600;
    color: var(--text);
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}
.rl-card-title a { color: inherit; }
.rl-card-title a:hover { color: var(--accent); text-decoration: none; }

.rl-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    font-size: calc(12px * var(--font-scale));
    color: var(--text-muted);
    margin-left: calc(28px + var(--space-3));
}
.rl-card-meta span[data-stat] {
    transition: color var(--transition);
}
.rl-stat-highlight {
    color: mediumvioletred !important;
    font-weight: 600;
}

/* ─── Tags ─── */
.rl-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: calc(11.5px * var(--font-scale));
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
}
.rl-tag-post { background: var(--tag-post-bg); color: var(--tag-post-text); }
.rl-tag-comment { background: var(--tag-comment-bg); color: var(--tag-comment-text); }
.rl-tag-meta { background: var(--tag-meta-bg); color: var(--tag-meta-text); }
.rl-tag-sub {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0;
    max-width: 15ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.rl-card.collapsed .rl-card-meta,
.rl-card.collapsed .rl-body-text {
    display: none;
}

body.thoughtlab,
body.analysis {
    background: #FAF8F5;
}

body.thoughtlab .rl-card[data-type="post"] {
    background: var(--card-bg-post, #fff);
}
body.thoughtlab .rl-card[data-type="comment"] {
    background: var(--card-bg-comment, #F5F2ED);
}

.rl-body-text {
    margin: var(--space-3) 0 0 calc(28px + var(--space-3));
    padding: var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: calc(13px * var(--font-scale));
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}
.rl-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: calc(11px * var(--font-scale));
    cursor: pointer;
    padding: 2px 4px;
    font-family: inherit;
}
.rl-expand-btn:hover { color: var(--text); }
.rl-expand-btn .arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 10px;
}
.rl-expand-btn.collapsed .arrow { transform: rotate(-90deg); }

/* ─── Inline Edit (inside .rl-card-meta) ─── */
.rl-inline-edit-field {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.rl-inline-edit-label {
    font-size: calc(10px * var(--font-scale));
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
    user-select: none;
}
.rl-editable {
    padding: 2px 6px;
    font-size: calc(11px * var(--font-scale));
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    cursor: text;
    transition: all var(--transition);
    min-width: 50px;
    max-width: 120px;
}
.rl-editable:hover {
    border-color: #d1d5db;
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.rl-editable:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(255,69,0,0.1);
}
.rl-editable.saved {
    border-color: var(--success);
    background: var(--success-bg);
}
.rl-editable::placeholder { color: var(--text-light); }


/* ─── Alerts ─── */
.rl-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: calc(13px * var(--font-scale));
    margin-bottom: var(--space-4);
}
.rl-alert-success { background: var(--success-bg); color: var(--success); }
.rl-alert-error { background: var(--error-bg); color: var(--error); }

/* ─── Landing Page ─── */
.rl-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 25vh;
    text-align: center;
}
.rl-landing h1 {
    font-size: calc(36px * var(--font-scale));
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2);
}
.rl-landing p {
    color: var(--text-muted);
    font-size: calc(15px * var(--font-scale));
    margin-bottom: var(--space-6);
    max-width: 100%;
    width: 500px;
}
p.smaller a {
    font-size: 14px;
    color: rgb(105, 115, 134);
}
.rl-input-group {
    display: flex;
    gap: var(--space-2);
    width: 100%;
    max-width: 420px;
    padding: 44px 0;
}
.rl-input {
    flex: 1;
    padding: 10px 16px;
    font-size: calc(15px * var(--font-scale));
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}
.rl-input:focus {
    outline: none;
    border-color: var(--accent);
}
.rl-recent {
    margin-top: var(--space-6);
    text-align: center;
    max-width: 777px;
}
.rl-recent h3 {
    font-size: calc(12px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: var(--space-3);
}
.rl-recent-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
}
.rl-recent-list a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px;
    font-size: calc(13px * var(--font-scale));
    color: var(--text);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.rl-recent-list a:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    text-decoration: none;
}
.rl-recent-list li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.rl-recent-list li.rl-primary a {
    border: 2px solid var(--success, #22c55e);
}
.rl-recent-list li.rl-primary a:hover {
    border-color: var(--success, #22c55e);
}
.rl-account-delete {
    margin-left: 6px;
    font-size: calc(14px * var(--font-scale));
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition), color var(--transition);
}
.rl-recent-list a:hover .rl-account-delete {
    opacity: 1;
}
.rl-account-delete:hover {
    color: var(--error, #ef4444);
}
.rl-account-check {
    margin-left: 4px;
    font-size: calc(13px * var(--font-scale));
    line-height: 1;
    color: var(--text-muted, #aaa);
    cursor: pointer;
    transition: color var(--transition);
}
.rl-account-check:hover {
    color: var(--success, #22c55e);
}
.rl-account-check.is-primary {
    color: var(--success, #22c55e);
    cursor: default;
}

/* ─── Utilities ─── */
.rl-text-muted { color: var(--text-muted); }
.rl-text-sm { font-size: calc(12px * var(--font-scale)); }

/* ─── Profile Bar ─── */
.rl-profile-bar {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    animation: rl-fadeIn 0.4s ease both;
}
.rl-profile-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #ff8c42, #ffb366);
}
.rl-profile-left {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    flex-shrink: 0;
}
a.rl-profile-name {
    font-size: calc(12px * var(--font-scale));
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--accent);
}
.thoughtlab a.rl-profile-name {
    font-size: calc(18px * var(--font-scale));
}
a.rl-profile-name:hover {
    color: var(--accent);
}
.rl-profile-age {
    font-size: calc(12px * var(--font-scale));
    color: var(--text-muted);
}
.rl-profile-bio {
    font-size: calc(12px * var(--font-scale));
    color: var(--text-muted);
    margin-top: var(--space-1);
    max-width: 280px;
    line-height: 1.4;
}
.rl-profile-karma {
    display: flex;
    gap: var(--space-4);
    flex: 1;
    justify-content: center;
}
.rl-profile-karma-item {
    text-align: center;
}
.rl-profile-karma-value {
    display: block;
    font-size: calc(18px * var(--font-scale));
    font-weight: 700;
    color: var(--text);
}
.rl-profile-karma-label {
    display: block;
    font-size: calc(10px * var(--font-scale));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.rl-profile-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
    flex-shrink: 0;
}
.rl-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    justify-content: flex-end;
}
.rl-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: calc(11px * var(--font-scale));
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rl-badge-gold { background: #fef9e7; color: #a16207; }
.rl-badge-verified { background: #e8f1fe; color: #2563eb; }
.rl-badge-email { background: #ecfdf5; color: #059669; }
.rl-badge-mod { background: #f3f0ff; color: #7c3aed; }
.rl-badge-nsfw { background: #fee2e2; color: #991b1b; }
.rl-profile-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
    .rl-stat-row { grid-template-columns: repeat(2, 1fr); }
    .rl-stat-card.rl-bento-wide { grid-column: span 1; }
    .rl-topbar { flex-direction: column; align-items: flex-start; }
    .rl-card-meta { margin-left: 0; }
    .rl-body-text { margin-left: 0; }
    .rl-input-group { flex-direction: column; }
    .rl-filter-bar { gap: var(--space-1); }
    .rl-profile-bar { flex-direction: column; gap: var(--space-3); }
    .rl-profile-karma { justify-content: flex-start; }
    .rl-profile-right { align-items: flex-start; }
}

/* Spinner for fetch progress */
.rl-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: rl-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: var(--space-2);
}
@keyframes rl-spin {
    to { transform: rotate(360deg); }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    /* Topbar — wrap properly */
    .rl-topbar-left {
        flex-wrap: wrap;
        overflow: hidden;
        width: 100%;
        padding: 12px;
    }
    .rl-topbar-left-actions { width: 100%; }
    .rl-topbar-right { flex-wrap: wrap; }
}

@media (max-width: 500px) {
    .rl-btn {
        padding: 8px 11px;
    }
    .rl-disclaimer {
        padding: 1rem 0%;
        font-size: .575rem;
    }
}


/* ─── Activity Heatmap ─── */
.rl-heatmap-container {
    margin-bottom: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    animation: rl-fadeIn 0.4s ease 0.15s both;
}
.rl-heatmap-wrap {
    display: flex;
    gap: 4px;
}
.rl-heatmap-labels {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 2px;
    flex-shrink: 0;
    padding-right: 2px;
}
.rl-heatmap-labels span {
    font-size: 9px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.rl-heatmap {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 2px;
    flex: 1;
}
.rl-heatmap-cell {
    aspect-ratio: 1;
    width: 100%;
    border-radius: 2px;
    transition: transform 0.15s ease;
}
.rl-heatmap-cell:hover {
    transform: scale(1.3);
    outline: 1px solid var(--text-muted);
    z-index: 1;
}
.rl-heatmap-empty { background: transparent; }
.rl-heatmap-0 { background: #ebedf0; }
.rl-heatmap-1 { background: #ffcbb5; }
.rl-heatmap-2 { background: #ff9b7a; }
.rl-heatmap-3 { background: #ff6b3f; }
.rl-heatmap-4 { background: #ff4500; }
.rl-heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: var(--space-2);
    max-width: 154px;
    gap: 4px;
    margin-left: auto;
}
.rl-heatmap-legend .rl-heatmap-cell { cursor: default; }
.rl-heatmap-legend .rl-heatmap-cell:hover { transform: none; outline: none; }

/* ─── Focus Visible ─── */
.rl-pill:focus-visible,
.rl-btn:focus-visible,
.rl-sub-pill:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ─── Touch Devices ─── */
@media (hover: none) {
    .rl-card:hover,
    .rl-stat-card:hover,
    .rl-sub-pill:hover,
    .rl-pill:hover,
    .rl-recent-list a:hover {
        transform: none;
    }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ─── Auth Pages (Login / Register) ─── */
.auth-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    overflow: hidden;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* Left Panel */
.auth-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 96px 80px;
    position: relative;
    overflow-y: auto;
}
.auth-left-inner {
    max-width: 452px;
    width: 100%;
    margin: 0 auto 75px;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 64px;
}
body.application .auth-logo,
body.account .auth-logo {
    margin: 0 auto 27px;
    width: max-content;
}
.auth-logo-icon {
    width: 32px;
    height: 32px;
    background: #ff5722;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(255,87,34,0.2), 0 4px 6px -4px rgba(255,87,34,0.2);
}
.auth-logo-text {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #1a1a1a;
}
.auth-logo-text span {
    color: #ff5722;
}
.auth-logo-text span.preface {
    color: #1a1a1a;
    padding-right: 2px;
}
.rl-topbar-left .live-icon {
    margin-left: -9px;
    flex-shrink: 0;
    margin-top: -4px;
    rotate: 15deg;
}


/* Headings */
.auth-heading {
    margin-bottom: 48px;
}
.auth-heading h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 48px;
    font-weight: 300;
    font-style: italic;
    color: #1a1a1a;
    letter-spacing: -1.2px;
    margin-bottom: 12px;
    line-height: 1.1;
}
.auth-heading p {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.auth-field {
    position: relative;
}
.auth-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ff5722;
    margin-bottom: 0;
}
.auth-input {
    width: 100%;
    padding: 12px 0 12px 13px;
    font-size: 16px;
    font-family: inherit;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-bottom: 1.6px solid #e5e7eb;
    outline: none;
    transition: border-color 0.2s;
}
.auth-input:focus {
    border-bottom-color: #ff5722;
}
.auth-input::placeholder {
    color: #9ca3af;
}

/* Name row (first + last side by side) */
.auth-name-row {
    display: flex;
    gap: 16px;
}
.auth-name-row .auth-field {
    flex: 1;
}

/* Reddit validation status */
.auth-reddit-status {
    font-size: 13px;
    margin-top: 4px;
    min-height: 18px;
    line-height: 18px;
}
.auth-reddit-status.checking { color: #9ca3af; }
.auth-reddit-status.valid { color: #059669; }
.auth-reddit-status.invalid { color: #dc2626; }
.auth-input.reddit-valid { border-bottom-color: #059669; }
.auth-input.reddit-invalid { border-bottom-color: #dc2626; }

/* Password toggle on auth pages */
.auth-field .rl-eye-toggle {
    position: absolute;
    right: 11px;
    bottom: 8px;
    top: auto;
    transform: none;
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    align-items: center;
}
.auth-field .rl-eye-toggle:hover {
    color: #1a1a1a;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    -webkit-text-fill-color: #1a1a1a;
    transition: background-color 5000s ease-in-out 0s;
    background-color: transparent !important;
}

/* Submit button */
.auth-submit {
    width: 100%;
    padding: 20px 0;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 25px 50px -12px rgba(26,26,26,0.2);
    transition: all 0.2s;
    margin-top: 8px;
}
.auth-submit:hover {
    background: #ff5722;
    box-shadow: 0 25px 50px -12px rgba(255,87,34,0.3);
}
.auth-submit:active {
    transform: scale(0.98);
}
.auth-submit svg {
    transition: transform 0.2s;
}
.auth-submit:hover svg {
    transform: translateX(4px);
}

/* Footer link */
.auth-footer {
    margin-top: 48px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}
.auth-footer a {
    color: #ff5722;
    font-weight: 500;
    text-decoration: none;
}
.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer-links {
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 12px;
    padding-bottom: 12px;
}
body.thankyou .auth-footer-links {
    justify-content: flex-start;
}
.auth-footer-links a {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #4b5563;
    text-decoration: none;
}
.auth-footer-links a:hover {
    color: #ff5722;
}
.auth-footer-dot {
    color: #9ca3af;
    font-size: 14px;
}

/* Alerts on auth pages */
.auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 24px;
}
.auth-alert-error {
    background: #fef2f2;
    color: #dc2626;
}
.auth-alert-success {
    background: #ecfdf5;
    color: #059669;
}
.auth-alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* Right Panel */
.auth-right {
    display: flex;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    padding: 96px;
}
.auth-right-glow {
    position: absolute;
    inset: 0;
    opacity: 0.2;
}
.auth-right-glow-1 {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(242,125,38,0.2), transparent 70%);
}
.auth-right-glow-2 {
    position: absolute;
    bottom: 0; right: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 80% 80%, rgba(242,68,68,0.1), transparent 50%);
}
.auth-right-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Right panel icon */
.auth-right-icon {
    margin-bottom: 48px;
}
.auth-right-icon-box {
    width: 128px;
    height: 128px;
    background: rgba(255,255,255,0.05);
    border-radius: 3rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(64px);
    -webkit-backdrop-filter: blur(64px);
    border: 1px solid rgba(255,255,255,0.1);
    transform: rotate(12deg);
}

/* Right panel heading */
.auth-right-heading {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 72px;
    color: #fff;
    margin-bottom: 32px;
    line-height: 1.1;
}
.auth-right-heading .auth-brand-orange {
    color: #ff5722;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
}

/* Right panel quote */
.auth-right-divider {
    width: 64px;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0 auto 24px;
}
.auth-right-quote {
    max-width: 448px;
    margin: 0 auto;
}
.auth-right-quote p {
    color: rgba(255,255,255,0.4);
    font-weight: 300;
    line-height: 1.6;
    font-style: normal;
    font-size: 14px;
    margin-bottom: 16px;
}
.auth-right-trusted {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 0.3em;
}

/* Decorative dots */
.auth-dot-orange {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 18px;
    height: 18px;
    background: #ff5722;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
.auth-dot-white {
    position: absolute;
    bottom: 25%;
    right: 25%;
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 1023px) {
    .auth-page {
        grid-template-columns: 1fr;
    }
    .auth-right {
        display: none;
    }
    .auth-left {
        padding: 48px 32px;
    }
}
@media (max-width: 640px) {
    .auth-left {
        padding: 32px 24px;
    }
    .auth-heading h2 {
        font-size: 36px;
    }
    .auth-logo {
        margin-bottom: 40px;
    }
}


















/* ============================================================
   ANALYSIS PAGE — timeline header profile row
   Lives in style.css so Stephen's Stephen-section overrides below
   always take precedence.
   ============================================================ */
body.correlate .rl-wrap {
    max-width: 1050px;
}
body.correlate main.rl-cc-main {
   margin-bottom: 150px;
}
body.analysis .an-timeline-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
/* .an-card-title has a 8px bottom margin that throws off flex
   vertical centering — zero it out inside the header */
body.analysis .an-timeline-header .an-card-title {
    margin: 0;
    line-height: 1;
}
body.analysis .an-timeline-header .rl-profile-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
    line-height: 1;
}
body.analysis .an-timeline-header .rl-profile-info > * {
    line-height: 1;
}
body.analysis .an-timeline-header .rl-profile-info .rl-profile-name,
body.analysis .an-timeline-header .rl-profile-info .rl-profile-age {
    flex-shrink: 0;
    white-space: nowrap;
}
body.analysis .an-timeline-header .rl-profile-info .rl-profile-age {
    margin-top: 0;
    max-width: none;
}
body.analysis .an-timeline-header .rl-profile-info .rl-profile-bio {
    margin-top: 0;
    max-width: none;
    color: var(--text-muted);
    font-style: normal;
    flex: 1 1 auto;
    min-width: 0;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 600px) {
    body.analysis .an-timeline-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: var(--space-2);
        flex-wrap: nowrap;
    }
    body.analysis .an-timeline-header .an-card-title { flex-shrink: 0; }
    body.analysis .an-timeline-header .rl-profile-info { flex: 1 1 auto; min-width: 0; }
    body.analysis .an-timeline-header .an-timeline-pills { margin-left: auto; flex-shrink: 0; }
}

/* ============================================================
   CORRELATE PAGE — Hero (mirrors watch.php hero visuals)
   ============================================================ */
body.correlate .conn-hero-line1 {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 3.5rem;
    color: #333;
    margin: 0;
    line-height: 1.1;
}
body.correlate .conn-hero-line2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 4rem;
    color: var(--accent);
    opacity: 1;
    margin: 0 0 16px;
    line-height: 1.1;
}
body.correlate .conn-subtitle {
    font-size: 1.25rem;
    color: #999;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 48px;
}
@media (max-width: 768px) {
    body.correlate .conn-hero-line1 { font-size: 2.5rem; }
    body.correlate .conn-hero-line2 { font-size: 3rem; }
}

/* ============================================================
   CORRELATE PAGE — "View top items" CTA strip inside each card
   ============================================================ */
body.correlate .rl-cc-card-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 188px;
    margin: 18px auto 0;
    padding: 11px 22px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
    transition:
        background 0.15s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1),
        max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        border-width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}
/* Smoothly collapse the strip when the card opens */
body.correlate .rl-cc-card-wrap.is-open .rl-cc-card-strip {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    pointer-events: none;
}
body.correlate .rl-cc-card:hover .rl-cc-card-strip,
body.correlate .rl-cc-card-strip:hover {
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 69, 0, 0.18), 0 2px 6px rgba(255, 69, 0, 0.10);
    border-color: rgba(255, 69, 0, 0.18);
}
body.correlate .rl-cc-card-strip-label {
    line-height: 1;
}
body.correlate .rl-cc-card-strip-chevron {
    font-size: 15px;
    line-height: 1;
    display: inline-block;
}
body.correlate .rl-cc-card:hover .rl-cc-card-strip .rl-cc-card-strip-chevron,
body.correlate .rl-cc-card-strip:hover .rl-cc-card-strip-chevron {
    transform: translateY(2px);
}

/* Pulse behaviors — driven by CORRELATE_STRIP_PULSE config */
@keyframes rl-cc-strip-pulse {
    0%, 100% { transform: translateY(0);   opacity: 0.75; }
    50%      { transform: translateY(3px); opacity: 1;    }
}
body.correlate .rl-cc-card-strip.pulse-until-click .rl-cc-card-strip-chevron,
body.correlate .rl-cc-card-strip.pulse-forever .rl-cc-card-strip-chevron {
    animation: rl-cc-strip-pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
body.correlate .rl-cc-card-strip.pulse-initial .rl-cc-card-strip-chevron {
    animation: rl-cc-strip-pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation-iteration-count: 2;
}
/* On hover, let the nudge transform win instead of the pulse */
body.correlate .rl-cc-card:hover .rl-cc-card-strip .rl-cc-card-strip-chevron,
body.correlate .rl-cc-card-strip:hover .rl-cc-card-strip-chevron {
    animation: none;
}

/* ============================================================
   CORRELATE PAGE — smooth dropdown expand/collapse
   Uses CSS grid-template-rows 0fr ⟷ 1fr trick so the dropdown
   eases open/closed smoothly from 0 to its real content height,
   no jerking, no layout shift on neighbours.
   ============================================================ */
/* Base .rl-cc-card-wrap has gap: 12px; collapse it to 0 so the
   dropdown-host's own margin-top controls the vertical gap (and
   can transition in sync with the expand). */
body.correlate .rl-cc-card-wrap {
    gap: 0;
}
body.correlate .rl-cc-dropdown-host {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0;
    transition:
        grid-template-rows 0.75s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}
body.correlate .rl-cc-card-wrap.is-open .rl-cc-dropdown-host {
    grid-template-rows: 1fr;
    margin-top: 12px;
}
body.correlate .rl-cc-dropdown-host > .rl-cc-dropdown {
    min-height: 0;
    max-height: none;
    overflow: hidden;
    /* Fade the contents as the container opens/closes */
    opacity: 0;
    transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    animation: none;          /* kill the old rl-cc-dropdown-in keyframes */
}
body.correlate .rl-cc-card-wrap.is-open .rl-cc-dropdown-host > .rl-cc-dropdown {
    opacity: 1;
    overflow-y: auto;         /* re-enable scroll once fully open */
    max-height: 360px;
}

/* ============================================================
   CORRELATE PAGE — share pie chart (replaces the progress line)
   ============================================================ */
body.correlate .rl-cc-meta-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.correlate .rl-cc-pie {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), #ff44015c 0);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   CORRELATE PAGE — loading state
   1. Results section fades to 30% while a correlation is in flight
      (pointer-events off so stale cards can't be clicked).
   2. Metadata bar is replaced by 4 dimmed skeleton cards that
      gently pulse until the real payload arrives.
   3. Search form hides its input + button and shows a spinner +
      message telling the user whether we're pulling from ThoughtLab
      or doing a fresh Reddit import.
   ============================================================ */
body.correlate #cc-results {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.correlate #cc-results.is-fading {
    opacity: 0.3;
    pointer-events: none;
}

@keyframes rl-cc-skel-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.9;  }
}
body.correlate .rl-cc-meta-card.rl-cc-skeleton {
    background: #fff;
    border-color: #e5e7eb;
    position: relative;
    overflow: hidden;
    animation: rl-cc-skel-pulse 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
body.correlate .rl-cc-meta-card.rl-cc-skeleton .rl-cc-meta-icon {
    background: #f3f4f6;
    color: transparent;
}
body.correlate .rl-cc-meta-card.rl-cc-skeleton .rl-cc-meta-label {
    display: inline-block;
    width: 60%;
    height: 9px;
    background: #f3f4f6;
    border-radius: 3px;
    color: transparent;
}
body.correlate .rl-cc-meta-card.rl-cc-skeleton .rl-cc-meta-value {
    display: inline-block;
    width: 80%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-top: 4px;
    color: transparent;
}

/* Form overlay — hide the input + button, show a centered message */
body.correlate #cc-form.is-loading .rl-cc-search-icon,
body.correlate #cc-form.is-loading #cc-query,
body.correlate #cc-form.is-loading .rl-cc-correlate-btn {
    visibility: hidden;
}
body.correlate #cc-form.is-loading {
    position: relative;
    cursor: default;
}
body.correlate .rl-cc-form-msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    animation: rl-cc-msg-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
@keyframes rl-cc-msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0);   }
}
body.correlate .rl-cc-form-msg-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid var(--accent-light);
    border-top-color: var(--accent);
    animation: rl-cc-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes rl-cc-spin {
    to { transform: rotate(360deg); }
}
body.correlate .rl-cc-form-msg-brand {
    font-weight: 800;
    letter-spacing: -0.01em;
}
body.correlate .rl-cc-form-msg-brand-1 { color: #1a1a1a; }
body.correlate .rl-cc-form-msg-brand-2 { color: var(--accent); padding-left: 1px; }

/* ── Correlate hero 2-column layout + pie chart ── */
.rl-cc-hero-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: start;
}
.rl-cc-hero-left {
    min-width: 0;
}
.rl-cc-hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
}
.rl-cc-hero-pie {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    position: relative;
    background: #f0f0f0;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.rl-cc-hero-pie.is-loaded {
    opacity: 1;
    transform: scale(1);
}
.rl-cc-hero-pie::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58%;
    height: 58%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}
.rl-cc-hero-pie-segment {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
}
.rl-cc-hero-pie-segment:hover ~ .rl-cc-hero-pie-overlay {
    opacity: 0.7;
}
.rl-cc-hero-pie-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 3;
}
.rl-cc-hero-pie-label-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #999;
}
.rl-cc-hero-pie-label-value {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin-top: 2px;
    white-space: nowrap;
    min-height: 16px;
}
.rl-cc-hero-pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
    max-width: 220px;
}
.rl-cc-hero-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}
.rl-cc-hero-pie-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .rl-cc-hero-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .rl-cc-hero-right {
        flex-direction: row;
        gap: 16px;
    }
    .rl-cc-hero-pie {
        width: 120px;
        height: 120px;
    }
}

/* ── Correlate AI status indicator ── */
.rl-cc-ai-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: default;
}
.rl-cc-ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    transition: background 0.3s ease;
}
.rl-cc-ai-dot.is-up { background: #22c55e; }
.rl-cc-ai-dot.is-overloaded { background: #f59e0b; }
.rl-cc-ai-dot.is-down { background: #ef4444; }
.rl-cc-ai-dot.is-no-key { background: #9ca3af; }
.rl-cc-ai-label {
    color: #9ca3af;
    transition: color 0.3s ease;
}
.rl-cc-ai-dot.is-up ~ .rl-cc-ai-label { color: #22c55e; }
.rl-cc-ai-dot.is-overloaded ~ .rl-cc-ai-label { color: #f59e0b; }
.rl-cc-ai-dot.is-down ~ .rl-cc-ai-label { color: #ef4444; }

/* ── Correlate metadata windowed count ── */
.rl-cc-meta-window {
    font-size: 0.75em;
    color: var(--accent, #ff5722);
    margin-left: 6px;
    font-weight: 600;
    opacity: 0.85;
}

/* ── Expression panel (inside Correlate cards) ── */
button#cc-expression {
    background: oklch(0.96 0 0);
    color: #1A1A1A;
}
.is-active-expression button#cc-expression {
    background: var(--accent, #ff5722);
    color: #fff;
}
.is-active-expression button#cc-expression svg {
    stroke: #fff;
}
.is-active-expression .rl-cc-correlate-btn:not(.rl-cc-expression-btn) {
    background: oklch(0.96 0 0);
    color: #1A1A1A;
}
.rl-cc-expression-btn {
    border: 1px solid #e0e0e0;
    margin-right: 6px;
}
.rl-cc-expression-btn:hover {
    background: #eaeaea;
}
.rl-cc-expression-btn:disabled {
    cursor: not-allowed;
}
.rl-cc-token-cost {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 10px;
    line-height: 1.2;
}
.rl-cc-token-cost-amount {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent, #ff5722);
}
.rl-cc-token-cost-detail {
    font-size: 10px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
}
.rl-cc-expression-btn svg {
    stroke: #ff5722;
}

.rl-cc-expression-panel {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--border, #e5e5e5);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rl-cc-expression-theme {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary, #4b5563);
}

.rl-cc-expression-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rl-cc-expression-chip {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--accent, #ff5722);
    background: rgba(255, 87, 34, 0.08);
    border: 1px solid rgba(255, 87, 34, 0.18);
    border-radius: 999px;
    white-space: nowrap;
}

.rl-cc-expression-discussed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border, #e5e5e5);
    font-size: 12px;
}

.rl-cc-expression-discussed-label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary, #9ca3af);
    flex-shrink: 0;
    font-size: 10px;
}

.rl-cc-expression-discussed-link {
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.rl-cc-expression-discussed-link:hover {
    color: var(--accent, #ff5722);
    text-decoration: underline;
}

.rl-cc-expression-discussed-score {
    color: var(--text-tertiary, #9ca3af);
    flex-shrink: 0;
    font-weight: 600;
}

.rl-cc-expression-empty {
    font-size: 12px;
    color: var(--text-tertiary, #9ca3af);
    font-style: italic;
}

/* ── Sortable table headers (admin users table) ── */
.rl-table th.rl-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}
.rl-table th.rl-sortable:hover {
    color: var(--accent);
}
.rl-table th.rl-sortable::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    opacity: 0.35;
    transform: translateY(-50%);
}
.rl-table th.rl-sortable.rl-sort-asc::after {
    border-top: none;
    border-bottom: 5px solid var(--accent);
    opacity: 1;
}
.rl-table th.rl-sortable.rl-sort-desc::after {
    border-top: 5px solid var(--accent);
    border-bottom: none;
    opacity: 1;
}

/* ============================================================
   Chat (admin-only Reddit DM library at /chat/)
   ============================================================ */
body.chat .rl-chat-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
body.chat .rl-chat-stat {
    flex: 1 1 160px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
body.chat .rl-chat-stat-label {
    font-size: calc(11px * var(--font-scale));
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
body.chat .rl-chat-stat-value {
    display: block;
    font-size: calc(22px * var(--font-scale));
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    margin-top: 4px;
}
body.chat .rl-chat-stat-sub {
    display: block;
    margin-top: 2px;
    font-size: calc(11px * var(--font-scale));
    color: var(--text-muted);
}

body.chat .rl-chat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}
@media (max-width: 900px) {
    body.chat .rl-chat-grid { grid-template-columns: 1fr; }
}

body.chat .rl-chat-section-h {
    font-size: calc(16px * var(--font-scale));
    font-weight: 700;
    margin: 0 0 var(--space-3);
    color: var(--text);
}

body.chat .rl-chat-msg {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-2) 0;
    background: var(--surface);
}
body.chat .rl-chat-msg.is-mine {
    background: var(--info-bg, #eaf3ff);
    border-color: var(--info, #b9d6f5);
}
body.chat .rl-chat-msg.is-theirs {
    background: var(--surface-alt, #f6f6f6);
}
body.chat .rl-chat-meta {
    font-size: calc(12px * var(--font-scale));
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
body.chat .rl-chat-meta b { color: var(--text); }
body.chat .rl-chat-body {
    white-space: pre-wrap;
    margin: 0;
    font-family: var(--font);
    font-size: calc(14px * var(--font-scale));
    color: var(--text);
    line-height: 1.5;
}

body.chat .rl-chat-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    margin: var(--space-3) 0;
}
body.chat .rl-chat-toolbar .rl-input,
body.chat .rl-chat-toolbar select {
    width: auto;
    min-width: 180px;
}

body.chat .rl-chat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-3);
}
body.chat .rl-chat-table th,
body.chat .rl-chat-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: calc(13px * var(--font-scale));
}
body.chat .rl-chat-table th {
    background: var(--surface-alt, #fafafa);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: calc(11px * var(--font-scale));
}
body.chat .rl-chat-table tr:hover td {
    background: var(--surface-alt, #fafafa);
}
body.chat .rl-chat-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
body.chat .rl-chat-table a:hover { text-decoration: underline; }

body.chat .rl-chat-chip {
    display: inline-block;
    background: var(--surface-alt, #f2f2f2);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: calc(11px * var(--font-scale));
    color: var(--text-muted);
}
body.chat .rl-chat-chip.is-system {
    background: var(--error-bg, #fde8e8);
    color: var(--error, #a00);
}
body.chat .rl-chat-sys { color: var(--error, #a00); font-weight: 600; }
body.chat .rl-chat-muted { color: var(--text-muted); }
body.chat .rl-chat-small { font-size: calc(12px * var(--font-scale)); }

body.chat .rl-chat-copy {
    font-size: calc(11px * var(--font-scale));
    padding: 3px 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
}
body.chat .rl-chat-copy:hover {
    color: var(--accent);
    border-color: var(--accent);
}

body.chat textarea.rl-chat-textarea {
    width: 100%;
    max-width: 800px;
    min-height: 110px;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: calc(14px * var(--font-scale));
}

/* ============================================================
   Stephen Section —
   ============================================================ */
body.verification .auth-logo-icon {
    display: inline-flex;
}
body.verification .auth-logo {
    margin-left: auto;
    margin-right: auto;
    display: block;
}
body.index .auth-footer,
body.login .auth-footer {
    text-align: left;
    padding-left: 10px;
    padding-bottom: 10px;
}
body.correlate .rl-cc-mode-btn[data-mode="user"] {
    padding: 9px 27px;
}
body.correlate .rl-cc-controls input[type="date"] {
    font-size: 14.5px;
    color: var(--text-muted);
    font-family: var(--font);
}
body.correlate .rl-cc-controls input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
    -webkit-appearance: none;
}
body.analysis .rl-profile-info {
    max-width: 707px;
}
body.watch .conn-primary-row .conn-account-actions button {
    margin-right: 12px;
    margin-left: -6px;
    margin-top: -3px;
}
body.watch .conn-primary-row .conn-account-actions {
    margin-right: 10px;
}
td.rl-cell-date.rl-text-smaller {
    font-size: calc(10px * var(--font-scale));
}
body.lists-manager .rl-wrap {
    max-width: 1080px;
}
div#update-notice {
    text-align: center;
    font-weight: 600;
    color: #f12020;
}
.rl-disclaimer {
    position: fixed;
    bottom: 0;
    left: 0;
    text-align: center;
    padding: 1rem 10%;
    font-size: .75rem;
    color: #888;
    max-width: 100%;
    width: 100%;
    background: #F5F2ED;
    background-image: radial-gradient(ellipse at 20% 20%, rgba(90,90,64,0.08) 0%, transparent 60%),    radial-gradient(ellipse at 80% 80%, rgba(168,168,120,0.06) 0%, transparent 60%);
}
div#items-container {
    margin-bottom: 100px;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
div#items-container .rl-card {
    margin-bottom: 0;
    min-width: 0;
    overflow: hidden;
}
div#items-container[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
div#items-container[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
div#items-container[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
div#items-container[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
div#items-container[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Compact cards when multi-column */
div#items-container[data-cols]:not([data-cols="1"]) .rl-card {
    padding: var(--space-3);
}
div#items-container[data-cols]:not([data-cols="1"]) .rl-card-num {
    display: none;
}
div#items-container[data-cols]:not([data-cols="1"]) .rl-card-header {
    gap: var(--space-2);
}
div#items-container[data-cols]:not([data-cols="1"]) .rl-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(14px * var(--font-scale) * 1.4 * 2);
}
div#items-container[data-cols]:not([data-cols="1"]) .rl-card-meta {
    margin-left: 0;
}
div#items-container[data-cols]:not([data-cols="1"]) .rl-body-text {
    margin-left: 0;
}
div#items-container[data-cols="4"] .rl-inline-edit-label,
div#items-container[data-cols="5"] .rl-inline-edit-label,
div#items-container[data-cols="6"] .rl-inline-edit-label {
    display: none;
}
div#items-container[data-cols="4"] .rl-editable,
div#items-container[data-cols="5"] .rl-editable,
div#items-container[data-cols="6"] .rl-editable {
    max-width: 80px;
}
div#items-container[data-cols="3"] .rl-body-text,
div#items-container[data-cols="4"] .rl-body-text,
div#items-container[data-cols="5"] .rl-body-text,
div#items-container[data-cols="6"] .rl-body-text {
    white-space: normal !important;
    overflow: hidden !important;
    line-height: 1.5 !important;
    max-height: 3em !important;
    padding: 0 !important;
    margin-top: var(--space-3);
    background: none !important;
}
h2.center {
    text-align: center;
}
div#checkout-container iframe {
    border-radius: 30px;
    box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}
body.thoughtlab .rl-pill {
    padding: 3px 9px;
}
h2.why-section-heading {
    max-width: 333px;
}
span.brand_color {
    color: var(--accent);
}
div#cfg-tab-plumbing {
    margin-bottom: 150px;
}
body.network .rl-wrap,
body.admin .rl-wrap,
body.config-manager .rl-wrap,
body.survey-manager .rl-wrap,
body.faq-manager .rl-wrap {
   margin-bottom: 150px !important;
}
body.survey-manager .rl-wrap,
body.faq-manager .rl-wrap {
    max-width: 1080px;
}

/* --- Utility Classes --- */

/* Text */
.rl-text-accent { color: var(--accent); }
.rl-text-success { color: var(--success); }
.rl-text-error { color: var(--error); }
.rl-text-warning { color: #b45309; }
.rl-text-viewer { color: #2979ff; }
.rl-text-accent-bold { color: var(--accent); font-weight: 600; }
.rl-meta-text { color: var(--text-muted); font-size: calc(11px * var(--font-scale)); }
.rl-font-medium { font-weight: 500; }

/* Visibility & Layout */
.rl-hidden { display: none; }
.rl-flex-1 { flex: 1; }
.rl-flex-center-gap { display: flex; align-items: center; gap: var(--space-2); }
.rl-tab-nav { display: flex; gap: var(--space-1); margin-left: var(--space-3); }
.rl-pill-link { text-decoration: none; }
.rl-vertical-sep { width: 1px; height: 24px; background: var(--border); margin: 0 var(--space-1); }
.rl-actions-col { text-align: right; white-space: nowrap; }
.rl-actions-right { display: flex; justify-content: flex-end; margin-top: var(--space-2); }
.rl-icon-inline { vertical-align: middle; }
.rl-button-group { display: flex; gap: var(--space-2); }
.rl-form-inline { display: inline; }

/* Cards & Containers */
.rl-login-card { max-width: 400px; margin: var(--space-6) auto; }
.rl-card-heading { font-weight: 700; margin-bottom: var(--space-4); font-size: calc(16px * var(--font-scale)); }
.rl-card-table { padding: 0; overflow-x: auto; }
.rl-card-padded { padding: var(--space-4); }
.rl-empty-state { color: var(--text-muted); text-align: center; }
.rl-alert-centered { max-width: 420px; width: 100%; text-align: center; }
.rl-edit-panel-bg { padding: var(--space-3) var(--space-4); background: var(--bg); }

/* Forms */
.rl-password-wrapper { margin-bottom: var(--space-3); position: relative; }
.rl-input-with-icon { width: 100%; box-sizing: border-box; padding-right: 44px; }
.rl-filter-label { font-weight: 600; font-size: calc(13px * var(--font-scale)); }
.rl-tier-select { font-size: calc(12px * var(--font-scale)); padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }

/* Stat Grid Variants */
.rl-stat-row-3col { grid-template-columns: repeat(3, 1fr); margin-bottom: var(--space-4); }
.rl-stat-row-6col { grid-template-columns: repeat(6, 1fr); margin-bottom: var(--space-4); }

/* Buttons */
.rl-btn-success { color: var(--success); border-color: var(--success); }
.rl-btn-error { color: var(--error); border-color: var(--error); }
.rl-btn-viewer { color: #2979ff; border-color: #2979ff; }

/* Tags */
.rl-tag-verified { background: var(--success-bg); color: var(--success); }

@media (max-width: 700px) {
    .rl-stat-row-6col { grid-template-columns: repeat(2, 1fr); }
    .rl-stat-row-3col { grid-template-columns: repeat(1, 1fr); }
}

/* ============================================================
   NAV DROPDOWN  (.rl-nav-dropdown — used by topbar More menu)
   ============================================================ */
.rl-nav-dropdown {
    position: relative;
    display: inline-block;
}
.rl-nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rl-nav-dropdown-chev {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 1px;
}
.rl-nav-dropdown.is-open .rl-nav-dropdown-chev {
    transform: rotate(180deg);
}
.rl-nav-dropdown.is-open .rl-nav-dropdown-trigger {
    background: var(--accent-light);
    color: var(--accent);
}

.rl-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 168px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 6px;
    box-shadow:
        0 16px 32px -8px rgba(0, 0, 0, 0.12),
        0 8px 16px -8px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition:
        opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.18s;
    z-index: 1000;
}
.rl-nav-dropdown.is-open .rl-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s;
}
/* Arrow notch on top-right of menu */
.rl-nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 22px;
    width: 11px;
    height: 11px;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    transform: rotate(45deg);
    border-top-left-radius: 2px;
}

.rl-nav-dropdown-item {
    display: block;
    padding: 10px 14px 10px 18px;
    border-radius: 9px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    position: relative;
    transition:
        background 0.12s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.12s cubic-bezier(0.4, 0, 0.2, 1),
        padding-left 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-nav-dropdown-item:hover {
    background: var(--accent-light);
    color: var(--accent);
    text-decoration: none;
    padding-left: 22px;
}
.rl-nav-dropdown-item.is-active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}
.rl-nav-dropdown-item.is-active::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}
@media (max-width: 640px) {
    .rl-nav-dropdown-menu { right: -8px; min-width: 160px; }
}

/* ============================================================
   CORRELATE PAGE  (.rl-cc-*  — namespaced to /correlate)
   Visual primitives mirror the React reference: 0.8px borders,
   16px card radius, pill-shaped buttons, soft layered shadows,
   2px orange selected border, lined-paper dropdown.
   ============================================================ */
.rl-cc-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-5) var(--space-3) var(--space-6);
}

/* Hero now uses .conn-hero-line1 / .conn-hero-line2 / .conn-subtitle
   scoped under body.correlate — see block further down in style.css. */

/* ── Toolbar (mode pill + control row) ── */
.rl-cc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.rl-cc-mode-pill {
    display: inline-flex;
    background: #f5f5f4;
    border-radius: 9999px;
    padding: 4px;
    gap: 2px;
}
.rl-cc-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    padding: 9px 18px;
    border-radius: 9999px;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-mode-btn:hover { color: #6b7280; }
.rl-cc-mode-btn.is-active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.rl-cc-controls {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 9999px;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: 15px;
    flex-wrap: wrap;
    line-height: 1;
}
.rl-cc-controls > * {
    line-height: 1;
    vertical-align: middle;
}
.rl-cc-controls-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}
.rl-cc-controls-label svg {
    flex-shrink: 0;
    margin-top: -2px;
}
.rl-cc-controls input[type="date"] {
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text-muted);
    padding: 0;
    cursor: pointer;
    outline: none;
    line-height: 1;
    height: auto;
}
.rl-cc-arrow {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1;
}
.rl-cc-divider {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #e5e7eb;
    align-self: center;
}
.rl-cc-slider-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.rl-cc-slider-wrap svg { color: var(--accent); }
.rl-cc-slider-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
}
.rl-cc-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    accent-color: var(--accent);
    background: transparent;
    width: 70px;
    height: 4px;
    cursor: pointer;
}
.rl-cc-controls input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
}
.rl-cc-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-top: -5px;
    cursor: pointer;
}
.rl-cc-controls input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}
.rl-cc-sort {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1;
}
.rl-cc-sort label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.rl-cc-sort input[type="radio"] { accent-color: var(--accent); }

/* ── Search bar ── */
.rl-cc-search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 9999px;
    padding: 6px 6px 6px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--space-5);
    transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-search:focus-within { border-color: var(--accent); }
.rl-cc-search-icon {
    display: inline-flex;
    color: var(--text-light);
    margin-right: 12px;
}
.rl-cc-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: 27px;
    padding: 12px 0;
    color: var(--accent);
}
.rl-cc-search input::placeholder { color: var(--text-light); }
.rl-cc-correlate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-correlate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}
.rl-cc-correlate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Metadata bar ── */
.rl-cc-metadata {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.rl-cc-metadata[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.rl-cc-meta-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 16px;
    padding: 18px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-meta-card:hover { transform: translateY(-1px); }
.rl-cc-meta-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--accent-light);
    display: grid;
    place-items: center;
    color: var(--accent);
    flex-shrink: 0;
}
.rl-cc-meta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rl-cc-meta-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 600;
}
.rl-cc-meta-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.rl-cc-meta-value small { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* ── Results header ── */
.rl-cc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding: 0 4px;
}
.rl-cc-results-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.rl-cc-results-title strong {
    color: #1a1a1a;
    font-weight: 700;
}
.rl-cc-results-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Results 2-up bento grid ── */
.rl-cc-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}
@media (max-width: 900px) {
    .rl-cc-results { grid-template-columns: 1fr; }
}

/* Card wrapper holds card + dropdown so they layout together */
.rl-cc-card-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.rl-cc-card {
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 16px;
    padding: 28px 28px 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    transition:
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
/* Open state lives on .rl-cc-card-wrap now so the dropdown host and
   card can both react. Box-shadow ring (0 0 0 1.2px) fakes the
   thicker border without changing border-width, which would cause a
   1.2px layout shift mid-transition. */
body.correlate .rl-cc-card-wrap.is-open .rl-cc-card {
    border-color: var(--accent);
    box-shadow:
        0 0 0 1.2px var(--accent),
        0 30px 60px -15px rgba(255, 69, 0, 0.18),
        0 20px 40px rgba(0, 0, 0, 0.08);
}

.rl-cc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.rl-cc-card-headline { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rl-cc-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.rl-cc-card-titles { min-width: 0; }
.rl-cc-card-rank {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 2px;
}
.rl-cc-card-title {
    font-family: var(--font);
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}
.rl-cc-card-subtitle {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 4px;
}

.rl-cc-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-top: -2px;
}
.rl-cc-badge {
    display: inline-flex;
    align-items: center;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 9999px;
}
.rl-cc-progress {
    width: 96px;
    height: 3px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}
.rl-cc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b35);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-card-arrow {
    color: var(--text-light);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    line-height: 1;
}
.rl-cc-card-wrap.is-open .rl-cc-card-arrow {
    color: var(--accent);
    transform: rotate(90deg);
}

/* Stats row */
.rl-cc-stats {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: var(--space-4);
    align-items: end;
    justify-content: space-between;
}
.rl-cc-stat { display: flex; flex-direction: column; gap: 4px; }
.rl-cc-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.rl-cc-stat-label svg { width: 11px; height: 11px; }
.rl-cc-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.rl-cc-stat-total {
    background: var(--accent-light);
    border-radius: 8px;
    padding: 8px 14px;
}
.rl-cc-stat-total .rl-cc-stat-label { color: var(--accent); }
.rl-cc-stat-total .rl-cc-stat-value { color: var(--accent); }

/* ── Lined-paper dropdown ── */
.rl-cc-dropdown {
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 12px;
    padding: 6px 18px;
    max-height: 360px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    animation: rl-cc-dropdown-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 75%;
    margin: 0 auto;
}
.rl-cc-dropdown::-webkit-scrollbar { width: 4px; }
.rl-cc-dropdown::-webkit-scrollbar-track { background: transparent; }
.rl-cc-dropdown::-webkit-scrollbar-thumb {
    background: #d6d3d1;
    border-radius: 2px;
}
.rl-cc-dropdown::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.rl-cc-line {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 11px 4px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 12px;
    transition: background 0.15s ease;
}
.rl-cc-line:last-child { border-bottom: none; }
.rl-cc-line:hover { background: #fafaf9; }

.rl-cc-line-tag {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 60px;
    text-align: center;
}
.rl-cc-line-tag.is-post {
    background: #dbeafe;
    color: #3b82f6;
}
.rl-cc-line-tag.is-comment {
    background: #dcfce7;
    color: #22c55e;
}
.rl-cc-line-title {
    flex: 1;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.rl-cc-line-date {
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    font-size: 10px;
    flex-shrink: 0;
}
.rl-cc-line-link {
    display: inline-flex;
    color: var(--text-light);
    transition: color 0.15s ease;
    flex-shrink: 0;
    text-decoration: none;
}
.rl-cc-line-link:hover { color: var(--accent); }
.rl-cc-line-empty {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-size: 12px;
}

@keyframes rl-cc-dropdown-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state + Load more ── */
.rl-cc-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 32px;
    color: var(--text-light);
    background: #fff;
    border: 0.8px solid #d6d3d1;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.rl-cc-empty-icon {
    color: var(--accent);
    opacity: 0.5;
    margin-bottom: var(--space-3);
    display: inline-flex;
}
.rl-cc-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.rl-cc-empty p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

.rl-cc-load-more {
    display: block;
    margin: var(--space-5) auto 0;
    background: #fff;
    border: 0.8px solid #e5e7eb;
    border-radius: 9999px;
    padding: 14px 36px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.rl-cc-load-more:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.15);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .rl-cc-metadata { grid-template-columns: repeat(2, 1fr); }
    .rl-cc-toolbar { flex-direction: column; align-items: stretch; }
    .rl-cc-controls { justify-content: center; }
}
@media (max-width: 600px) {
    .rl-cc-stats { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
    .rl-cc-metadata { grid-template-columns: 1fr; }
    .rl-cc-correlate-btn { padding: 12px 18px; font-size: 12px; }
    .rl-cc-card-title { max-width: 140px; }
}
