/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --bg: #0a0c10;
    --bg2: #111420;
    --bg3: #181d2e;
    --border: #1e2540;
    --border2: #252d45;
    --accent: #4f8ef7;
    --accent2: #7c5af0;
    --accent3: #3ecf8e;
    --text: #e2e8f0;
    --text2: #94a3b8;
    --text3: #64748b;
    --danger: #ef4444;
    --warn: #f59e0b;
    --font: "Inter", system-ui, sans-serif;
    --mono: "JetBrains Mono", "Fira Code", monospace;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}
body {
    overflow-x: hidden;
}
.hidden {
    display: none !important;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    /* anchor for absolute mobile nav */
    isolation: isolate;
}
.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo-icon {
    font-size: 20px;
    color: var(--accent);
}
.logo-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    text-decoration: none;
}
.logo-text:hover {
    text-decoration: none;
}
.logo-sub {
    font-size: 11px;
    color: var(--text3);
    display: none;
}
.logo-version {
    font-size: 10px;
    color: var(--text3);
    opacity: 0.6;
    display: none;
}
@media (min-width: 640px) {
    .logo-sub {
        display: block;
    }
    .logo-version {
        display: block;
    }
}

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.15s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: var(--border);
    text-decoration: none;
}
.nav-link.active {
    color: var(--accent);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.crawl-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text2);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text3);
}
.status-dot.idle {
    background: var(--accent3);
}
.status-dot.pulsing {
    background: var(--warn);
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.btn-crawl {
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.btn-crawl:hover {
    background: #6ba3f9;
}
.btn-crawl:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Controls Bar ───────────────────────────────────────────────────────── */
.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    flex: 1;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 11px;
    color: var(--text3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-group select,
.filter-group .search-input {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
    min-width: 140px;
}
.filter-group select:focus,
.filter-group .search-input:focus {
    border-color: var(--accent);
}
.date-mypicker {
    border-top: 1px solid var(--border);
    padding: 10px 10px 8px;
    user-select: none;
}
.date-mypicker-year-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.date-mypicker-arrow {
    background: none;
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.1s, color 0.1s;
}
.date-mypicker-arrow:hover { background: var(--bg3); color: var(--text); }
.date-mypicker-year-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.1s;
}
.date-mypicker-year-btn:hover { background: var(--border); }
.date-mypicker-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}
.date-mypicker-month {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font);
    padding: 5px 0;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.date-mypicker-month:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.date-mypicker-exact {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.date-mypicker-date-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-family: var(--font);
    outline: none;
    color-scheme: dark;
    transition: border-color 0.15s;
}
.date-mypicker-date-input:focus { border-color: var(--accent); }
.searchable-select {
    position: relative;
    min-width: 140px;
}
.searchable-select-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 7px 28px 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.searchable-select-input:focus { border-color: var(--accent); }
.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    z-index: 200;
    overflow: hidden;
}
.searchable-select-dropdown.hidden { display: none; }
.searchable-select-search {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
}
.searchable-select-options {
    max-height: 220px;
    overflow-y: auto;
}
.searchable-select-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.1s;
}
.searchable-select-option:hover { background: var(--bg3); color: var(--text); }
.searchable-select-option.selected { color: var(--accent); font-weight: 500; }

.search-group {
    flex: 1;
    min-width: 240px;
}
.search-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
}
.btn-search {
    padding: 7px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}
.btn-search:hover {
    background: #6ba3f9;
}
.btn-clear {
    padding: 7px 10px;
    background: var(--bg3);
    color: var(--text2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.btn-clear:hover {
    color: var(--danger);
    border-color: var(--danger);
    text-decoration: none;
}

.stats-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.stat-pill {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    display: flex;
    gap: 5px;
    align-items: center;
}
.stat-num {
    font-weight: 700;
    color: var(--accent);
    font-size: 13px;
}
.stat-label {
    color: var(--text3);
    font-size: 12px;
}

/* ── Panels ─────────────────────────────────────────────────────────────── */
.panel {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-icon {
    color: var(--accent);
    font-size: 14px;
}
.filter-badge {
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}
.count-badge {
    font-size: 11px;
    background: var(--bg3);
    color: var(--text3);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ── Dashboard Grid ─────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .panel-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
}
@media (max-width: 640px) {
    .panel-side {
        grid-template-columns: 1fr;
    }
}
.panel-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Trends List ────────────────────────────────────────────────────────── */
.trends-list {
    padding: 8px 0;
}
.trend-item {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.trend-item:last-child {
    border-bottom: none;
}
.trend-item:hover {
    background: var(--bg3);
}
.trend-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--text3);
    width: 24px;
    flex-shrink: 0;
    padding-top: 2px;
    font-family: var(--mono);
}
.trend-body {
    flex: 1;
    min-width: 0;
}
.trend-term-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.trend-term {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    text-transform: capitalize;
}
.trend-meta {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.trend-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.trend-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    transition: width 0.5s ease;
}
.trend-score {
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
    font-family: var(--mono);
}
.trends-empty {
    padding: 32px 24px;
    color: var(--text2);
    font-size: 13px;
    line-height: 1.8;
}
.trend-articles {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.trend-article-link {
    display: flex;
    gap: 6px;
    align-items: baseline;
    font-size: 12px;
    color: var(--text2);
    text-decoration: none;
    transition: color 0.1s;
}
.trend-article-link:hover {
    color: var(--accent);
    text-decoration: none;
}
.article-source {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(79, 142, 247, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.article-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-cat {
    background: rgba(79, 142, 247, 0.12);
    color: var(--accent);
}
.badge-region {
    background: rgba(62, 207, 142, 0.12);
    color: var(--accent3);
}

/* ── Charts ─────────────────────────────────────────────────────────────── */
.chart-wrap {
    padding: 14px 16px 10px;
}
.donut-wrap {
    display: flex;
    justify-content: center;
}

/* ── Region Bars ────────────────────────────────────────────────────────── */
.region-bars {
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.region-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.region-label {
    font-size: 11px;
    color: var(--text2);
    width: 60px;
    flex-shrink: 0;
}
.region-bar-outer {
    flex: 1;
    height: 6px;
    background: var(--bg3);
    border-radius: 3px;
    overflow: hidden;
}
.region-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent3), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}
.region-count {
    font-size: 11px;
    color: var(--text3);
    width: 28px;
    text-align: right;
    font-family: var(--mono);
}

/* ── Sources mini ───────────────────────────────────────────────────────── */
.sources-mini-list {
    padding: 8px 18px;
}
.source-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.source-mini-row:last-child {
    border-bottom: none;
}
.source-mini-name {
    color: var(--text2);
}
.source-mini-count {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 11px;
}

/* ── Articles Grid ──────────────────────────────────────────────────────── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.article-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition:
        border-color 0.15s,
        transform 0.1s;
}
.article-card:hover {
    border-color: var(--border2);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.article-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.article-source-name {
    font-size: 11px;
    color: var(--text3);
    margin-left: 2px;
}
.article-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}
.article-card-title a {
    color: var(--text);
}
.article-card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}
.article-card-summary {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.6;
}
.article-card-footer {
    margin-top: auto;
}
.article-time {
    font-size: 11px;
    color: var(--text3);
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}
.page-btn {
    padding: 7px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s;
}
.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Sources Page ───────────────────────────────────────────────────────── */
.sources-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}
.sources-nav-chip {
    padding: 5px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text2);
    transition: all 0.15s;
}
.sources-nav-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.sources-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0;
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text2);
}
.empty-icon {
    font-size: 48px;
    color: var(--text3);
    margin-bottom: 16px;
}
.empty-state h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text);
}
.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
}
.btn-crawl-big {
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s;
}
.btn-crawl-big:hover {
    background: #6ba3f9;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.new-items-bar {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    background: #b91c1c;
    color: #fff;
    padding: 10px 16px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 300;
    animation: slideDown 0.2s ease;
}
.new-items-bar.hidden { display: none; }
.new-items-reload {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.new-items-reload:hover { background: rgba(255,255,255,0.35); }
.new-items-dismiss {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}
.new-items-dismiss:hover { color: #fff; }
@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 13px;
    box-shadow: var(--shadow);
    z-index: 999;
    transition: all 0.3s;
    max-width: 320px;
}
.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}
.toast.success {
    border-color: var(--accent3);
    color: var(--accent3);
}
.toast.info {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Sources page: add button + card actions ────────────────────────────── */
.page-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-hero-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}
.page-hero-text p {
    color: var(--text2);
    font-size: 14px;
}

