.sources-hero {
    text-align: center;
    padding: 3rem 1rem 1.5rem;
}
.sources-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.sources-hero p {
    color: var(--text-muted, #94a3b8);
    max-width: 640px;
    margin: 0 auto;
}

/* باکس آمار سریع */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem auto 0;
}
.stat-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    min-width: 120px;
    text-align: center;
}
.stat-item .stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent, #3b82f6);
    line-height: 1.2;
}
.stat-item .stat-number-active { color: #34d399; }
.stat-item .stat-number-idle { color: #fbbf24; }
.stat-item .stat-number-pending { color: #cbd5e1; }
.stat-item .stat-number-inactive { color: #94a3b8; }
.stat-item .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

/* نوار ابزار: جستجو + فیلتر + مرتب‌سازی */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 2rem auto 1rem;
    padding: 0 1rem;
}
.search-box {
    flex: 1 1 280px;
    position: relative;
}
.search-box input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 2.4rem 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-main, #f8fafc);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-box input:focus {
    border-color: var(--accent, #3b82f6);
}
.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #94a3b8);
}
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.filter-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-main, #f8fafc);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--accent, #3b82f6); }
.filter-btn.active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}
.sort-select {
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: var(--text-main, #f8fafc);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

/* شبکه کارت‌های منبع */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    max-width: 1100px;
    margin: 1rem auto 3rem;
    padding: 0 1rem;
}
.source-card {
    background: var(--card-bg, #1e293b);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.source-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.source-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.active { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.idle { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.status-dot.inactive { background: #64748b; }
.status-dot.pending { background: #475569; box-shadow: 0 0 0 3px rgba(71,85,105,0.25); animation: pulse-pending 2s infinite; }
@keyframes pulse-pending { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.source-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    word-break: break-word;
}
.source-metrics {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
}
.metric {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    text-align: center;
}
.metric .num {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main, #f8fafc);
}
.metric .lbl {
    font-size: 0.7rem;
    color: var(--text-muted, #94a3b8);
}
.metric.fresh .num { color: #10b981; }
.source-foot {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 0.6rem;
}
.source-foot .rel { color: var(--accent, #3b82f6); }
.badge-fresh {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(16,185,129,0.15);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.3);
    margin-right: 0.4rem;
}
.badge-idle {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.3);
    margin-right: 0.4rem;
}
.badge-dead {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(100,116,139,0.18);
    color: #94a3b8;
    border: 1px solid rgba(100,116,139,0.4);
    margin-right: 0.4rem;
}
.sources-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted, #94a3b8);
    padding: 2rem;
}
.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted, #94a3b8);
    padding: 2rem;
}
.refresh-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-main, #f8fafc);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}
.refresh-btn:hover { border-color: var(--accent, #3b82f6); }

.sources-footer-brand { margin-bottom: 15px; }
.sources-footer-brand-name { font-size: 1.5rem; }
.sources-footer-social { margin-top: 15px; }

@media (max-width: 576px) {
    .sources-hero {
        padding-inline: 0.75rem;
    }
    .toolbar {
        align-items: stretch;
        padding-inline: 0.75rem;
    }
    .search-box,
    .sort-select,
    .refresh-btn {
        flex-basis: 100%;
        max-width: 100%;
    }
    .filter-group {
        width: 100%;
    }
    .filter-btn {
        flex: 1 1 auto;
    }
    .sources-grid {
        grid-template-columns: minmax(0, 1fr);
        padding-inline: 0.75rem;
    }
}

.kh-public-sources .source-card {padding:16px;border-radius:12px}
.kh-public-sources .source-card:hover {transform:none;box-shadow:none}
.kh-public-sources .source-avatar {display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:10px;background:rgba(59,130,246,.12);color:var(--text-main,#e2e8f0);font-size:.85rem;font-weight:700}
.kh-public-sources .source-identity {display:flex;flex-direction:column;min-width:0;gap:3px}
.kh-public-sources .source-canonical {font-size:.72rem;color:var(--text-muted,#94a3b8);overflow-wrap:anywhere}
.kh-public-sources .source-name {font-size:.95rem}
.kh-public-sources .source-metrics {margin-bottom:10px}
.kh-public-sources .source-foot {line-height:1.9}
.kh-public-sources .source-skeleton {min-height:170px}
.kh-public-sources .source-skeleton span {display:block;height:18px;margin:12px 0;border-radius:5px;background:rgba(148,163,184,.15)}
.kh-public-sources .source-skeleton span:first-child {width:55%}
.kh-public-sources .loading {padding:10px;margin:0}

.kh-public-sources .stat-number {text-shadow:none}
html[data-theme="dark"] .kh-public-sources .source-foot .rel {color:#93c5fd}
html[data-theme="light"] .kh-public-sources .source-foot .rel {color:#1d4ed8}
html[data-theme="light"] .kh-public-sources .stat-number-pending,
html[data-theme="light"] .kh-public-sources .stat-number-inactive {color:#475569}
