:root,
[data-theme="dark"] {
    --bg: #0a0e17;
    --bg-elevated: #111827;
    --bg-card: #151d2e;
    --bg-hover: #1a2438;
    --border: #1e2d45;
    --border-light: #2a3f5f;
    --text: #e8edf5;
    --text-muted: #8b9cb8;
    --text-dim: #5a6d8a;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --critical: #ef4444;
    --critical-bg: rgba(239, 68, 68, 0.12);
    --high: #f97316;
    --high-bg: rgba(249, 115, 22, 0.12);
    --medium: #eab308;
    --medium-bg: rgba(234, 179, 8, 0.12);
    --low: #22c55e;
    --low-bg: rgba(34, 197, 94, 0.12);
    --kev: #a855f7;
    --kev-bg: rgba(168, 85, 247, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font: 'DM Sans', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --gradient-1: rgba(59, 130, 246, 0.12);
    --gradient-2: rgba(168, 85, 247, 0.06);
    --modal-backdrop: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
    --bg: #f0f4f9;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #e8eef6;
    --border: #d4dce8;
    --border-light: #b8c5d8;
    --text: #1a2332;
    --text-muted: #4a5d78;
    --text-dim: #6b7d96;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --critical: #dc2626;
    --critical-bg: rgba(220, 38, 38, 0.08);
    --high: #ea580c;
    --high-bg: rgba(234, 88, 12, 0.08);
    --medium: #ca8a04;
    --medium-bg: rgba(202, 138, 4, 0.08);
    --low: #16a34a;
    --low-bg: rgba(22, 163, 74, 0.08);
    --kev: #9333ea;
    --kev-bg: rgba(147, 51, 234, 0.08);
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --gradient-1: rgba(37, 99, 235, 0.06);
    --gradient-2: rgba(147, 51, 234, 0.04);
    --modal-backdrop: rgba(15, 23, 42, 0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--gradient-1), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, var(--gradient-2), transparent);
    pointer-events: none;
    z-index: 0;
}

.app { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 0 24px 48px; }

/* Header */
.header { padding: 32px 0 24px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand-icon {
    width: 48px; height: 48px;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
    font-size: 1.25rem;
}
.brand h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.subtitle .fa-sm { font-size: 0.75rem; opacity: 0.7; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 500;
    text-decoration: none; border: none; cursor: pointer;
    transition: all 0.15s ease;
}
.btn-ghost {
    background: var(--bg-card); color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }
.btn-ghost.is-active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.brand-link { text-decoration: none; color: inherit; }
.brand-link:hover h1 { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.header-actions .btn,
.header-actions .live-indicator {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    box-sizing: border-box;
}

.header-actions #theme-toggle {
    width: 40px;
    padding: 0;
    justify-content: center;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--low);
    background: var(--low-bg);
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--low);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: live-pulse 2s ease infinite;
}
.live-indicator.live-paused { color: var(--text-dim); background: var(--bg-card); border-color: var(--border); }
.live-indicator.live-paused .live-dot { background: var(--text-dim); animation: none; box-shadow: none; }

@keyframes live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.new-items-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--accent-glow);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    animation: banner-in 0.25s ease;
}
.new-items-banner i.fa-bell { color: var(--accent); }
.new-items-banner span { flex: 1; }
.new-items-banner .btn-sm {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 500;
}
.new-items-banner .btn-sm:hover { filter: brightness(1.1); }
.new-items-banner .btn-ghost {
    padding: 6px 10px;
    min-width: auto;
}

.sync-error-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 24px 20px;
    padding: 12px 14px;
    background: var(--high-bg);
    border: 1px solid color-mix(in srgb, var(--high) 35%, transparent);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    animation: banner-in 0.25s ease;
}

.sync-error-banner i.fa-triangle-exclamation {
    color: var(--high);
    margin-top: 2px;
    flex-shrink: 0;
}

.sync-error-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sync-error-copy strong {
    font-size: 0.875rem;
}

.sync-error-copy span {
    color: var(--text-muted);
    font-size: 0.8125rem;
    word-break: break-word;
}

.sync-error-banner .btn-ghost {
    flex-shrink: 0;
    padding: 6px 10px;
    min-width: auto;
}

@keyframes banner-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}

.cve-card-new {
    animation: card-in 0.4s ease;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow);
}