.btn-add-source {
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-add-source:hover {
    background: #6ba3f9;
}

.source-card {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}
.source-card:hover {
    background: var(--bg3);
}
.source-card:hover .source-card-actions {
    opacity: 1;
}
.source-card-header {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
}
.source-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.source-card-badges {
    display: flex;
    gap: 4px;
    align-items: center;
}
.source-url {
    font-size: 10px;
    color: var(--text3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.source-url:hover {
    color: var(--accent);
}
.badge-custom {
    background: rgba(124, 90, 240, 0.15);
    color: var(--accent2);
}

.source-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    margin-top: 2px;
}
.btn-icon {
    padding: 3px 7px;
    background: transparent;
    border: 1px solid var(--border2);
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
    line-height: 1.4;
}
.btn-edit {
    color: var(--accent);
}
.btn-promote {
    color: var(--text1);
}
.btn-edit:hover {
    background: rgba(79, 142, 247, 0.12);
    border-color: var(--accent);
}
.btn-delete {
    color: var(--danger);
}
.btn-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger);
}
.btn-retry {
    color: var(--warning, #f59e0b);
}
.btn-retry:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--warning, #f59e0b);
}
.source-error-msg {
    font-size: 10px;
    color: var(--danger);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.source-card:has(.source-error-msg) .source-card-actions {
    opacity: 1;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}
.modal-backdrop.hidden {
    display: none;
}
.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 12px;
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.18s ease;
}
.modal--sm {
    max-width: 360px;
}
.modal--sm .form-actions {
    padding: 0 24px 24px;
}
.modal-body {
    padding: 0 24px 20px;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}
.modal-header--danger {
    background: #b91c1c;
    border-bottom-color: #991b1b;
    border-radius: 12px 12px 0 0;
}
.modal-header--danger .modal-title {
    color: #fff;
}
.modal-title {
    font-size: 15px;
    font-weight: 700;
}
.delete-modal-msg {
    margin: 0;
    color: var(--text2);
    font-size: 14px;
    word-break: break-word;
    line-height: 1.5;
    padding: 16px 24px 4px;
}
.modal-footer-actions {
    padding: 12px 24px 20px;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    font-family: var(--font);
}
.modal-close:hover {
    color: var(--text);
    background: var(--bg3);
}
.modal-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#addLinkUrl {
    flex: 1;
    min-width: 0;
}
.fetch-status {
    font-size: 13px;
    color: var(--warn, #f59e0b);
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
}
.form-group label .required {
    color: var(--danger);
}
.form-group input {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus {
    border-color: var(--accent);
}
.form-group input::placeholder {
    color: var(--text3);
}
.form-error {
    font-size: 12px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    padding: 8px 12px;
}
.form-error.hidden {
    display: none;
}
.form-notice {
    font-size: 12px;
    color: var(--warn, #f59e0b);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
}
.form-notice.hidden {
    display: none;
}
.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 4px;
}
.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.12s;
}
.btn-secondary:hover {
    background: var(--bg3);
    color: var(--text);
}
.btn-primary {
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s;
}
.btn-primary:hover {
    background: #6ba3f9;
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Breaking News ──────────────────────────────────────────────────────── */
.breaking-section {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}
.breaking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.06);
}
.breaking-badge {
    font-size: 11px;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: breakingPulse 2s ease-in-out infinite;
}
@keyframes breakingPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}
.breaking-sub {
    font-size: 11px;
    color: var(--text3);
}
.breaking-time {
    font-size: 11px;
    color: var(--text3);
    margin-left: auto;
}

