/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f5f6f8;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #e0e0e0;
    --sidebar-active: #16213e;
    --card-bg: #fff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --green: #22c55e;
    --green-bg: #dcfce7;
    --red: #ef4444;
    --red-bg: #fee2e2;
    --blue: #3b82f6;
    --blue-bg: #dbeafe;
    --orange: #f59e0b;
    --orange-bg: #fef3c7;
    --brand-hl: #fbbf24;
    --competitor-hl: #f87171;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.sidebar-current-brand {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 5px 10px;
    display: inline-block;
    cursor: pointer;
}
.sidebar-current-brand:hover { background: rgba(255,255,255,0.18); }

.sidebar-admin-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    letter-spacing: 0.2px;
}
.sidebar-admin-link:hover { color: #fff; text-decoration: none; }

.sidebar .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: block;
}
.sidebar .subtitle:hover { color: rgba(255,255,255,0.8); }

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin-top: 16px;
}

.nav-links li a {
    display: block;
    padding: 10px 20px;
    color: var(--sidebar-text);
    font-size: 14px;
    transition: background 0.2s;
}

.nav-links li a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-links li.active a { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.nav-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 0; }
.nav-sub a { font-size: 13px; color: var(--sidebar-text) !important; opacity: 0.7; padding-left: 24px !important; }
.nav-sub a:hover { opacity: 1; }
.nav-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.badge-zadoosh {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 10px;
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 8px;
}
.nav-import { padding-top: 4px; }
.nav-import a { color: var(--blue) !important; }