/* Stats */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px 14px;
    position: relative;
    overflow: hidden;
}
.stat-sparkline {
    display: block;
    width: 72px;
    height: 28px;
    margin-bottom: 6px;
    opacity: 0.85;
}
.stat-icon {
    position: absolute;
    top: 14px; right: 16px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.875rem;
}
.stat-icon.critical { color: var(--critical); background: var(--critical-bg); }
.stat-icon.kev { color: var(--kev); background: var(--kev-bg); }
.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.02em;
}
.stat-value.critical { color: var(--critical); }
.stat-value.kev { color: var(--kev); }
.stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* Chart */
.chart-section {
    margin-bottom: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px 16px;
}
.chart-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.chart-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-header h2 i { color: var(--accent); font-size: 0.9375rem; }
.chart-subtitle { font-size: 0.8125rem; color: var(--text-dim); }
.chart-wrap {
    position: relative;
    height: 260px;
}
.chart-section-tall .chart-wrap { height: 340px; }

/* Stats page */
.stats-group { margin-bottom: 28px; }
.stats-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.stats-group-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-group-header h2 i { color: var(--accent); font-size: 0.9375rem; }
.stats-group-sub { font-size: 0.8125rem; color: var(--text-dim); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px 14px;
    position: relative;
}
.metric-icon {
    position: absolute;
    top: 14px; right: 14px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.8125rem;
}
.metric-icon.critical { color: var(--critical); background: var(--critical-bg); }
.metric-icon.high { color: var(--high); background: var(--high-bg); }
.metric-icon.medium { color: var(--medium); background: var(--medium-bg); }
.metric-icon.low { color: var(--low); background: var(--low-bg); }
.metric-icon.kev { color: var(--kev); background: var(--kev-bg); }
.metric-value {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: -0.02em;
    padding-right: 36px;
}
.metric-value.critical { color: var(--critical); }
.metric-value.high { color: var(--high); }
.metric-value.medium { color: var(--medium); }
.metric-value.low { color: var(--low); }
.metric-value.kev { color: var(--kev); }
.metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}
.metric-value.metric-updated,
[data-key].metric-updated {
    animation: metric-flash 0.6s ease;
}
@keyframes metric-flash {
    0% { color: var(--accent); }
    100% { color: inherit; }
}
.metric-value.critical.metric-updated { animation-name: metric-flash-critical; }
.metric-value.high.metric-updated { animation-name: metric-flash-high; }
.metric-value.medium.metric-updated { animation-name: metric-flash-medium; }
.metric-value.low.metric-updated { animation-name: metric-flash-low; }
.metric-value.kev.metric-updated { animation-name: metric-flash-kev; }
@keyframes metric-flash-critical {
    0% { color: var(--accent); }
    100% { color: var(--critical); }
}
@keyframes metric-flash-high {
    0% { color: var(--accent); }
    100% { color: var(--high); }
}
@keyframes metric-flash-medium {
    0% { color: var(--accent); }
    100% { color: var(--medium); }
}
@keyframes metric-flash-low {
    0% { color: var(--accent); }
    100% { color: var(--low); }
}
@keyframes metric-flash-kev {
    0% { color: var(--accent); }
    100% { color: var(--kev); }
}

/* Search */
.sticky-sentinel {
    height: 1px;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.search-section {
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 4px 0 12px;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.search-section.is-stuck {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
}
.search-box {
    position: relative;
    margin-bottom: 12px;
}
.search-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--text-dim);
    pointer-events: none;
}
#search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
}
#search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
#search-input::placeholder { color: var(--text-dim); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.filter-select,
.filter-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 0.875rem;
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    box-sizing: border-box;
    white-space: nowrap;
}

.filter-select i,
.filter-check > i {
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.filter-select select {
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font);
    cursor: pointer;
    line-height: 1.2;
    min-width: 0;
}
.filter-select select:focus { outline: none; }

.filter-check {
    color: var(--text-muted);
    user-select: none;
}
.filter-check .fa-bolt { color: var(--text-dim); }
.filter-check:has(input:checked) {
    border-color: var(--kev);
    background: var(--kev-bg);
    color: var(--text);
}
.filter-check:has(input:checked) .fa-bolt { color: var(--kev); }
.filter-check input {
    accent-color: var(--kev);
    width: 14px;
    height: 14px;
    margin: 0;
    flex-shrink: 0;
}

/* Grid */
.cve-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.cve-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    padding-left: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border-left: 4px solid var(--border);
    overflow: hidden;
}

.cve-card.sev-critical { border-left-color: var(--critical); background: linear-gradient(135deg, var(--critical-bg), var(--bg-card)); }
.cve-card.sev-high { border-left-color: var(--high); background: linear-gradient(135deg, var(--high-bg), var(--bg-card)); }
.cve-card.sev-medium { border-left-color: var(--medium); background: linear-gradient(135deg, var(--medium-bg), var(--bg-card)); }
.cve-card.sev-low { border-left-color: var(--low); background: linear-gradient(135deg, var(--low-bg), var(--bg-card)); }
.cve-card.sev-unknown { border-left-color: var(--text-dim); background: linear-gradient(135deg, color-mix(in srgb, var(--text-dim) 18%, transparent), var(--bg-card)); }