.breaking-ticker {
    display: flex;
    flex-direction: column;
}
.breaking-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.08);
    text-decoration: none;
    transition: background 0.12s;
}
.breaking-item:last-child {
    border-bottom: none;
}
.breaking-item:hover {
    background: rgba(239, 68, 68, 0.06);
    text-decoration: none;
}
.breaking-source {
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.breaking-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    line-height: 1.4;
}
.breaking-age {
    font-size: 10px;
    color: var(--text3);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Trend word stats panel ─────────────────────────────────────────────── */
.trend-words-chart-wrap {
    padding: 12px 14px;
    overflow: hidden;
}
.trend-words-chart-wrap canvas {
    cursor: pointer;
}

/* ── Trend clickable hint ───────────────────────────────────────────────── */
.trend-link-icon {
    font-size: 10px;
    color: var(--text3);
    opacity: 0;
    transition: opacity 0.15s;
}
.trend-item:hover .trend-link-icon {
    opacity: 1;
    color: var(--accent);
}

/* ── Stats page ─────────────────────────────────────────────────────────── */
.stats-page-header {
    margin-bottom: 24px;
}
.back-link {
    font-size: 13px;
    color: var(--text3);
    display: inline-block;
    margin-bottom: 16px;
    transition: color 0.15s;
}
.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}
.stats-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}
.stats-term {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}
.stats-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hero-pill {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}
.hero-num {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}
.hero-label {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
.stats-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-legend {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: var(--text3);
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
}

.src-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 8px;
}
.src-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent3), var(--accent));
    border-radius: 2px;
}

.daily-table-wrap {
    overflow-x: auto;
}
.daily-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.daily-table th {
    padding: 8px 14px;
    text-align: left;
    color: var(--text3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}
.daily-table td {
    padding: 7px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text2);
}
.daily-table tr:last-child td {
    border-bottom: none;
}
.daily-table tr:hover td {
    background: var(--bg3);
}
.peak-row td {
    color: var(--text);
}
.peak-badge {
    font-size: 9px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--warn);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 5px;
    font-weight: 600;
    vertical-align: middle;
}

.recent-articles-list {
    padding: 4px 0;
}
.recent-article-row {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.1s;
}
.recent-article-row:last-child {
    border-bottom: none;
}
.recent-article-row:hover {
    background: var(--bg3);
}
.recent-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.recent-article-date {
    font-size: 11px;
    color: var(--text3);
}
.recent-article-title {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.5;
}
.recent-article-title:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ── Filter-out terms ───────────────────────────────────────────────────── */
.btn-filter-out {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 4px;
    color: var(--text3);
    font-size: 10px;
    padding: 2px 7px;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transition:
        opacity 0.15s,
        color 0.15s,
        border-color 0.15s;
    margin-left: 6px;
}
.trend-item:hover .btn-filter-out {
    opacity: 1;
}
.btn-filter-out:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.show-more-wrap {
    padding: 12px 16px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}
.btn-show-more {
    background: none;
    border: 1px solid var(--border);
    color: var(--accent);
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s;
}
.btn-show-more:hover {
    background: var(--bg3);
    border-color: var(--accent);
}

.filtered-count {
    font-size: 11px;
    color: var(--text3);
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 9px;
    margin-left: auto;
}
.filtered-count:hover {
    color: var(--text2);
    border-color: var(--border2);
}

.filtered-panel {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg3);
}
.filtered-panel-title {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.filtered-remove-all {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 4px;
    color: var(--danger);
    font-size: 10px;
    padding: 2px 8px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}
.filtered-remove-all:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}
.filtered-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filtered-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text2);
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 3px 10px;
}
.filtered-tag-remove {
    background: none;
    border: none;
    color: var(--accent3);
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    line-height: 1;
}
.filtered-tag-remove:hover {
    color: var(--text);
}

/* ── Settings bar ───────────────────────────────────────────────────────── */
.settings-bar {
    margin-bottom: 18px;
    padding: 14px 20px;
}
.settings-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.settings-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    white-space: nowrap;
}
.settings-interval-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-interval-input {
    width: 72px;
    padding: 6px 10px;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--mono);
    text-align: center;
}
.settings-interval-input:focus {
    outline: none;
    border-color: var(--accent);
}
.settings-unit {
    font-size: 13px;
    color: var(--text3);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}
.settings-hint {
    font-size: 12px;
    color: var(--text3);
}

/* ── Breaking News nav ──────────────────────────────────────────────────── */
.nav-breaking {
    color: #ef4444 !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.nav-breaking:hover,
.nav-breaking.active {
    color: #ff6b6b !important;
}

/* ── Breaking News page ─────────────────────────────────────────────────── */
.breaking-pill .stat-num {
    color: #ef4444;
}

.breaking-page-hero {
    padding: 28px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.breaking-page-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.breaking-badge-lg {
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-weight: 700;
    letter-spacing: 0.08em;
    border: 1px solid rgba(239, 68, 68, 0.3);
    text-transform: uppercase;
}
.breaking-page-sub {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.breaking-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ── Breaking cards grid ─────────────────────────────────────────────────── */
.breaking-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.breaking-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition:
        border-color 0.15s,
        transform 0.1s,
        box-shadow 0.15s;
}
.breaking-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.breaking-card-hot {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, var(--bg2), rgba(239, 68, 68, 0.05));
}
.breaking-card-hot:hover {
    border-color: rgba(239, 68, 68, 0.6);
}

.breaking-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breaking-source-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 4px;
}
.breaking-card-age {
    font-size: 10px;
    color: var(--text3);
    margin-left: auto;
}

.breaking-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    display: block;
}
.breaking-card-title:hover {
    color: var(--accent);
    text-decoration: none;
}

.breaking-card-summary {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.55;
    flex: 1;
}

.breaking-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.breaking-score-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}
.score-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    opacity: 0.7;
}
.breaking-read-more {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.03em;
}
.breaking-read-more:hover {
    color: #fff;
    text-decoration: none;
}