/* Sidebar user */
.sidebar-user {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.user-avatar { width: 24px; height: 24px; border-radius: 50%; }
.user-name { font-size: 12px; color: var(--sidebar-text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { font-size: 11px; color: var(--text-muted); }

/* Login page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 32px;
    text-align: center;
}
.login-card h1 { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
.login-footer { font-size: 12px; color: var(--text-muted); margin-top: 24px; }

.btn-google, .btn-microsoft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-google:hover, .btn-microsoft:hover { background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.btn-google:disabled, .btn-microsoft:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-microsoft { margin-top: 10px; }

/* Main Content */
.content {
    margin-left: 220px;
    padding: 32px 40px;
    flex: 1;
    max-width: 100%;
    overflow-x: auto;
}

/* Flash Messages */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}
.flash-success { background: var(--green-bg); color: #166534; }
.flash-error { background: var(--red-bg); color: #991b1b; }

/* Page Header */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; }
.page-meta { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--text-muted); }

/* Import Form */
.import-form-container { max-width: 480px; }
.import-form { background: var(--card-bg); padding: 28px; border-radius: 8px; border: 1px solid var(--border); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group .hint { font-weight: 400; color: var(--text-muted); }
/* File list (import page) */
.file-list {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
}
.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}
.btn-clear { background: none; border: none; color: var(--red); font-size: 12px; cursor: pointer; }
.btn-clear:hover { text-decoration: underline; }
.file-list ul { list-style: none; max-height: 300px; overflow-y: auto; }
.file-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.file-item:last-child { border-bottom: none; }
.file-name { flex: 1; }
.file-size { color: var(--text-muted); font-size: 12px; }

/* File summary (confirm page) */
.file-summary {
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.file-summary-item {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.file-summary-item:last-child { border-bottom: none; }

.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--card-bg);
}

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

/* Brand select list (confirmation page) */
.brand-select-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.brand-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.brand-option:last-child { border-bottom: none; }
.brand-option:hover { background: var(--bg); }
.brand-option input[type="radio"] { margin: 0; }
.brand-option-name { font-weight: 500; flex: 1; }
.brand-option-count { font-size: 12px; color: var(--text-muted); }

/* Brand locked (existing brand on re-import) */
.brand-locked {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.brand-locked-name { font-size: 16px; font-weight: 600; }

/* Competitor select list */
.competitor-select-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.competitor-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}
.competitor-option:last-child { border-bottom: none; }
.competitor-option:hover { background: var(--bg); }
.competitor-option input[type="checkbox"] { margin: 0; }
.competitor-option-name { font-weight: 500; flex: 1; }
.competitor-option-count { font-size: 12px; color: var(--text-muted); }

.competitor-new { background: var(--blue-bg); }
.competitor-new:hover { background: #c7d9f5; }

.badge-new {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-sm { padding: 4px 12px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 8px; }
.btn-sm:hover { background: var(--border); }

/* Citation Seeds */
.seed-add-form { margin-bottom: 20px; }
.seed-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.seed-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.seed-type-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
}

.seeds-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}
.seeds-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}
.seeds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.seeds-table th, .seeds-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.seeds-table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
.seeds-table tbody tr:hover { background: #f9fafb; }
.seeds-table tbody tr:last-child td { border-bottom: none; }

.seed-domain { font-weight: 600; white-space: nowrap; }
.seed-title { max-width: 300px; }
.seed-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.seed-num { font-weight: 700; text-align: center; }
.seed-num-active { color: #166534; }
.seed-engines, .seed-geos { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* AEO Impact on dashboard */
.aeo-impact { margin-top: 24px; }
.aeo-impact h3 { font-size: 16px; margin-bottom: 4px; }
.aeo-impact-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.impact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.impact-table th, .impact-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.impact-table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
.impact-table tbody tr:hover { background: #f9fafb; }
.impact-table tbody tr:last-child td { border-bottom: none; }

.seed-type-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.seed-type-authority_piece { background: #dbeafe; color: #1e40af; }
.seed-type-authority_piece_ugc { background: #cffafe; color: #155e75; }
.seed-type-listicle_insertion { background: #fae8ff; color: #86198f; }
.seed-type-brand_mention { background: #fef3c7; color: #92400e; }
.seed-type-reddit_seed { background: #fee2e2; color: #991b1b; }
.seed-type-forum_seed { background: #e0e7ff; color: #3730a3; }
.seed-type-youtube_video { background: #fee2e2; color: #b91c1c; }
.seed-type-pr_news { background: #d1fae5; color: #065f46; }
.seed-type-on_page_optimization { background: #ecfeff; color: #0e7490; }
.seed-type-new_owned_content { background: #f0fdf4; color: #166534; }

.btn-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.btn-delete:hover { color: var(--red); }

.btn-shared-toggle {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    color: var(--text-muted);
}
.btn-shared-toggle.shared-on {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* A seed whose publisher has deleted the live page: greyed + struck through,
   with a Removed badge. Used on the Citation Seeds, Seed Performance and
   Earned Citations pages (seeds-table and citations-overview-table). */
tr.seed-removed { background: #fafafa; color: var(--text-muted); }
tr.seed-removed:hover { background: #f3f4f6 !important; }
.seed-removed .seed-title a,
.seed-removed .perf-url,
.seed-removed .cite-url-small { text-decoration: line-through; color: var(--text-muted); }
.seed-removed-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #b91c1c;
    background: #fee2e2;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: middle;
}
.seed-inassets-badge {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    padding: 1px 8px;
    border-radius: 10px;
    white-space: nowrap;
    vertical-align: middle;
}
.btn-removed-toggle {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    color: var(--text-muted);
}
.btn-removed-toggle.removed-on {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* Sidebar section label */
.nav-section-label {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}
.nav-section-period {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    opacity: 0.7;
    margin-left: 4px;
}

/* Period filter */
.period-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.period-btn {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s;
}
.period-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}
.period-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
/* Month scope picked from the trend chart — shown as an active pill alongside
   the rolling-period buttons, with an inline clear (×). */
.period-btn-month {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}
.period-btn-month .period-month-x {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
}
.period-btn-month .period-month-x:hover { color: #fff; }

.engine-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.engine-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 2px;
}
.engine-btn {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.15s;
}
.engine-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}
.engine-btn.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}
.engine-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
.engine-check input {
    margin: 0;
    cursor: pointer;
}

/* Admin-only prompt-level filter (collapsed by default) */
.prompt-filter { margin: -4px 0 16px; }
.prompt-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px dashed var(--border);
    cursor: pointer;
}
.prompt-filter-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.prompt-filter-toggle .pf-caret { font-size: 10px; }
.pf-badge {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
}
.pf-admin-tag {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
}
.prompt-filter-panel {
    margin-top: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    max-width: 640px;
}
.pf-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pf-search {
    flex: 1;
    min-width: 0;
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.pf-search:focus { outline: none; border-color: var(--blue); }
.pf-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.pf-link { font-size: 12px; font-weight: 500; white-space: nowrap; }
.pf-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
}
.pf-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}
.pf-item:hover { background: var(--bg); }
.pf-item input { margin: 2px 0 0; cursor: pointer; }
.pf-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.pf-apply {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
    border: 1px solid var(--blue);
    cursor: pointer;
}
.pf-apply:hover { filter: brightness(0.95); }
.pf-reset { font-size: 12px; color: var(--text-muted); }

/* Citations pages */
.section-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* Capture review tabs */
.capture-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.capture-tab {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.capture-tab:hover { color: var(--text); text-decoration: none; }

.capture-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 600;
}

.tab-badge {
    background: #e5e7eb;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.capture-tab.active .tab-badge { background: var(--blue); color: #fff; }
.citations-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}
.citations-overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.citations-overview-table th, .citations-overview-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.citations-overview-table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}
.citations-overview-table tbody tr:hover { background: #f9fafb; }
.citations-overview-table tbody tr:last-child td { border-bottom: none; }
.cite-page { max-width: 400px; }
.cite-url-small { font-size: 12px; color: var(--text-muted); }

/* Brand cards (dashboard index) */
.brand-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.brand-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    width: 240px;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.brand-card:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; }
.brand-card-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); padding-right: 52px; padding-left: 28px; }
.brand-card-meta { font-size: 12px; color: var(--text-muted); }

/* Brand search + section headings */
.brand-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.brand-search {
    width: 100%;
    max-width: 360px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--card-bg);
}
.brand-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.brand-search-empty { font-size: 13px; color: var(--text-muted); }
.brand-section + .brand-section { margin-top: 28px; }
.brand-section-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0 0 12px;
}

/* Pin toggle on each card */
.brand-pin-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    line-height: 1;
    opacity: 0.25;
    filter: grayscale(100%);
    transition: opacity 0.15s, filter 0.15s, transform 0.15s;
}
.brand-pin-toggle:hover { opacity: 0.85; filter: grayscale(0%); }
.brand-pin-toggle.pinned { opacity: 1; filter: none; transform: rotate(-20deg); }
.brand-paused .brand-pin-toggle { pointer-events: all; }

/* Expandable citation rows */
.domain-row { cursor: pointer; }
.domain-row:hover { background: #f3f4f6 !important; }
.expand-link {
    font-size: 12px;
    color: var(--blue);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}
.expand-link:hover { color: #1d4ed8; }
.url-row { background: #fafbfc; }
.cite-url-row {
    padding-left: 32px !important;
    font-size: 12px;
    word-break: break-all;
}
.cite-url-row a { color: var(--text-muted); }
.cite-url-row a:hover { color: var(--blue); }
.cite-url-title { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Engine filter tabs */
.engine-filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; }

/* Citation filters */
.citation-filters { display: flex; gap: 6px; margin-bottom: 16px; }
.filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.filter-btn:hover { background: var(--bg); }
.filter-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

/* Citation type labels */
.cite-type-label {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.cite-type-owned { background: #dbeafe; color: #1e40af; }
.cite-type-earned { background: #dcfce7; color: #166534; }
.cite-type-organic { background: #f3f4f6; color: #6b7280; }

/* Admin page */
.admin-sections { display: flex; flex-direction: column; gap: 16px; max-width: 600px; }
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
}
.admin-card h3 { font-size: 16px; margin-bottom: 6px; }
.admin-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.admin-brand-list { display: flex; flex-direction: column; gap: 4px; }
.admin-brand-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}
.admin-brand-link:hover { background: var(--bg); text-decoration: none; }
.admin-brand-meta { font-size: 12px; color: var(--text-muted); font-weight: 400; text-align: right; margin-left: 16px; }

/* Sidebar bottom (admin + user) */
.sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
/* Reddit citations */
.subreddit-filter { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.subreddit-filter-label { font-size: 13px; color: var(--text-muted); }
.sub-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--card-bg);
    min-width: 200px;
}
.reddit-sub { font-weight: 600; white-space: nowrap; color: #ff4500; font-size: 12px; }
.reddit-thread { width: 250px; max-width: 250px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reddit-brands { font-size: 12px; color: var(--text-muted); }
.reddit-brand-tag { font-size: 12px; }
.reddit-brand-tag:not(:last-child)::after { content: ', '; }
.reddit-brand-tag.mention-brand { font-weight: 700; color: #92400e; }

.reddit-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.reddit-status-active { background: var(--green-bg); color: #166534; }
.reddit-status-removed { background: var(--red-bg); color: #991b1b; }
.reddit-status-archived { background: #f3f4f6; color: #6b7280; }
.reddit-status-error { background: var(--orange-bg); color: #92400e; }

.reddit-engines { font-size: 12px; color: var(--text-muted); }
.reddit-checked-at { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.btn-check-now {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    color: var(--blue);
}
.btn-check-now:hover { background: var(--bg); }
.btn-check-now:disabled { opacity: 0.5; cursor: not-allowed; }

.reddit-extra-filters { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filter-label { font-size: 13px; color: var(--text-muted); }
.rf-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
}
.rf-btn:hover { background: var(--bg); }
.rf-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

.reddit-check-bar { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-check-label { font-size: 13px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.check-status { font-size: 13px; color: var(--text-muted); }

/* YouTube */
.yt-video { max-width: 400px; font-size: 13px; }

/* Settings page */
.settings-brand {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.settings-brand h3 { font-size: 18px; margin-bottom: 4px; }
.settings-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; display: flex; gap: 16px; }
.settings-sections { display: flex; flex-direction: column; gap: 16px; }
.settings-section h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.settings-list { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-tag {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.settings-empty { font-size: 12px; color: var(--text-muted); font-style: italic; }

.settings-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 32px 0 16px;
}
.settings-section-divider::before,
.settings-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.settings-section-divider span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}
.settings-brand-paused { opacity: 0.5; }
.settings-prompts {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.settings-prompt-item {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.settings-prompt-item:last-child { border-bottom: none; }
.settings-topic-group { margin-bottom: 12px; }
.settings-topic-label {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 0;
    color: var(--text);
}

.sidebar-bottom-link {
    display: block;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--sidebar-text) !important;
    opacity: 0.7;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-bottom-link:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,0.08); }

/* Admin sub-links (Import Data, Review Captures) — same look as the links
   above, indented to read as part of Admin */
.sidebar-bottom-sub { padding-left: 32px; }

/* Citation performance dashboard */
.perf-empty { color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.perf-muted { color: var(--text-muted); font-size: 12px; }
.perf-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.perf-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.perf-controls select {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card, #fff);
}
.perf-search {
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card, #fff);
    width: 180px;
}
.perf-clear { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.fanout-prompt-chip {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}
.perf-brand {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 16px;
    margin-bottom: 12px;
}
.perf-brand summary {
    cursor: pointer;
    padding: 10px 4px;
    font-size: 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.perf-brand summary::-webkit-details-marker { margin-right: 4px; }
.perf-brand-meta { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.perf-brand .seeds-table { margin: 4px 0 12px; }
.perf-dtype {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4338ca;
    white-space: nowrap;
}
.perf-url {
    display: inline-block;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
    font-size: 13px;
}


/* View toggle */
.view-toggle {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}
.view-toggle-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.view-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.view-btn:hover { background: var(--bg); }
.view-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

.btn-tip-wrap { position: relative; }
.btn-tip {
    display: none;
    position: absolute;
    bottom: -40px;
    left: 0;
    background: var(--sidebar-bg);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    width: 220px;
    line-height: 1.4;
    z-index: 10;
    pointer-events: none;
}
.btn-tip-wrap:hover .btn-tip { display: block; }

/* Rank filter */
.rank-filter {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}
.rank-filter-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.rank-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
}
.rank-btn:hover { background: var(--bg); }
.rank-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

/* Category filter */
.category-filter { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.category-filter-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.cat-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.cat-btn:hover { background: var(--bg); }
.cat-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

/* Matrix context */
.matrix-question { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.matrix-hint { font-size: 12px; color: var(--border); font-style: italic; }

/* Trend chart */
.trend-chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px 12px;
    margin-bottom: 16px;
    overflow: visible;
}

.trend-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.trend-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-filter-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.trend-bars-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    height: 150px;
    overflow: visible;
}

.trend-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card-bg);
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.trend-scroll-btn:hover { background: #f3f4f6; color: var(--text); }
.trend-scroll-left { left: -14px; }
.trend-scroll-right { right: -14px; }

.trend-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0 4px;
    position: relative;
}

.trend-col-bar-wrap {
    width: 100%;
    height: 90px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.trend-col-bar {
    width: 60%;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: all 0.15s;
}

.trend-col:hover .trend-col-bar { filter: brightness(0.85); }

.trend-col.active .trend-col-bar { box-shadow: 0 0 0 2px var(--blue); }

.trend-col-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    height: 16px;
}

.trend-col-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    line-height: 1.2;
}

/* Hover tooltip */
.trend-col-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    padding: 10px 14px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    pointer-events: none;
}

.trend-col-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a2e;
}

.trend-col:hover .trend-col-tip { display: block; }

/* Week selector */
/* Weekly / Monthly granularity toggle */
.gran-toggle {
    display: inline-flex;
    gap: 0;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.gran-btn {
    padding: 5px 14px;
    border: none;
    background: var(--card-bg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
}
.gran-btn + .gran-btn { border-left: 1px solid var(--border); }
.gran-btn:hover { background: var(--bg); }
.gran-btn.active { background: var(--sidebar-bg); color: #fff; }

.week-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.week-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.week-btn:hover { background: var(--bg); }
.week-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

/* Matrix Table */
.matrix-container {
    overflow-x: auto;
    overflow-y: visible;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
    position: relative;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    white-space: nowrap;
}

.matrix-table th, .matrix-table td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: center;
}

.matrix-table thead th {
    background: #f9fafb;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.engine-header { background: var(--sidebar-bg) !important; color: #fff !important; }
.geo-header { background: #f3f4f6 !important; font-size: 11px; text-transform: uppercase; }

.col-prompt {
    text-align: left !important;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.col-volume { font-size: 12px; color: var(--text-muted); }

/* Full-prompt hover tooltip (Prompt column is truncated) */
#promptTip {
    position: fixed;
    z-index: 60;
    max-width: 440px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 13px;
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.22);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    white-space: normal;
}
#promptTip.on { opacity: 1; }

/* Cells */
.cell { font-weight: 600; font-size: 12px; cursor: pointer; }
.cell a { display: block; width: 100%; }
.cell-yes { background: var(--green-bg); color: #166534; }
.cell-yes a { color: #166534; }
.cell-no { background: var(--red-bg); color: #991b1b; }
.cell-no a { color: #991b1b; }
.cell { position: relative; }
.cell-ratio {
    display: none;
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--sidebar-bg);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}
.cell:hover .cell-ratio { display: block; }
.cell-partial { background: var(--orange-bg); color: #92400e; }
.cell-partial a { color: #92400e; }
.cell-nodata { color: var(--text-muted); background: #f9fafb; }

/* Summary Stats */
.summary-stats { margin-top: 24px; }
.summary-stats h3 { font-size: 16px; margin-bottom: 12px; }

.stats-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 24px;
    min-width: 120px;
    text-align: center;
}

.stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Prompt Detail */
.prompt-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.engine-tabs, .geo-tabs {
    display: flex;
    gap: 4px;
}

.tab-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
}
.tab-btn:hover { background: var(--bg); }
.tab-btn.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

/* Mini matrix */
.prompt-matrix {
    margin-bottom: 20px;
}

.mini-matrix {
    border-collapse: collapse;
    font-size: 13px;
}

.mini-matrix th, .mini-matrix td {
    padding: 6px 14px;
    border: 1px solid var(--border);
    text-align: center;
}

.mini-matrix th { background: #f9fafb; font-size: 11px; text-transform: uppercase; }
.engine-label { text-align: left !important; font-weight: 600; background: #f9fafb; }

.mini-cell { cursor: pointer; transition: outline 0.15s; }
.mini-cell.selected { outline: 3px solid var(--blue); outline-offset: -1px; }


/* Detail Panel */
.detail-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    min-height: 200px;
}

.detail-placeholder { color: var(--text-muted); font-style: italic; }
.detail-loading { color: var(--text-muted); }

.entry-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.entry-date { font-size: 13px; color: var(--text-muted); }
.entry-engine, .entry-geo {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 4px;
    font-weight: 600;
}

.badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.badge-yes { background: var(--green-bg); color: #166534; }
.badge-no { background: var(--red-bg); color: #991b1b; }

/* Sections */
.section { margin-bottom: 24px; }
.section h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

/* Competitor ranking */
.rank-summary { font-size: 14px; margin-bottom: 10px; }
.ranked-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ranked-item {
    font-size: 13px;
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.ranked-brand {
    background: var(--orange-bg);
    border-color: var(--orange);
    font-weight: 700;
}
.ranked-pos {
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 2px;
}
.ranked-brand .ranked-pos { color: #92400e; }

/* Mentions */
.mentions-list { display: flex; gap: 6px; flex-wrap: wrap; }
.mention-tag {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
}
.mention-brand { background: var(--orange-bg); border-color: var(--orange); font-weight: 600; }
.mention-competitor { background: var(--red-bg); border-color: var(--red); }

/* Response */
.response-text {
    font-size: 14px;
    line-height: 1.7;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.response-text p { margin-bottom: 8px; }

mark.hl-brand { background: var(--orange-bg); padding: 1px 3px; border-radius: 2px; }
mark.hl-competitor { background: var(--red-bg); padding: 1px 3px; border-radius: 2px; }

/* Citations table */
.citations-table-wrap { overflow-x: auto; }
.citations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.citations-table th, .citations-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.citations-table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.citations-table tbody tr:hover { background: #f9fafb; }

.cite-domain { font-weight: 600; white-space: nowrap; }
.cite-title { max-width: 300px; }
.cite-url { font-size: 12px; word-break: break-all; color: var(--text-muted); }
.cite-url a { color: var(--text-muted); }
.cite-url a:hover { color: var(--blue); }

.cite-seed-row { background: #f0fdf4 !important; }
.cite-seed-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #22c55e;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}
.cite-shared-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 2px;
}
.cite-not-shared-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 2px;
}
.cite-owned-row { background: #eff6ff !important; }
.cite-owned-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}

.cite-mention-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
    white-space: nowrap;
}
.cite-mention-badge.mention-checking { background: #f3f4f6; color: #6b7280; }
.cite-mention-badge.mention-yes { background: #16a34a; color: #fff; }
.cite-mention-badge.mention-no { background: #f3f4f6; color: #6b7280; }
.cite-mention-badge.mention-error { background: #fef3c7; color: #92400e; }
/* source marker (Diffbot / Reddit) rendered as a real superscript at the top */
.cite-mention-badge sup.cite-src-mark {
    font-size: 7px;
    font-weight: 700;
    margin-left: 2px;
    opacity: 0.85;
    vertical-align: super;
    line-height: 0;
}

/* Client-side table search (publishers / platforms / pages / URLs) */
/* sits inline on the engine-filter row, pushed to the right */
.filters-with-search { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.filters-with-search .engine-filter,
.filters-with-search .period-filter { margin-bottom: 0; }
.table-search-wrap { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; }
.table-search {
    width: 240px;
    max-width: 100%;
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.table-search:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.table-search-count { font-size: 12px; color: #6b7280; white-space: nowrap; }
/* composes with the engine filter (both can hide a row) */
.citations-overview-table tr.search-hidden { display: none !important; }

/* Citations toolbar: Download CSV (left) + check button (right) */
.cite-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.btn-check {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
    white-space: normal;
    max-width: 170px;
    line-height: 1.25;
    text-align: center;
}
.btn-check:hover { background: #2563eb; }
.btn-check:disabled { opacity: 0.6; cursor: not-allowed; }
/* secondary "Recheck" state once a run has happened */
.btn-recheck {
    padding: 4px 12px;
    font-size: 12px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    cursor: pointer;
    white-space: normal;
    max-width: 170px;
    line-height: 1.25;
    text-align: center;
}
.btn-recheck:hover { background: #dbeafe; }
.btn-recheck:disabled { opacity: 0.6; cursor: not-allowed; }

/* "Is <brand> present on the page?" column — hidden until a check has run */
.citations-table th.cite-present-head { white-space: normal; min-width: 130px; }
.citations-table th.cite-present-head,
.citations-table td.cite-present { display: none; }
.citations-table.show-present-col th.cite-present-head,
.citations-table.show-present-col td.cite-present { display: table-cell; }
.citations-table td.cite-present { text-align: center; font-size: 13px; white-space: nowrap; }
.present-val { font-weight: 700; }
.present-val.present-yes { color: #16a34a; }
.present-val.present-no { color: #6b7280; }
.present-val.present-unknown { color: #b45309; }
.present-flip {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 1px 5px;
    margin-left: 4px;
    color: #374151;
}
.present-flip:hover { background: #f3f4f6; }
.present-flip:disabled { opacity: 0.5; cursor: not-allowed; }
.present-override-note { font-size: 10px; color: #9ca3af; margin-top: 3px; white-space: normal; }
.present-reset { color: #6b7280; text-decoration: underline; }
/* subtle row tint once a check has run (seed/owned rows keep their colour via !important) */
.citations-table tbody tr.mention-row-yes { background: #f0fdf4; }
.citations-table tbody tr.mention-row-no { background: #fafafa; }

.cite-new-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #22c55e;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}
.cite-dropped-badge {
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 4px;
}
.cite-change { font-size: 11px; font-weight: 600; margin-left: 4px; }
.cite-change-up { color: #166534; }
.cite-change-down { color: #991b1b; }
.domain-row.dropped-row { opacity: 0.55; }
.url-row.dropped-row { opacity: 0.55; }
.section-header-row td {
    background: var(--bg-secondary, #f3f4f6);
    padding: 10px 14px;
    font-size: 13px;
    border-top: 2px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section-header-row.section-toggle:hover td { background: #e5e7eb; }
.section-arrow { display: inline-block; font-size: 10px; width: 14px; color: var(--text-muted); }
.sub-section-header td { background: var(--bg, #fff) !important; border-top: 1px solid var(--border); }
.sub-section-header:hover td { background: #f9fafb !important; }
.weekly-summary {
    margin-top: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary, #f3f4f6);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Sortable headers */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: var(--border); }
th.sortable::after { content: ' \2195'; font-size: 10px; color: var(--text-muted); }
th.sort-asc::after { content: ' \2191'; color: var(--text); }
th.sort-desc::after { content: ' \2193'; color: var(--text); }

/* Type tags */
.type-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.type-listicle { background: #dbeafe; color: #1e40af; }
.type-comparison { background: #fae8ff; color: #86198f; }
.type-guide { background: #d1fae5; color: #065f46; }
.type-review { background: #fef3c7; color: #92400e; }
.type-blog { background: #e0e7ff; color: #3730a3; }
.type-reddit { background: #fee2e2; color: #991b1b; }
.type-youtube { background: #fee2e2; color: #dc2626; }
.type-linkedin { background: #dbeafe; color: #1d4ed8; }
.type-github { background: #f3f4f6; color: #1f2937; }
.type-wiki { background: #f3f4f6; color: #4b5563; }
.type-news { background: #fef3c7; color: #78350f; }
.type-docs { background: #d1fae5; color: #047857; }
.type-website { background: #f3f4f6; color: #6b7280; }

/* Fanout */
.fanout-list { list-style: disc; padding-left: 20px; }
.fanout-list li { padding: 3px 0; font-size: 13px; }

/* Date selector */
.date-selector {
    margin-bottom: 16px;
}
.date-selector label { font-size: 13px; font-weight: 600; margin-right: 8px; }
.date-selector select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}

/* Brand status toggle */
.brand-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
}
.brand-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 4px;
}
.brand-card-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    pointer-events: all;
}
.status-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.status-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 20px;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.status-toggle input:checked + .toggle-slider { background: var(--green); }
.status-toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-label { font-size: 12px; color: var(--text-muted); }

/* Paused brand styles */
.brand-paused .brand-card {
    opacity: 0.45;
    filter: grayscale(40%);
    pointer-events: none;
}
.brand-paused .brand-card-toggle { pointer-events: all; opacity: 1; filter: none; }
.brand-paused .brand-card:hover { border-color: var(--border); box-shadow: none; }
.brand-nav-paused a { opacity: 0.45; }

/* Calendly nudge */
.calendly-nudge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--blue);
    background: var(--blue-bg);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 8px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s, border-color 0.15s;
}
.calendly-nudge:hover { background: #c7d9f5; border-color: #93c5fd; text-decoration: none; }

/* View-as-competitor banner */
.view-as-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
}
.view-as-banner a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

/* UGC Sidebar */
.ugc-section-link {
    color: rgba(255,255,255,0.4) !important;
    text-decoration: none !important;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.ugc-section-link:hover { color: rgba(255,255,255,0.7) !important; text-decoration: none !important; }
.ugc-nav-sub a {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}
.ugc-nav-sub a.ugc-section-link-inline {
    display: block !important;
}
.ugc-nav-count {
    font-size: 10px;
    opacity: 0.5;
    font-weight: 400;
}
.ugc-view-all { opacity: 0.5 !important; font-size: 11px !important; }
.ugc-section-link-inline {
    font-size: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.4) !important;
    font-weight: 600 !important;
    opacity: 1 !important;
    padding-left: 24px !important;
    display: block !important;
}
.ugc-section-link-inline:hover { color: rgba(255,255,255,0.7) !important; }
.nav-section-stat {
    display: block;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.5;
    font-weight: 400;
    margin-top: 1px;
}
.ugc-nav-indent a { padding-left: 36px !important; }
.nav-domain-hint {
    display: block;
    font-size: 10px;
    opacity: 0.4;
    font-weight: 400;
    margin-top: 1px;
}
.nav-section-title {
    display: block;
}
.collapse-arrow {
    font-size: 13px;
    opacity: 0.5;
    transition: transform 0.2s;
    display: inline-block;
    float: right;
    cursor: pointer;
    padding: 2px 6px;
}
.collapsible-group {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease;
}
.collapsible-group.collapsed {
    max-height: 0;
}
.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

/* UGC Overview */
.ugc-cat-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted) !important;
    text-decoration: none !important;
    white-space: nowrap;
}
.ugc-cat-badge:hover { background: var(--blue-bg); border-color: var(--blue); color: var(--blue) !important; }

.ugc-discover-section { margin-bottom: 24px; }
.ugc-discover-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}
.ugc-discover-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--orange-bg);
    border-radius: 6px;
    color: #92400e;
}

/* UGC Category page */
.ugc-tab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}
.ugc-tab {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.ugc-tab:hover { background: var(--bg); }
.ugc-tab.active { background: var(--sidebar-bg); color: #fff; border-color: var(--sidebar-bg); }

.ugc-plat-cell { font-weight: 500; }
.ugc-plat-cell a { color: var(--blue) !important; }
.ugc-domain-hint { display: block; font-size: 11px; color: var(--text-muted); font-weight: 400; }

.ugc-discover-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.ugc-discover-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}
.ugc-discover-name { font-size: 14px; font-weight: 600; }
.ugc-discover-domain { font-size: 12px; color: var(--text-muted); }

/* UGC Platform detail */
.ugc-url-cell { max-width: 500px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* UGC domain tags */
.ugc-domain-tag { display: inline-flex; align-items: center; gap: 4px; background: #f0fdf4; border: 1px solid #86efac; color: #166534; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }

/* URL classify override button */
.btn-classify-override { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.btn-classify-override:hover { border-color: var(--blue); color: var(--blue); }
.btn-classify-override:disabled { opacity: 0.5; cursor: default; }

/* Owned domain highlight row */
.owned-domain-row { background: #eff6ff; border-bottom: 2px solid #3b82f6; }
.owned-domain-row td { font-weight: 600; }
.owned-domain-badge { display: inline-block; font-size: 10px; font-weight: 600; background: #3b82f6; color: #fff; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: 0.3px; }

/* Citation URL filter mode */
.cite-url-banner { background: #fffbeb; border: 1px solid #fbbf24; color: #92400e; padding: 8px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.cite-url-banner a { color: var(--blue); }
.cite-url-banner strong { word-break: break-all; }
.cite-count { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.cite-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cite-item { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.cite-item:hover { border-color: var(--blue); }
.cite-item-active { border-color: var(--blue); background: #eff6ff; }
.cite-item-engine { font-weight: 600; }
.cite-item-geo { background: var(--border); padding: 1px 5px; border-radius: 3px; font-size: 11px; text-transform: uppercase; }
.cite-item-date { color: var(--text-muted); font-size: 12px; }
.cite-filtered-row { background: #fefce8 !important; }
.cite-filtered-row td { font-weight: 600; }

/* Cite occurrences: engine tabs + date timeline */
.cite-engine-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.cite-eng-tabs { display: inline-flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.cite-eng { display: inline-flex; align-items: center; gap: 7px; border: none; background: transparent; color: var(--text); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.cite-eng:hover { background: var(--border); }
.cite-eng-active, .cite-eng-active:hover { background: var(--blue); color: #fff; }
.cite-eng-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(0,0,0,0.08); font-size: 11px; font-weight: 700; }
.cite-eng-active .cite-eng-count { background: rgba(255,255,255,0.28); }
.cite-geo-tabs { display: inline-flex; gap: 4px; }
.cite-geo { border: 1px solid var(--border); background: var(--bg); color: var(--text-muted); padding: 4px 9px; border-radius: 6px; cursor: pointer; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.cite-geo-active { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.cite-geo-label { font-size: 12px; color: var(--text-muted); }
.cite-date-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 16px; }
.cite-date-caption { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.cite-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.cite-date { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.cite-date:hover { border-color: var(--blue); }
.cite-date-active { border-color: var(--blue); background: #eff6ff; color: var(--blue); font-weight: 600; }

/* Engine pills */
.engine-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.engine-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 12px; padding: 2px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.engine-pill:hover { border-color: var(--blue); color: var(--blue); }
.engine-pill-active { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.engine-prompt-count { font-size: 10px; background: var(--border); color: var(--text-muted); padding: 0 4px; border-radius: 3px; min-width: 14px; text-align: center; }
.engine-pill:hover .engine-prompt-count, .engine-pill-active .engine-prompt-count { background: #dbeafe; color: var(--blue); }
.engine-prompts-row td { padding: 0 !important; border-top: none !important; }
.engine-prompts-detail { padding: 8px 16px 12px; background: #f8fafc; border-top: 1px dashed var(--border); }
.engine-prompt-group { margin-bottom: 4px; }
.engine-prompt-header { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.engine-prompt-link { display: block; font-size: 13px; color: var(--blue); padding: 3px 0; text-decoration: none; }
.engine-prompt-link:hover { text-decoration: underline; }

/* Breadcrumbs */
.breadcrumb-link { color: var(--text-muted) !important; font-weight: 400; }
.breadcrumb-link:hover { color: var(--blue) !important; }
.breadcrumb-sep { color: var(--text-muted); margin: 0 4px; font-weight: 300; }

/* Insights — Reddit (and future platforms) */
.reddit-action-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.reddit-action-bar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.btn-ghost {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: var(--card-bg); }
.btn-insights {
    padding: 7px 14px;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    color: #5b21b6;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.btn-insights:hover { border-color: #a78bfa; box-shadow: 0 1px 3px rgba(124, 58, 237, 0.15); }
.insights-generated-at { color: var(--text-muted); font-size: 12px; }

.insights-actions { display: flex; align-items: center; gap: 12px; margin: 16px 0 24px; }
.insights-status { font-size: 13px; color: var(--text-muted); }
.insights-status-running { color: var(--blue); }
.insights-status-ok { color: var(--green); }
.insights-status-error { color: #b91c1c; }

.insights-empty {
    background: var(--card-bg);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 24px;
    color: var(--text-muted);
    margin-top: 16px;
}
.insights-empty h3 { margin-top: 0; color: var(--text); }

.insights-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.insights-block h3 { margin-top: 0; margin-bottom: 12px; font-size: 16px; }
.insights-block-desc { color: var(--text-muted); font-size: 13px; margin: -4px 0 16px; }
.insights-summary { font-size: 15px; line-height: 1.55; margin: 0; }
.insights-muted { color: var(--text-muted); }
.insights-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }

.insights-list { margin: 0; padding-left: 20px; }
.insights-list li { margin-bottom: 8px; line-height: 1.5; }

.insights-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.insights-table th, .insights-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.insights-table thead th { background: #f9fafb; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.insights-table tbody tr:last-child td { border-bottom: none; }

.insights-strategy-list { list-style: none; padding: 0; margin: 0; counter-reset: strategy; }
.insights-strategy-item {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #fff;
    counter-increment: strategy;
    position: relative;
}
.insights-strategy-item::before {
    content: counter(strategy);
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 22px;
    font-weight: 700;
    color: #e5e7eb;
}
.insights-priority-high { border-left-color: #dc2626; }
.insights-priority-medium { border-left-color: #f59e0b; }
.insights-priority-low { border-left-color: #9ca3af; }
.insights-strategy-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.insights-strategy-head strong { font-size: 15px; }
.insights-priority-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--text-muted);
}
.insights-priority-high .insights-priority-pill { background: #fee2e2; color: #b91c1c; }
.insights-priority-medium .insights-priority-pill { background: #fef3c7; color: #92400e; }
.insights-format-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #eff6ff;
    color: #1d4ed8;
}
.insights-format-comment_reply { background: #f0fdf4; color: #15803d; }
.insights-format-answer_in_thread { background: #faf5ff; color: #7e22ce; }
.insights-pattern-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--text-muted);
}
/* Curious-persona post types */
.insights-pattern-alternative-search { background: #ecfeff; color: #0e7490; }
.insights-pattern-direct-comparison  { background: #eff6ff; color: #1d4ed8; }
.insights-pattern-brand-question     { background: #fef3c7; color: #92400e; }
.insights-pattern-generic-category   { background: #f3f4f6; color: #374151; }
/* Customer-persona post types */
.insights-pattern-migration-story    { background: #ecfdf5; color: #047857; }
.insights-pattern-scale-review       { background: #f0fdf4; color: #15803d; }
.insights-pattern-anyone-else-here   { background: #f7fee7; color: #4d7c0f; }
.insights-pattern-side-by-side       { background: #ecfdf5; color: #047857; }
.insights-pattern-honest-pain-point  { background: #fef2f2; color: #b91c1c; }
/* Brand-persona post types */
.insights-pattern-open-community-question { background: #f5f3ff; color: #6d28d9; }
.insights-pattern-transparent-update      { background: #faf5ff; color: #7e22ce; }
.insights-pattern-founder-intro           { background: #fdf4ff; color: #a21caf; }
.insights-pattern-behind-the-scenes       { background: #fae8ff; color: #86198f; }
.insights-pattern-blog-syndication        { background: #fdf4ff; color: #a21caf; }
.insights-pattern-category-pov            { background: #f5f3ff; color: #6d28d9; }
.insights-pattern-tool-stack-writeup      { background: #ecfdf5; color: #047857; }
.insights-pattern-ranked-listicle         { background: #eff6ff; color: #1d4ed8; }
.insights-pattern-category-explainer      { background: #ecfeff; color: #0e7490; }
/* Venue pill */
.insights-venue-pill {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px dashed #d1d5db;
    background: #fafafa;
    color: #6b7280;
}
.insights-venue-self { background: #fff7ed; color: #c2410c; border-color: #fdba74; }
.insights-section-empty { padding: 12px 4px; }

/* Persona section header accents */
.insights-persona { border-left: 4px solid transparent; }
.insights-persona-brand    { border-left-color: #a21caf; }
.insights-persona-customer { border-left-color: #047857; }
.insights-persona-curious  { border-left-color: #1d4ed8; }
.insights-persona h3 { display: flex; align-items: center; gap: 8px; }

/* Tabs on insights page */
.insights-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin: 20px 0;
    flex-wrap: wrap;
}
.insights-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}
.insights-tab:hover { color: var(--text); }
.insights-tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.insights-tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #f3f4f6;
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.insights-tab.active .insights-tab-count { background: #dbeafe; color: #1d4ed8; }
.insights-tabs-group {
    display: flex;
    flex-direction: column;
    margin-left: 24px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
    align-self: stretch;
    justify-content: flex-end;
}
.insights-tabs-group-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 0 6px;
    text-align: center;
    align-self: stretch;
}
.insights-tabs-group-row { display: flex; gap: 4px; justify-content: center; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Insights header actions row */
.insights-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* "Generate +5 more ideas" footer per playbook tab */
.insights-generate-more {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

/* Page-level breadcrumb (drafts pages) */
.page-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.page-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.page-breadcrumb-sep { color: #d1d5db; font-weight: 300; }
.page-breadcrumb-current { color: var(--text); font-weight: 600; }

/* Drafts list table */
.drafts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.drafts-table th, .drafts-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.drafts-table thead th { background: #f9fafb; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.drafts-table tbody tr:last-child td { border-bottom: none; }
.drafts-table tbody tr:hover { background: #f9fafb; }
.drafts-title-link { color: var(--text); font-weight: 500; }
.drafts-title-link:hover { color: var(--blue); }
.drafts-date { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.drafts-comments-cell { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.drafts-row { cursor: pointer; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Status pills (drafts) */
.draft-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f3f4f6;
    color: var(--text-muted);
}
.draft-status-draft { background: #eff6ff; color: #1d4ed8; }
.draft-status-approved { background: #ecfdf5; color: #047857; }
.draft-status-approved-with-edits { background: #f0fdfa; color: #0f766e; }
.draft-status-skipped { background: #f3f4f6; color: #6b7280; }

/* Persona tags (reused on list + detail) */
.insights-persona-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
}
.insights-persona-tag-brand    { background: #fae8ff; color: #86198f; }
.insights-persona-tag-customer { background: #ecfdf5; color: #047857; }
.insights-persona-tag-curious  { background: #dbeafe; color: #1d4ed8; }

/* Draft detail form */
.draft-form section.insights-block { margin-bottom: 16px; }
.draft-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}
.draft-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.draft-title-input { font-weight: 600; font-size: 15px; }
.draft-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.55;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
    resize: vertical;
}
.draft-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.draft-field-block { margin-bottom: 12px; }
.draft-field-block:last-child { margin-bottom: 0; }
.draft-field-label {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px;
}
.draft-edited-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.draft-comment-block {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 10px;
    background: #fafbfc;
}
.draft-comment-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px;
}
.draft-comment-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.draft-comment-text { background: #fff; }
.draft-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* Source-idea collapsible panel on detail page */
.insights-source-idea summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.insights-source-idea-body { margin-top: 12px; }
.insights-source-idea-body p { margin: 6px 0; font-size: 13px; line-height: 1.5; }

/* Per-idea draft block */
.insights-draft-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.insights-draft-status { font-size: 12px; color: var(--text-muted); }

.insights-draft {
    margin-top: 14px;
    padding: 14px;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.insights-draft-block { margin-bottom: 12px; }
.insights-draft-block:last-child { margin-bottom: 0; }
.insights-draft-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.insights-draft-text {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.insights-draft-title-text { font-weight: 600; font-size: 15px; }
.insights-draft-body-text { font-size: 14px; }

.insights-draft-comments { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.insights-draft-comments h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 10px; font-weight: 700; }
.insights-draft-comment { margin-bottom: 10px; }
.insights-draft-comment:last-child { margin-bottom: 0; }

.insights-copy-btn {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.insights-copy-btn:hover { border-color: var(--blue); color: var(--blue); }

.insights-mention-pill {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    border-radius: 3px;
}
.insights-mention-yes { background: #ecfdf5; color: #047857; }
.insights-mention-no  { background: #f3f4f6; color: #6b7280; }

.insights-draft-footer { margin-top: 10px; font-size: 11px; color: var(--text-muted); text-align: right; }
.insights-target { font-size: 12px; color: var(--text-muted); }
.insights-suggested-title { font-size: 15px; font-style: italic; color: var(--text); margin: 6px 0 10px; line-height: 1.45; }
.insights-target-url { margin: 6px 0; font-size: 13px; word-break: break-all; }
.insights-meta-line { margin: 6px 0; font-size: 13px; line-height: 1.5; }
.insights-rationale { margin: 6px 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.insights-angle { margin: 6px 0; font-size: 14px; color: var(--text); background: #f9fafb; padding: 10px 12px; border-radius: 4px; line-height: 1.5; }

.insights-url-list { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.insights-url-list li { margin-bottom: 4px; }
.insights-url-list a { word-break: break-all; }
.insights-url-list-compact { font-size: 12px; max-height: 80px; overflow: hidden; }

/* Third-party publishers — Classify button + Type / Pages-cited columns */
.thirdparty-classify-bar { display: flex; align-items: center; gap: 12px; margin: 12px 0 16px; flex-wrap: wrap; }
.thirdparty-classify-status { font-size: 13px; color: var(--text-muted); }
.thirdparty-classify-running { color: var(--blue); }
.thirdparty-classify-ok      { color: var(--green); }
.thirdparty-classify-error   { color: #b91c1c; }

.domain-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f3f4f6;
    color: var(--text-muted);
    white-space: nowrap;
}
.domain-type-competitor-product    { background: #fee2e2; color: #b91c1c; }
.domain-type-news-media            { background: #eff6ff; color: #1d4ed8; }
.domain-type-industry-blog         { background: #ecfeff; color: #0e7490; }
.domain-type-directory-aggregator  { background: #fef3c7; color: #92400e; }
.domain-type-affiliate-comparison  { background: #fdf4ff; color: #a21caf; }
.domain-type-official-vendor       { background: #ecfdf5; color: #047857; }
.domain-type-other                 { background: #f3f4f6; color: #4b5563; }
.domain-type-you                   { background: #dbeafe; color: #1d4ed8; }
.domain-type-pending {
    background: transparent;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
}

.page-types-cell  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.page-type-stat   { white-space: nowrap; }
.page-types-empty { color: var(--text-muted); }

/* Per-URL page-type pill (used on the third-party domain drill-down) */
.page-type-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f3f4f6;
    color: #4b5563;
    white-space: nowrap;
}
.page-type-listicle           { background: #fef3c7; color: #92400e; }
.page-type-comparison         { background: #dbeafe; color: #1d4ed8; }
.page-type-alternatives-list  { background: #fee2e2; color: #b91c1c; }
.page-type-review             { background: #ecfdf5; color: #047857; }
.page-type-pricing            { background: #f0fdfa; color: #0f766e; }
.page-type-landing            { background: #f5f3ff; color: #6d28d9; }
.page-type-blog-post          { background: #ecfeff; color: #0e7490; }
.page-type-news-article       { background: #eff6ff; color: #1d4ed8; }
.page-type-press-release      { background: #fdf4ff; color: #a21caf; }
.page-type-docs               { background: #f0fdf4; color: #15803d; }
.page-type-other              { background: #f3f4f6; color: #4b5563; }

/* ===== Citation Seed Pipeline (admin global page) ===== */
.pipeline-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.pipeline-filters { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.pl-filter { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.pl-filter select { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; background: #fff; }
.pl-status-toggle { display: inline-flex; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.pl-status {
    padding: 6px 12px; font-size: 13px; color: var(--text-muted);
    text-decoration: none; border-right: 1px solid #e5e7eb; background: #fff;
}
.pl-status:last-child { border-right: none; }
.pl-status.active { background: var(--accent, #2563eb); color: #fff; }
.pl-status .pl-count { opacity: 0.75; font-size: 11px; margin-left: 2px; }

.pipeline-table td { vertical-align: top; }
.pl-brand { font-weight: 600; white-space: nowrap; }
.pl-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pl-partner-name { font-weight: 500; }
.pl-contact { font-family: ui-monospace, monospace; }
.pl-muted { color: var(--text-muted); }
.pl-comments { font-size: 12px; color: #374151; max-width: 240px; white-space: pre-wrap; }
.pl-row-live { background: #f9fafb; }
.pl-row-live .seed-title a { color: #166534; }
.pl-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.pl-badge-pipeline { background: #fef3c7; color: #92400e; }
.pl-badge-live { background: #dcfce7; color: #166534; }
.pl-actions { white-space: nowrap; }
.pl-actions .btn { margin-right: 4px; }

.btn-small { font-size: 12px; padding: 3px 9px; }

/* Modal */
.pl-modal-overlay {
    position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 1000; padding: 40px 16px; overflow-y: auto;
}
.pl-modal {
    background: #fff; border-radius: 10px; width: 100%; max-width: 620px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); display: flex; flex-direction: column;
}
.pl-modal-sm { max-width: 460px; }
.pl-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #e5e7eb;
}
.pl-modal-head h3 { margin: 0; font-size: 16px; }
.pl-modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted); }
.pl-modal-body { padding: 16px 20px; }
.pl-modal-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.pl-modal-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px; border-top: 1px solid #e5e7eb;
}
.pl-field { margin-bottom: 12px; }
.pl-field label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.pl-field input, .pl-field select, .pl-field textarea {
    width: 100%; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.pl-field-row { display: flex; gap: 12px; }
.pl-field-row .pl-field { flex: 1; }
.pl-req { color: var(--red, #dc2626); }
.pl-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 16px 0 8px; }
.pl-checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }
.pl-deal { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.pl-deal-paid { background: #fee2e2; color: #991b1b; }
.pl-deal-exchange { background: #dbeafe; color: #1e40af; }
.pl-opt { color: var(--text-muted); font-weight: 400; font-size: 11px; }

/* ============================================================
   Entitlement locks (gated brands)
   ============================================================ */

/* Sidebar: locked links stay visible, dimmed, with a lock glyph. */
.nav-locked { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nav-locked, .nav-sub a.nav-locked { color: #6f7686; }
.nav-locked:hover { color: #9ca3af; }
.nav-lock-icon { flex-shrink: 0; opacity: .75; }

/* Teaser KPIs on the locked dashboard. */
.lock-kpis {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
    background: var(--border); border: 1px solid var(--border);
    border-radius: 8px 8px 0 0; overflow: hidden; margin-top: 20px;
}
.lock-kpi { background: var(--card-bg); padding: 18px 20px; }
.lock-kpi-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-muted);
}
.lock-kpi-val {
    font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px;
    font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 9px;
}
.lock-kpi-of { font-size: 18px; font-weight: 600; color: var(--text-muted); }
.lock-kpi-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lock-kpi-delta.is-down { color: var(--red); }
.lock-kpi-delta.is-up { color: var(--green); }
.lock-kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* The lock card sits over an empty placeholder table - no real data is sent.
   The two are STACKED IN ONE GRID CELL rather than absolutely positioned: the
   row then grows to whichever is taller, so a long lock message can never
   overflow the zone and cover the KPI tiles above it. */
.locked-zone {
    display: grid; background: var(--card-bg);
    border: 1px solid var(--border); border-top: 0; border-radius: 0 0 8px 8px;
    overflow: hidden;
}
.locked-placeholder, .lock-card { grid-area: 1 / 1; }
.locked-placeholder {
    filter: blur(5px); opacity: .45; pointer-events: none; user-select: none;
    padding: 6px 0 12px; overflow: hidden;
}
.locked-placeholder td { height: 30px; }
.lock-card {
    align-self: center; justify-self: center; margin: 28px 0;
    width: min(430px, 86%); background: var(--sidebar-bg); color: #fff;
    border-radius: 12px; padding: 26px 28px 24px; text-align: center;
    box-shadow: 0 18px 44px -12px rgba(26, 26, 46, .55);
}
.lock-badge {
    width: 38px; height: 38px; border-radius: 10px; margin: 0 auto 13px;
    background: rgba(255, 255, 255, .1);
    display: flex; align-items: center; justify-content: center;
}
.lock-badge-light { background: #eef0f4; }
.lock-card-title { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.lock-card-body { font-size: 13.5px; color: #b8bdc9; margin-top: 8px; line-height: 1.55; }

/* Shared CTA row (_lock_cta.html). */
.lock-cta { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.lock-btn {
    text-decoration: none; font-size: 13px; font-weight: 600;
    padding: 9px 20px; border-radius: 6px; display: inline-block;
}
.lock-btn-primary { background: var(--blue); color: #fff; }
.lock-btn-primary:hover { background: #2563eb; }
.lock-btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.lock-btn-ghost-dark { color: #d5d9e2; border-color: rgba(255, 255, 255, .22); }
.lock-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.lock-foot { font-size: 11.5px; color: #9ca3af; margin-top: 14px; }
.lock-foot-dark { color: #767d8c; }

/* Full-stop lock page (locked.html). */
.full-lock {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 62px 24px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 8px; margin-top: 20px;
}
.full-lock-title { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.full-lock-body {
    font-size: 14px; color: var(--text-muted); max-width: 46ch;
    margin: 10px auto 0; line-height: 1.6;
}
.full-lock-back { font-size: 13px; color: var(--text-muted); margin-top: 20px; }

/* Banners: admin lock preview + trial countdown. */
.lock-banner {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px;
}
.lock-banner svg { flex-shrink: 0; }
.lock-banner b { font-weight: 700; }
.lock-banner-admin { background: var(--sidebar-bg); color: #e5e7eb; }
.lock-banner-admin a { color: #93c5fd; }
.lock-banner-trial { background: var(--orange-bg); border: 1px solid #fcd34d; color: #78350f; }
.lock-banner-trial a { color: #78350f; font-weight: 700; }

@media (max-width: 720px) {
    .lock-kpis { grid-template-columns: 1fr; }
}

/* Team & seats (Brand Settings) */
.team-section { max-width: 640px; }
.team-list { display: flex; flex-direction: column; gap: 6px; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-bg); }
.team-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-email { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.team-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; flex-shrink: 0; }
.team-owner { background: #e0e7ff; color: #3730a3; }
.team-active { background: #dcfce7; color: #15803d; }
.team-pending { background: #fef3c7; color: #92400e; }
.team-remove { background: none; border: 0; color: #dc2626; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.team-remove:hover { text-decoration: underline; }

/* Invite-your-team dashboard nudge */
.invite-nudge { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 18px; background: #eef2ff; border: 1px solid #c7d2fe; color: #3730a3; }
.invite-nudge svg { flex-shrink: 0; }
.invite-nudge a { color: #4f46e5; font-weight: 700; text-decoration: none; }
.invite-nudge .nudge-x { margin-left: auto; background: none; border: 0; color: #6366f1; font-size: 17px; cursor: pointer; line-height: 1; padding: 0 4px; }

/* In-app upgrade / plans page */
.upg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 8px; max-width: 900px; }
.upg-card { position: relative; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 24px 22px; display: flex; flex-direction: column; }
.upg-popular { border-color: var(--blue); box-shadow: 0 8px 30px -12px rgba(59,130,246,.35); }
.upg-badge { position: absolute; top: -10px; left: 22px; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.upg-name { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.upg-price { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.upg-price span { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.upg-feats { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.upg-feats li { padding-left: 22px; position: relative; }
.upg-feats li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.upg-cta { margin-top: auto; text-align: center; font-size: 14px; font-weight: 600; white-space: nowrap; }
.upg-note { color: var(--text-muted); font-size: 13px; margin-top: 16px; max-width: 900px; }

/* Live-fill: a cell whose data is still being pulled */
.cell-loading { text-align: center; }
.cell-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: cellspin .7s linear infinite; vertical-align: middle; }
@keyframes cellspin { to { transform: rotate(360deg); } }