.cve-card-kev {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kev) 25%, transparent);
}

.cve-card.card-stagger {
    animation: card-stagger-in 0.45s ease backwards;
    animation-delay: var(--stagger, 0ms);
}

@keyframes card-stagger-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.cve-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.cve-card.sev-critical:hover { background: linear-gradient(135deg, var(--critical-bg), var(--bg-hover)); }
.cve-card.sev-high:hover { background: linear-gradient(135deg, var(--high-bg), var(--bg-hover)); }
.cve-card.sev-medium:hover { background: linear-gradient(135deg, var(--medium-bg), var(--bg-hover)); }
.cve-card.sev-low:hover { background: linear-gradient(135deg, var(--low-bg), var(--bg-hover)); }
.cve-card.sev-unknown:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--text-dim) 18%, transparent), var(--bg-hover)); }

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.score-ring-wrap {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}

.score-ring-wrap .score-ring {
    display: block;
}

.score-ring-bg {
    stroke: var(--border);
    opacity: 0.6;
}

.score-ring-fill {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.score-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text);
    pointer-events: none;
}

.modal-hero .score-ring-wrap {
    width: 72px;
    height: 72px;
}

.modal-hero .score-ring-label {
    font-size: 1rem;
}
.card-logos { display: flex; gap: -4px; flex-shrink: 0; }
.vendor-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 2px solid var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
}
.vendor-avatar i { font-size: 0.875rem; color: var(--text-dim); }
.vendor-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.vendor-avatar + .vendor-avatar { margin-left: -8px; }

.card-meta { flex: 1; min-width: 0; }
.card-id {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    display: flex; align-items: center; gap: 4px;
}
.card-id .fa-xs { font-size: 0.625rem; opacity: 0.7; }
.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.card-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
    margin-top: auto;
    padding-top: 4px;
}
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card-date {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex; align-items: center; gap: 5px;
}
.card-date i { font-size: 0.6875rem; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge i { font-size: 0.625rem; }
.badge-critical { background: var(--critical-bg); color: var(--critical); }
.badge-high { background: var(--high-bg); color: var(--high); }
.badge-medium { background: var(--medium-bg); color: var(--medium); }
.badge-low { background: var(--low-bg); color: var(--low); }
.badge-none { background: var(--bg-elevated); color: var(--text-dim); }
.badge-kev { background: var(--kev-bg); color: var(--kev); }

/* Empty & Loading */
.empty-state, .loading {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted);
}
.empty-icon { margin-bottom: 16px; color: var(--text-dim); font-size: 3rem; }
.loading-icon { font-size: 2rem; color: var(--accent); margin-bottom: 12px; display: block; }
.empty-state h2 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text); }
.empty-state code {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.875rem;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Pagination */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; margin-top: 32px;
}
.pagination button {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.pagination .page-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0 8px;
    display: inline-flex; align-items: center; gap: 6px;
}
.pagination button:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-light); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: var(--modal-backdrop); backdrop-filter: blur(4px); }
.modal-panel {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 800px; width: 100%;
    margin: 40px auto;
    padding: 0;
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
    overflow: hidden;
}

#modal-content {
    padding: 0 24px 24px;
}

.modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 14px 20px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card) 60%, transparent);
}

.modal-toolbar-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-toolbar-title i {
    color: var(--accent);
    font-size: 0.875rem;
}