.btn-inline {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

@media (max-width: 700px) {
    .breaking-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.mono {
    font-family: var(--mono);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px;
}

/* ── Dashboard page ─────────────────────────────────────────────────────── */
.dashboard-page-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 20px 0 8px;
    flex-wrap: wrap;
}
.dashboard-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fg);
}
.dashboard-page-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-sel-sm {
    background: var(--surface2);
    border: 1px solid var(--border2);
    color: var(--fg);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
}

/* Range picker */
.range-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 10px;
}
.range-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.range-btn {
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--muted);
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.range-btn:hover {
    background: var(--surface2);
    color: var(--fg);
}
.range-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.range-day-form {
    display: flex;
    align-items: center;
    gap: 6px;
}
.range-form-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}
.range-custom-form {
    display: flex;
    align-items: center;
    gap: 6px;
}
.range-custom-input {
    width: 72px;
    padding: 4px 8px;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--fg);
    border-radius: 6px;
}
.range-go-btn {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--fg);
    cursor: pointer;
}
.range-go-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.range-active-label {
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
    white-space: nowrap;
    font-family: var(--mono);
}

/* KPI row */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.kpi-card {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
}
.kpi-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.kpi-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.kpi-sub {
    font-size: 10px;
    color: var(--muted2, #64748b);
    margin-top: 2px;
}

/* Grid layouts */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.dash-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 900px) {
    .dash-grid-2,
    .dash-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Leaderboard */
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px 0;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}
.lb-rank {
    width: 28px;
    text-align: right;
    color: var(--muted);
    font-size: 11px;
}
.lb-name {
    width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fg);
}
.lb-link {
    color: var(--accent);
    text-decoration: none;
}
.lb-link:hover {
    text-decoration: underline;
}
.lb-bar-outer {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.lb-bar-inner {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}
.lb-count {
    width: 72px;
    text-align: right;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

/* Stat callout cards */
.stat-callout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    gap: 4px;
}
.callout-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.callout-value {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text1);
}
.callout-value.up   { color: #3ecf8e; }
.callout-value.down { color: #ef4444; }
.callout-sub {
    font-size: 12px;
    color: var(--text3);
}

/* Panel sub-label */
.panel-sub {
    font-size: 11px;
    color: var(--muted);
    margin-left: 8px;
}

/* Silent sources */
.silent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}
.silent-tag {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--muted);
}
.silent-region {
    color: var(--muted2, #64748b);
    font-size: 10px;
}
.silent-more {
    font-size: 11px;
    color: var(--muted);
    padding: 3px 6px;
}
.muted-note {
    color: var(--muted);
    font-size: 12px;
    padding: 8px 0;
}

/* Top per category grid */
.top-per-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 4px 0;
}
.tpc-card {
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 12px;
}
.tpc-cat {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 4px;
}
.tpc-term {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}
.tpc-term:hover {
    text-decoration: underline;
}
.tpc-score {
    font-size: 11px;
    color: var(--muted);
}

/* Heatmaps */
.heatmap-wrap {
    overflow-x: auto;
}
.heatmap-table {
    border-collapse: collapse;
    font-size: 11px;
    width: 100%;
}
.heatmap-table th {
    padding: 3px 5px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
}
.hm-label {
    padding: 3px 8px 3px 2px;
    color: var(--fg);
    white-space: nowrap;
    text-align: right;
    font-weight: 500;
    min-width: 70px;
}
.hm-cell {
    padding: 3px 4px;
    text-align: center;
    min-width: 24px;
    border-radius: 2px;
    cursor: default;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
}
.hm-small .hm-cell {
    min-width: 18px;
    padding: 2px 2px;
}
.hm-small th {
    padding: 2px 3px;
    font-size: 10px;
}

/* Full table */
.table-scroll {
    overflow-x: auto;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.stats-table th {
    text-align: left;
    padding: 6px 10px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border2);
    white-space: nowrap;
}
.stats-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
}
.stats-table tr:last-child td {
    border-bottom: none;
}
.td-source {
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text3);
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow);
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 6px;
}
.login-logo .logo-icon {
    font-size: 24px;
    color: var(--accent);
}
.login-logo .logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.login-subtitle {
    font-size: 12px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 24px;
}
.login-desc {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 28px;
    line-height: 1.5;
}
.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.15s, background 0.15s;
    width: 100%;
    justify-content: center;
}
.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    text-decoration: none;
}
.google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Header user widget ──────────────────────────────────────────────────── */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border2);
}
.user-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-name {
    font-size: 13px;
    color: var(--text2);
    white-space: nowrap;
}
.badge-admin {
    display: inline-block;
    width: 52px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(79, 142, 247, 0.15);
    color: var(--accent);
    border: 1px solid rgba(79, 142, 247, 0.3);
    border-radius: 4px;
    padding: 1px 0;
    box-sizing: border-box;
}
.btn-logout {
    background: none;
    border: 1px solid var(--border2);
    color: var(--text2);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.nav-admin {
    color: var(--accent);
}

/* ── Generic confirm modal ───────────────────────────────────────────────── */
.confirm-modal {
    text-align: center;
    max-width: 380px;
    padding: 32px 28px;
}
.confirm-modal-icon {
    font-size: 32px;
    margin-bottom: 12px;
    line-height: 1;
}
.confirm-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.confirm-modal-body {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.55;
    margin-bottom: 24px;
}

/* ── Login error banner ──────────────────────────────────────────────────── */
.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
    line-height: 1.5;
}