@keyframes modalIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.modal-close {
    position: static;
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.modal-close:hover {
    background: var(--critical-bg);
    border-color: color-mix(in srgb, var(--critical) 40%, transparent);
    color: var(--critical);
}

.modal-panel-glass {
    background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-hero {
    margin: 16px 0 20px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
}

.modal-hero.sev-critical { border-left-color: var(--critical); background: linear-gradient(135deg, var(--critical-bg), var(--bg-card)); }
.modal-hero.sev-high { border-left-color: var(--high); background: linear-gradient(135deg, var(--high-bg), var(--bg-card)); }
.modal-hero.sev-medium { border-left-color: var(--medium); background: linear-gradient(135deg, var(--medium-bg), var(--bg-card)); }
.modal-hero.sev-low { border-left-color: var(--low); background: linear-gradient(135deg, var(--low-bg), var(--bg-card)); }
.modal-hero.sev-unknown { border-left-color: var(--text-dim); background: linear-gradient(135deg, color-mix(in srgb, var(--text-dim) 18%, transparent), var(--bg-card)); }

.modal-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.modal-hero-text { flex: 1; min-width: 0; }

.modal-hero-vendors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.modal-lead {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 16px;
}

.modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}

.modal-tab:hover {
    background: var(--bg-card);
    color: var(--text);
}

.modal-tab.active {
    background: var(--accent-glow);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    color: var(--accent);
}

.modal-tab-panels { min-height: 120px; }

.modal-tab-panel {
    display: none;
    animation: tab-in 0.2s ease;
}

.modal-tab-panel.active { display: block; }

@keyframes tab-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-footer .external-link { margin-top: 0; }

.mit-muted {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.modal-header { margin-bottom: 24px; }
.modal-id {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.875rem;
    display: flex; align-items: center; gap: 6px;
}
.modal-title { font-size: 1.375rem; font-weight: 700; margin: 8px 0; line-height: 1.3; }
.modal-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.modal-section { margin-bottom: 24px; }
.modal-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 10px;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.modal-section h3 i { color: var(--accent); font-size: 0.8125rem; opacity: 0.8; }
.modal-section p, .modal-section li { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }
.modal-section p { color: var(--text); }

.kev-banner {
    background: var(--kev-bg);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}
.kev-banner strong {
    color: var(--kev);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.kev-due {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.affected-list { list-style: none; }
.affected-list li {
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.875rem;
}
.affected-list .product {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.affected-list .product i { color: var(--text-dim); font-size: 0.75rem; }
.affected-list .versions { color: var(--text-dim); font-size: 0.8125rem; margin-top: 2px; }

.ref-list { list-style: none; }
.ref-list a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
    border-bottom: 1px solid var(--border);
}
.ref-list a i { flex-shrink: 0; margin-top: 3px; font-size: 0.75rem; opacity: 0.7; }
.ref-link {
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.875rem;
}
.ref-link a { color: var(--accent); word-break: break-all; }
.ref-link i { flex-shrink: 0; margin-top: 3px; color: var(--text-dim); font-size: 0.75rem; }
.ref-list a:hover { text-decoration: underline; }
.ref-tags { font-size: 0.75rem; color: var(--text-dim); margin-left: 8px; }

.cvss-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.cvss-item {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}
.cvss-item .value { font-size: 1.25rem; font-weight: 700; font-family: var(--mono); }
.cvss-item .label {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cvss-vector {
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    word-break: break-all;
}
.cvss-vector i { flex-shrink: 0; margin-top: 2px; }

.cvss-breakdown { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.cvss-metric-group-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.cvss-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.cvss-metric {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cvss-metric-key {
    font-family: var(--mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.04em;
}
.cvss-metric-name {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cvss-metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 2px;
}
.cvss-metric-high { border-color: rgba(239, 68, 68, 0.35); background: var(--critical-bg); }
.cvss-metric-high .cvss-metric-value { color: var(--critical); }
.cvss-metric-medium { border-color: rgba(234, 179, 8, 0.35); background: var(--medium-bg); }
.cvss-metric-medium .cvss-metric-value { color: var(--medium); }
.cvss-metric-low { border-color: rgba(34, 197, 94, 0.25); }
.cvss-metric-low .cvss-metric-value { color: var(--low); }

.cvss-raw {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    word-break: break-all;
}
.cvss-raw code {
    font-family: var(--mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.cvss-raw i { flex-shrink: 0; margin-top: 2px; opacity: 0.6; }

.modal-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.modal-meta span { display: inline-flex; align-items: center; gap: 6px; }
.modal-meta i { font-size: 0.75rem; opacity: 0.7; }

.modal-vendors { display: flex; gap: 12px; flex-wrap: wrap; }
.modal-vendor {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}
.modal-vendor img { width: 28px; height: 28px; object-fit: contain; }
.modal-vendor .mono { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); border-radius: 6px; font-size: 0.7rem; font-weight: 600; }

.mitigation-box {
    background: var(--bg-card);
    border-left: 3px solid var(--low);
    padding: 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.external-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}
.external-link:hover { text-decoration: underline; }

.modal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.btn-share { cursor: pointer; }

@media (max-width: 640px) {
    .app { padding: 0 16px 32px; }
    .search-section.is-stuck {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .cve-grid { grid-template-columns: 1fr; }
    .modal-panel { margin: 16px auto; }
    #modal-content { padding: 0 16px 20px; }
    .modal-hero-main { flex-direction: row; align-items: flex-start; text-align: left; }
    .modal-hero-vendors { justify-content: center; }
    .sync-error-banner { margin: 0 16px 16px; }
}