/* ── Admin sub-tabs ──────────────────────────────────────────────────────── */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    position: relative;
    bottom: -1px;
}
.admin-tab:hover {
    color: var(--text);
    text-decoration: none;
}
.admin-tab.active {
    background: var(--bg2);
    border-color: var(--border);
    border-bottom-color: var(--bg2);
    color: var(--text);
}
.admin-tab-icon {
    font-size: 13px;
}
.tab-actions-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ── Users table ─────────────────────────────────────────────────────────── */
.users-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.users-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text3);
}
.users-updated-at {
    font-size: 11px;
    color: var(--text3);
}
.users-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.users-panel {
    overflow-x: auto;
}
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.users-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.users-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.users-table tbody tr:last-child td {
    border-bottom: none;
}
.users-table tbody tr:hover td {
    background: var(--bg3);
}
.user-row.user-banned td {
    opacity: 0.6;
}
.user-cell-identity-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.user-avatar-sm {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}
.user-name-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-display-name {
    font-weight: 500;
    color: var(--text);
}
.badge-admin-sm {
    font-size: 9px;
    padding: 1px 5px;
}
.user-email {
    color: var(--text2);
    font-size: 12px;
}
.user-signin-count {
    color: var(--text2);
    text-align: center;
}
.user-date {
    font-size: 12px;
    color: var(--text2);
    white-space: nowrap;
}
.user-time {
    font-size: 11px;
    color: var(--text3);
}
.user-actions {
    white-space: nowrap;
}
.user-actions-inner {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}
.status-online {
    background: rgba(62, 207, 142, 0.12);
    color: var(--accent3);
    border: 1px solid rgba(62, 207, 142, 0.3);
}
.status-offline {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text3);
    border: 1px solid rgba(100, 116, 139, 0.2);
}
.status-banned {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Ban row */
.user-ban-reason-row td {
    background: rgba(239, 68, 68, 0.05);
    border-top: none;
}
.user-ban-reason {
    font-size: 12px;
    color: var(--text3);
    padding-top: 4px !important;
    padding-bottom: 10px !important;
}
.ban-reason-label {
    font-weight: 600;
    color: #fca5a5;
}

/* Self badge */
.self-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text3);
    border: 1px solid var(--border2);
    border-radius: 4px;
    padding: 2px 7px;
}

.admin-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7c5af0;
    border: 1px solid #7c5af0;
    border-radius: 4px;
    padding: 1px 5px;
    vertical-align: middle;
    margin-left: 4px;
}
.super-admin-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e8a020;
    border: 1px solid #e8a020;
    border-radius: 4px;
    padding: 1px 5px;
    vertical-align: middle;
    margin-left: 4px;
}
.super-admin-protected {
    color: var(--text-muted, #aaa);
    font-size: 13px;
}

/* Danger button */
.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Ban modal name */
.ban-modal-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* ── Error / 403 page ────────────────────────────────────────────────────── */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 16px;
    padding: 40px 24px;
}
.error-icon {
    font-size: 48px;
}
.error-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}
.error-message {
    font-size: 16px;
    color: var(--text2);
    max-width: 400px;
}
.error-hint {
    font-size: 13px;
    color: var(--text3);
    max-width: 400px;
}

/* ── Crawl monitor tab ──────────────────────────────────────────────────── */
.crawl-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.crawl-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.crawl-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.crawl-live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text2);
}
.crawl-panel {
    padding: 0;
    overflow: hidden;
}
.crawl-filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.crawl-filter-option {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    user-select: none;
}
.crawl-filter-sep {
    color: var(--border2);
}
.crawl-search-input {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    padding: 4px 10px;
    width: 200px;
    outline: none;
}
.crawl-search-input:focus {
    border-color: var(--accent);
}
.dot { font-size: 12px; }
.dot-fetching { color: var(--accent); }
.dot-done     { color: var(--accent3); }
.dot-error    { color: var(--danger); }
.dot-pending  { color: var(--text3); }

.crawl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.crawl-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text3);
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    position: sticky;
    top: 0;
    z-index: 1;
}
.crawl-row td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.crawl-row:last-child td { border-bottom: none; }
.crawl-row-fetching { background: rgba(79,142,247,.04); }
.crawl-row-error    { background: rgba(239,68,68,.04); }

.crawl-source-name { font-weight: 500; color: var(--text); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crawl-url         { color: var(--text3); max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.crawl-url-link    { color: var(--text3); text-decoration: none; }
.crawl-url-link:hover { color: var(--accent); text-decoration: underline; }
.crawl-count       { color: var(--text2); text-align: right; width: 70px; }
.crawl-time        { color: var(--text3); font-size: 12px; white-space: nowrap; }
.crawl-error-cell  { max-width: 300px; }
.crawl-error-text  { color: var(--danger); font-size: 12px; word-break: break-all; }

.cs-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.cs-fetching { background: rgba(79,142,247,.15); color: var(--accent); }
.cs-done     { background: rgba(62,207,142,.15); color: var(--accent3); }
.cs-error    { background: rgba(239,68,68,.15);  color: var(--danger); }
.cs-pending  { background: rgba(100,116,139,.12); color: var(--text3); }

/* ── Link Cards Grid ─────────────────────────────────────────────────────────── */
.link-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.link-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.link-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.link-card-thumb-wrap {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg3);
    flex-shrink: 0;
}
.link-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.link-card:hover .link-card-thumb {
    transform: scale(1.03);
}

.link-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.link-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.link-favicon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    object-fit: contain;
}
.link-site-name {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.link-pub-date {
    font-size: 11px;
    color: var(--text3);
}

.link-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    margin: 0;
}
.link-card-title a {
    color: var(--text);
}
.link-card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.link-card-desc {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.6;
    margin: 0;
}

.link-card-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.link-label-chip-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.link-label-chip {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px 0 0 20px;
    background: rgba(124, 90, 240, 0.12);
    color: var(--accent2);
    border: 1px solid rgba(124, 90, 240, 0.2);
    border-right: none;
    text-decoration: none;
    transition: background 0.12s;
}
.link-label-chip-wrap:not(:has(.label-chip-remove)) .link-label-chip {
    border-radius: 20px;
    border-right: 1px solid rgba(124, 90, 240, 0.2);
}
.link-label-chip:hover {
    background: rgba(124, 90, 240, 0.22);
    text-decoration: none;
}
.label-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    padding: 0 5px;
    height: 100%;
    min-height: 20px;
    border-radius: 0 20px 20px 0;
    background: rgba(124, 90, 240, 0.12);
    color: var(--accent2);
    border: 1px solid rgba(124, 90, 240, 0.2);
    border-left: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.12s, background 0.12s;
}
.label-chip-remove:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}
.label-add-btn {
    font-size: 14px;
    line-height: 1;
    padding: 1px 6px;
    border-radius: 20px;
    color: var(--text3);
    background: transparent;
    border: 1px dashed var(--border);
    opacity: 0.7;
    transition: opacity 0.12s, color 0.12s;
}
.label-add-btn:hover {
    opacity: 1;
    color: var(--accent2);
    border-color: var(--accent2);
    background: rgba(124, 90, 240, 0.08);
}
.label-add-popover {
    position: fixed;
    z-index: 9999;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.label-add-input {
    width: 100%;
    padding: 5px 10px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text1);
    outline: none;
}
.label-add-input:focus {
    border-color: var(--accent2);
}
.label-add-suggestions {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.label-suggestion {
    padding: 5px 8px;
    font-size: 12px;
    color: var(--text2);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.1s;
}
.label-suggestion:hover {
    background: rgba(124, 90, 240, 0.12);
    color: var(--accent2);
}

.link-card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.link-card-author {
    font-size: 11px;
    color: var(--text3);
    display: flex;
    gap: 4px;
    align-items: center;
}
.link-author-name {
    font-weight: 600;
    color: var(--text2);
    text-decoration: none;
}
.link-author-name:hover {
    color: var(--accent);
    text-decoration: none;
}
.link-time {
    color: var(--text3);
}

/* ── Labels autocomplete ─────────────────────────────────────────────────────── */
.label-autocomplete-wrap {
    position: relative;
}
.label-autocomplete-wrap input {
    width: 100%;
}
.label-ac-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    z-index: 200;
    overflow: hidden;
    max-height: 220px;
    overflow-y: auto;
}
.label-ac-option {
    padding: 7px 11px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    transition: background 0.1s;
}
.label-ac-option:hover,
.label-ac-option--active {
    background: rgba(124, 90, 240, 0.12);
    color: var(--accent2);
}

/* ── Label suggestions ───────────────────────────────────────────────────────── */
.label-suggest-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.label-suggest-chip {
    padding: 3px 9px;
    font-size: 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(124, 90, 240, 0.08);
    color: var(--accent2);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.label-suggest-chip:hover {
    background: rgba(124, 90, 240, 0.2);
}
.label-suggest-chip--used {
    opacity: 0.35;
    pointer-events: none;
}

/* ── Add Link modal preview ──────────────────────────────────────────────────── */
.manual-entry-wrap {
    background: rgba(185, 28, 28, 0.08);
    border: 1px solid rgba(185, 28, 28, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.manual-entry-notice {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}
.manual-open-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.manual-open-link:hover { text-decoration: underline; }
.manual-entry-wrap .form-group { margin: 0; }
.manual-entry-wrap input,
.manual-entry-wrap textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
}
.manual-entry-wrap input:focus,
.manual-entry-wrap textarea:focus { border-color: var(--accent); }

.link-preview-wrap {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: 12px;
    padding: 10px;
}
.link-preview-wrap.hidden {
    display: none;
}
.preview-thumb {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: var(--bg2);
}
.preview-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.preview-site {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-desc {
    font-size: 11px;
    color: var(--text2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ── form-group input / select shared ───────────────────────────────────────── */
.form-group select,
.form-group textarea {
    background: var(--bg3);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

@media (max-width: 640px) {
    .link-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Link feed wrapper — mode variants ───────────────────────────────────────── */
.link-feed {
    margin-bottom: 24px;
}

/* Grid mode: reuse existing .link-cards-grid layout */
.link-feed--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
@media (max-width: 640px) {
    .link-feed--grid { grid-template-columns: 1fr; }
}

/* List mode */
.link-feed--list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-item--list {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    gap: 14px;
    padding: 14px;
    transition: border-color 0.15s, transform 0.1s;
}
.link-item--list:hover {
    border-color: var(--border2);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.link-list-thumb-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg3);
}
.link-list-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.link-list-favicon-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg3);
    border-radius: 6px;
    align-self: flex-start;
}
.link-favicon-lg {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.link-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
@media (max-width: 540px) {
    .link-item--list { flex-direction: column; }
    .link-list-thumb-wrap { width: 100%; height: 160px; }
}

/* Compact mode */
.link-feed--compact {
    display: flex;
    flex-direction: column;
}

.link-item--compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    flex-wrap: wrap;
}
.link-item--compact:last-child { border-bottom: none; }
.link-item--compact:hover { background: var(--bg3); }

.link-item-compact-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.link-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}
.link-item-title:hover { color: var(--accent); text-decoration: none; }
.link-item-snippet {
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-item-cat { flex-shrink: 0; }

.link-item-meta {
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Display toggle (in stats bar) ──────────────────────────────────────────── */
.display-toggle {
    display: flex;
    gap: 2px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
}
.dtoggle-btn {
    background: none;
    border: none;
    color: var(--text3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    line-height: 1;
}
.dtoggle-btn:hover { color: var(--text2); }
.dtoggle-btn.active {
    background: var(--accent);
    color: #fff;
}

/* ── Pagination nav ──────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 24px 0 8px;
    align-items: center;
}
.page-ellipsis {
    padding: 7px 4px;
    color: var(--text3);
    font-size: 13px;
}

/* ── Infinite scroll loader ──────────────────────────────────────────────────── */
.infinite-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--text3);
    font-size: 13px;
}
.infinite-loader.hidden { display: none; }
.loader-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Settings page ───────────────────────────────────────────────────────────── */
.settings-page {
    max-width: 720px;
}
.settings-section {
    margin-bottom: 16px;
}
.settings-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
}
.settings-options-grid--small {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
}
.settings-option-card {
    background: var(--bg3);
    border: 2px solid var(--border2);
    border-radius: 10px;
    padding: 16px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
}
.settings-option-card:hover {
    border-color: var(--accent);
    background: var(--bg2);
}
.settings-option-card.selected {
    border-color: var(--accent);
    background: rgba(79, 142, 247, 0.08);
}
.option-icon {
    font-size: 22px;
    color: var(--text2);
    line-height: 1;
}
.settings-option-card.selected .option-icon { color: var(--accent); }
.option-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.option-desc {
    font-size: 11px;
    color: var(--text3);
    line-height: 1.5;
}
.settings-row {
    padding: 0 16px 16px;
}

/* ── Fetch issue badge ───────────────────────────────────────────────────── */
.fetch-issue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 9px;
    background: #b91c1c;
    color: #fff;
}
.nav-admin { position: relative; }

/* ── Admin tab cursor ────────────────────────────────────────────────────── */
.admin-tab { cursor: pointer; background: transparent; }

/* ── Fetch Issues table cells ────────────────────────────────────────────── */
.fi-link-cell { max-width: 420px; }
.fi-link-title {
    display: block;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fi-link-title:hover { color: var(--accent); }
.fi-link-url {
    display: block;
    font-size: 11px;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}
.fi-actions { display: flex; gap: 6px; align-items: center; }
.fi-refetch-btn, .fi-delete-btn { font-size: 12px; padding: 4px 12px; }
.fetch-issues-panel { overflow-x: auto; }

/* ── Pending users section ───────────────────────────────────────────────── */
.pending-users-section {
    border-bottom: 2px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.04);
    margin-bottom: 0;
}
.pending-users-header {
    padding: 10px 20px 8px;
}
.pending-users-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--warn);
}

/* ── Pending approval page ───────────────────────────────────────────────── */
.pending-card {
    max-width: 400px;
    text-align: center;
}
.pending-icon {
    font-size: 40px;
    margin: 16px 0 8px;
}
.pending-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.pending-desc {
    font-size: 14px;
    color: var(--text2);
    line-height: 1.6;
    margin-bottom: 20px;
}
.pending-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text3);
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}
.link-card-actions { display: flex; gap: 4px; align-items: center; }
.btn-edit { color: var(--accent); }
.btn-edit:hover { color: #fff; background: var(--accent); }
.about-body { padding: 0 2px 8px; }
.about-body p { color: var(--text2); font-size: 14px; line-height: 1.7; margin: 0 0 12px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body ul { color: var(--text2); font-size: 14px; line-height: 1.7; margin: 0 0 12px; padding-left: 20px; }
.about-body li { margin-bottom: 6px; }
.about-body strong { color: var(--text1); }

/* ── Help page ──────────────────────────────────────────────────────────── */
.help-page { max-width: 1100px; margin: 0 auto; padding-bottom: 40px; }
.help-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 36px 0 32px;
}
.help-hero-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 16px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(79,142,247,0.25);
}
.help-hero-title { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.help-hero-sub { font-size: 15px; color: var(--text2); }
.help-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.help-card--wide { grid-column: 1 / -1; }
.help-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.15s;
}
.help-card:hover { border-color: var(--border2); }
.help-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.help-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.help-card p {
    color: var(--text2);
    font-size: 13.5px;
    line-height: 1.7;
    margin: 0;
}
.help-card ul {
    color: var(--text2);
    font-size: 13.5px;
    line-height: 1.7;
    margin: 0;
    padding-left: 18px;
}
.help-card li { margin-bottom: 5px; }
.help-card li:last-child { margin-bottom: 0; }
.help-card strong { color: var(--text); }
@media (max-width: 640px) {
    .help-grid { grid-template-columns: 1fr; }
    .help-card--wide { grid-column: unset; }
}
.btn-star { color: var(--text3); font-size: 15px; line-height: 1; }
.btn-star:hover { color: #f59e0b; background: rgba(245,158,11,0.12); }
.btn-star--on { color: #f59e0b; }
.btn-star--on:hover { color: #d97706; background: rgba(245,158,11,0.18); }

.important-star { transition: color 0.2s; }
.important-star--unseen { color: #ef4444; animation: important-pulse 2s ease-in-out infinite; }
@keyframes important-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.fetch-error-wrap {
    background: rgba(185, 28, 28, 0.1);
    border: 1px solid rgba(185, 28, 28, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #fca5a5;
    line-height: 1.5;
    word-break: break-all;
}

/* ── Notifications ─────────────────────────────────────────────────────────── */
.notif-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text2);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.notif-bell-btn:hover { background: var(--bg3, var(--bg2)); color: var(--text1); border-color: var(--accent2); }
.notif-bell-btn svg { display: block; }
.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}
.notif-panel-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}
.notif-panel {
    position: fixed;
    top: 56px;
    right: 16px;
    z-index: 1000;
    width: 340px;
    max-height: 480px;
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    overflow: hidden;
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-panel-title { font-size: 14px; font-weight: 600; color: var(--text1); }
.notif-clear-all {
    margin-left: auto; margin-right: 8px;
    background: none; border: none; cursor: pointer;
    color: var(--text3); font-size: 12px; padding: 2px 6px; border-radius: 4px;
    transition: color 0.12s;
}
.notif-clear-all:hover { color: var(--accent); }
.notif-clear-all:disabled { opacity: 0.5; cursor: default; }
.notif-panel-close {
    background: none; border: none; cursor: pointer;
    color: var(--text3); font-size: 14px; padding: 2px 5px; border-radius: 4px;
    transition: color 0.12s;
}
.notif-panel-close:hover { color: var(--text1); }
.notif-panel-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-search-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text1);
    outline: none;
    font-family: var(--font);
}
.notif-search-input:focus { border-color: var(--accent2); }
.notif-panel-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: 320px;
    padding: 8px 0;
}
.notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text3);
    font-size: 13px;
}
.notif-item {
    position: relative;
    padding: 12px 40px 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s, opacity 0.2s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item-body {
    font-size: 13px;
    color: var(--text1);
    line-height: 1.5;
    word-break: break-word;
}
.notif-item-meta {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}
.notif-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}
.notif-link:hover { color: #6ba3f9; }
.notif-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 11px;
    padding: 3px 5px;
    border-radius: 4px;
    transition: color 0.12s, background 0.12s;
}
.notif-dismiss:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
@media (max-width: 480px) {
    .notif-panel { right: 8px; left: 8px; width: auto; }
}

/* ── Hamburger button ────────────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}
.hamburger span {
    display: block;
    height: 2px;
    background: var(--text2);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile breakpoints ──────────────────────────────────────────────────── */

/* Tablet & below: tighten content padding */
@media (max-width: 900px) {
    .main-content { padding: 16px; }
}

/* Tablet header: tighter padding */
@media (max-width: 900px) {
    .header-inner { padding: 0 16px; gap: 12px; }
}

/* Phablet & below: hamburger nav */
@media (max-width: 700px) {
    .hamburger { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg2);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
        z-index: 99;
        flex: unset;
    }
    .main-nav.open { display: flex; }
    .nav-link {
        padding: 12px 20px;
        border-radius: 0;
        font-size: 14px;
    }

    /* Header layout: logo | status | hamburger, nothing else */
    .header-inner { flex-wrap: nowrap; overflow: hidden; }
    .header-status {
        margin-left: auto;
        order: 2;
        gap: 6px;
        flex-shrink: 0;
    }
    .hamburger { order: 3; margin-left: 6px; }

    /* Hide things that eat width on mobile */
    .user-name { display: none; }
    .badge-admin { display: none; }
    .btn-logout { display: none; }
    .crawl-status { display: none; }
    /* Shrink add link button text */
    .btn-crawl { font-size: 11px; padding: 5px 10px; white-space: nowrap; }
}

/* Small mobile */
@media (max-width: 480px) {
    .main-content { padding: 12px; }
    .header-inner { padding: 0 12px; height: 52px; }

    /* Controls bar: stack vertically */
    .controls-bar { padding: 12px; gap: 12px; }
    .filters-form { flex-direction: column; gap: 10px; }
    .filter-group select,
    .filter-group .search-input,
    .searchable-select,
    .searchable-select-input { width: 100%; min-width: 0; }
    .search-group { min-width: 0; }

    /* Stats bar: hide display toggle, keep stat pill */
    .stats-bar { gap: 6px; }
    .display-toggle { display: none; }

    /* Force grid layout regardless of saved preference */
    .link-feed--list,
    .link-feed--compact {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    /* Render list/compact items as grid cards */
    .link-item--list,
    .link-item--compact {
        background: var(--bg2);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        flex-direction: column;
        padding: 14px 16px;
        gap: 8px;
        border-bottom: 1px solid var(--border);
        flex-wrap: nowrap;
        white-space: normal;
    }
    .link-item--list:hover,
    .link-item--compact:hover {
        border-color: var(--border2);
        box-shadow: var(--shadow);
        background: var(--bg2);
    }
    /* Make the thumbnail full-width in list items */
    .link-list-thumb-wrap { width: 100%; height: 160px; border-radius: 6px; }
    /* Show full title and snippet in compact */
    .link-item-title { white-space: normal; overflow: visible; text-overflow: unset; font-size: 14px; font-weight: 600; }
    .link-item-snippet { white-space: normal; overflow: visible; text-overflow: unset; font-size: 12px; }

    /* Modal */
    .modal-backdrop { padding: 16px; }
    .modal { max-height: calc(100vh - 32px); }
    .modal-form { padding: 14px; gap: 12px; }
    .modal-header { padding: 12px 14px; }
    .modal-body { padding: 0 14px 14px; }
    .form-row { grid-template-columns: 1fr; }
    .modal-footer-actions { padding: 8px 14px 14px; }
    .delete-modal-msg { padding: 12px 14px 4px; }
    .modal--sm .form-actions { padding: 0 14px 16px; }
    .form-actions .btn-primary,
    .form-actions .btn-secondary,
    .form-actions .btn-danger { flex: 1; text-align: center; }

    /* Login card */
    .login-card { padding: 32px 20px; }

    /* Toast */
    .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }

    /* Admin tabs: allow horizontal scroll */
    .admin-tabs { overflow-x: auto; padding-bottom: 0; flex-wrap: nowrap; }
    .admin-tab { padding: 8px 12px; font-size: 13px; white-space: nowrap; }

    /* Page hero: stack */
    .page-hero { flex-direction: column; gap: 12px; }

    /* Breaking section */
    .breaking-header { flex-wrap: wrap; gap: 6px; }

    /* Shrink add link button further */
    .btn-crawl { font-size: 10px; padding: 4px 8px; }

    /* Leaderboard name: shrink */
    .lb-name { width: 120px; }

    /* Compact items: allow text to wrap */
    .link-item--compact { gap: 6px; }
    .link-item-meta { font-size: 10px; }

    /* Help hero: stack */
    .help-hero { flex-direction: column; gap: 12px; padding: 20px 0 16px; }

    /* Settings options */
    .settings-options-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 12px; }

    /* Pagination: smaller buttons */
    .page-btn { padding: 6px 8px; font-size: 12px; }

    /* Trends panel */
    .trend-term { font-size: 13px; }
}

/* Extra small (< 360px) */
@media (max-width: 360px) {
    .header-inner { padding: 0 8px; }
    .logo-text { font-size: 14px; }
    .main-content { padding: 8px; }
}

/* ── Audit log ──────────────────────────────────────────────────────────────── */
.audit-filter-select {
    background: var(--bg2, #111);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text1);
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
}
.audit-action-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg3, #1a1a1a);
    color: var(--text2);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.audit-action-badge.audit-action--danger {
    background: rgba(220, 38, 38, 0.12);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.25);
}
.audit-action-badge.audit-action--info {
    background: rgba(79, 142, 247, 0.12);
    color: #7db3fa;
    border-color: rgba(79, 142, 247, 0.25);
}
