/* ========================================
   COMPREHENSIVE THEME OVERRIDES
   ======================================== */

/* Light Theme - Complete Override */
[data-theme="light"] {
    /* Form elements */
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-text: #1f2937;
}

[data-theme="light"] .version-dropdown,
[data-theme="light"] .ci-run-dropdown {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #1f2937;
}

[data-theme="light"] .version-dropdown option,
[data-theme="light"] .ci-run-dropdown option {
    background: #ffffff;
    color: #1f2937;
}

[data-theme="light"] .filter-group select,
[data-theme="light"] .filter-group input {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

[data-theme="light"] .date-filter-wrapper {
    background: #ffffff;
    border-color: #d1d5db;
}

[data-theme="light"] .date-field-select {
    background: rgba(99, 102, 241, 0.06);
    border-right-color: #d1d5db;
    color: #1f2937;
}

[data-theme="light"] .date-input-box input {
    color: #6b7280;
}

[data-theme="light"] .date-input-box input.has-value {
    color: #1f2937;
}

[data-theme="light"] .date-input-box input[type="date"]::-webkit-calendar-picker-indicator {
    filter: none;
    opacity: 0.5;
}

[data-theme="light"] .date-clear-btn {

    color: #6b7280;
}

[data-theme="light"] .multi-select-btn {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

[data-theme="light"] .multi-select-dropdown {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .label-dropdown-header {
    background: #f8fafc;
    border-color: #e5e7eb;
}

[data-theme="light"] .label-option {
    color: #374151;
}

[data-theme="light"] .label-option:hover {
    background: #f3f4f6;
}

[data-theme="light"] .label-option .label-name {
    color: #1e293b;
}

[data-theme="light"] .label-option .label-count {
    background: #e2e8f0;
    color: #4f46e5;
}

[data-theme="light"] .label-option:has(input:checked) {
    background: #eef2ff;
    border-color: #c7d2fe;
}

[data-theme="light"] .pagination-controls {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .pagination-info {
    color: #6b7280;
}

[data-theme="light"] .pagination-info span {
    color: #4f46e5;
}

[data-theme="light"] .pagination-page {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

[data-theme="light"] .pagination-page:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

[data-theme="light"] .pagination-page.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

[data-theme="light"] .pagination-size {
    color: #6b7280;
}

[data-theme="light"] .pagination-size select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

/* CI HUD Light Theme Fixes */
[data-theme="light"] .ci-hud-container {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .ci-hud-filters {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .ci-hud-table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .ci-hud-table thead th.sticky-col {
    background: #f8fafc;
}
[data-theme="light"] .ci-hud-table tbody td.sticky-col {
    background: #fff;
}
[data-theme="light"] .ci-hud-table .repo-ci-row:hover td.sticky-col {
    background: #f1f5f9;
}
[data-theme="light"] .ci-hud-table tbody td {
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .ci-hud-table .repo-ci-expand-row td {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}
[data-theme="light"] .ci-hud-table .repo-row-fail td {
    background: rgba(220, 38, 38, 0.04);
}
[data-theme="light"] .ci-hud-table .repo-row-fail:hover td {
    background: rgba(220, 38, 38, 0.07);
}

[data-theme="light"] .expanded-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .expanded-section h4 {
    color: #1f2937;
    border-bottom-color: #e5e7eb;
}

[data-theme="light"] .expanded-section h5 {
    color: #4b5563;
}



[data-theme="light"] .col-time {
    color: #6b7280;
}

/* Issues Report Light Theme */
[data-theme="light"] .issues-report {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .report-card {
    background: #ffffff;
    border-color: #e5e7eb;
}

[data-theme="light"] .report-card.summary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), #ffffff);
}

[data-theme="light"] .report-card.open {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), #ffffff);
}

[data-theme="light"] .report-card.closed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), #ffffff);
}

[data-theme="light"] .report-card.rate {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05), #ffffff);
}

[data-theme="light"] .report-card .card-value {
    color: #1f2937;
}

[data-theme="light"] .report-card .card-label {
    color: #6b7280;
}

[data-theme="light"] .breakdown-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .breakdown-section h4 {
    color: #374151;
}

[data-theme="light"] .issues-filters {
    background: #ffffff;
    border-color: #e5e7eb;
}

/* Issue stats light theme */
[data-theme="light"] .stat-item {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .stat-item span {
    color: #1e293b;
}

[data-theme="light"] .stat-item.open span {
    color: #2563eb;
}

[data-theme="light"] .stat-item.resolved span {
    color: #059669;
}

[data-theme="light"] .contributor-item {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #4b5563;
}

[data-theme="light"] .report-controls select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

/* Legend Dark Theme */
[data-theme="dark"] .legend,
[data-theme="dark"] .legend-section,
:root .legend,
:root .legend-section {
    background: #1f1f23;
    border-color: #3f3f46;
}

[data-theme="dark"] .legend h3,
[data-theme="dark"] .legend-section h4,
:root .legend h3,
:root .legend-section h4 {
    color: #e4e4e7 !important;
}

[data-theme="dark"] .legend-item,
:root .legend-item {
    color: #a1a1aa !important;
}

/* Legend Light Theme */
[data-theme="light"] .legend,
[data-theme="light"] .legend-section {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme="light"] .legend h3,
[data-theme="light"] .legend-section h4 {
    color: #1e293b !important;
}

[data-theme="light"] .legend-item {
    color: #334155 !important;
}

/* Table Light Theme */
[data-theme="light"] table {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] th {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    color: #374151;
    border-color: #e5e7eb;
}

[data-theme="light"] td {
    color: #374151;
    border-color: #e5e7eb;
}

[data-theme="light"] tr:hover {
    background: #f8fafc;
}

/* Issues Table Light Theme */
[data-theme="light"] .issues-table th {
    background: #f8fafc;
    color: #374151;
}

[data-theme="light"] .issues-table td {
    color: #374151;
}


/* GPU Architecture column - ensure visibility in both themes */
[data-theme="dark"] .status-table td:first-child,
[data-theme="dark"] .pytorch-table td:first-child,
:root .status-table td:first-child,
:root .pytorch-table td:first-child {
    color: #e4e4e7 !important;
}

[data-theme="light"] .status-table td:first-child,
[data-theme="light"] .pytorch-table td:first-child {
    color: #1f2937 !important;
}


/* Submodule name visibility in dark mode */
[data-theme="dark"] .submodule-name-link,
:root .submodule-name-link {
    color: #e4e4e7 !important;
}

[data-theme="dark"] .submodule-name-link:hover,
:root .submodule-name-link:hover {
    color: #818cf8 !important;
}

[data-theme="light"] .submodule-name-link {
    color: #1f2937 !important;
}

[data-theme="light"] .submodule-name-link:hover {
    color: #4f46e5 !important;
}


/* Ensure dropdown arrows are visible */
[data-theme="light"] .multi-select-btn .dropdown-arrow {
    color: #6b7280;
}

/* Pagination buttons light theme */
[data-theme="light"] .pagination-btn {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

[data-theme="light"] .pagination-btn:hover {
    background: #f3f4f6;
    border-color: var(--primary);
}

[data-theme="light"] .pagination-btn.active {
    background: var(--primary);
    color: #ffffff;
}

/* Dark mode text fixes for stat cards */
[data-theme="dark"] .report-card.summary .card-value {
    color: #818cf8;
}

[data-theme="dark"] .report-card.open .card-value {
    color: #60a5fa;
}

[data-theme="dark"] .report-card.closed .card-value {
    color: #4ade80;
}

[data-theme="dark"] .report-card.rate .card-value {
    color: #a1a1aa;
}

/* ========================================
   ADDITIONAL THEME FIXES
   ======================================== */

/* Light Theme - Better shades and text visibility */
[data-theme="light"] body {
    background: #f1f5f9;
}

[data-theme="light"] .global-header {
    background: #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .global-header .site-title {
    color: #1e293b;
}

[data-theme="light"] .global-header .header-link {
    color: #475569;
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme="light"] .global-header .header-link:hover {
    background: #f8fafc;
    border-color: #6366f1;
    color: #4f46e5;
}

[data-theme="light"] .container {
    background: transparent;
}

[data-theme="light"] .dashboard-section {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .dashboard-section h2,
[data-theme="light"] .dashboard-section h3,
[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: #0f172a !important;
}

[data-theme="light"] .build-info-header h3 {
    color: #0f172a !important;
}

[data-theme="light"] .report-header h3 {
    color: #0f172a !important;
}

[data-theme="light"] p {
    color: #334155;
}

[data-theme="light"] .tab-navigation {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tab-button {
    color: #475569;
}

[data-theme="light"] .tab-button:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .tab-button.active {
    background: #4f46e5;
    color: #ffffff !important;
}

[data-theme="light"] .ci-hud-pagination {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .ci-hud-page-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .ci-hud-page-btn:hover {
    background: #f1f5f9;
    border-color: #4f46e5;
}

[data-theme="light"] .ci-hud-page-btn.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

/* Light theme pagination page numbers */
[data-theme="light"] .ci-hud-page-num {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

[data-theme="light"] .ci-hud-page-num:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

[data-theme="light"] .ci-hud-page-num.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

/* Workflow run cards - Light theme */
[data-theme="light"] .workflow-run-card {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme="light"] .workflow-name {
    color: #1e293b;
}

[data-theme="light"] .workflow-run-sha {
    color: #64748b;
}


[data-theme="light"] .issues-report {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(139, 92, 246, 0.06));
    border-color: #cbd5e1;
}

/* Dark Theme - Text visibility fixes */
[data-theme="dark"] .dashboard-section h2,
[data-theme="dark"] .dashboard-section h3,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
:root .dashboard-section h2,
:root .dashboard-section h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .build-info-header h3,
:root .build-info-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] p,
:root p {
    color: var(--text-secondary);
}


/* Action button text visibility */
[data-theme="light"] .action-btn.view {
    background: #4f46e5;
    color: #ffffff;
}

/* ============= CI HUD Expandable Category Columns ============= */

.col-cat-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.col-cat-header:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}
.col-cat-header.expanded {
    background: rgba(99, 102, 241, 0.05) !important;
    border-bottom: 2px solid var(--accent);
}
/* (removed) `.cat-expand-icon` was the original inline `▾`/`▸` chevron
   span used in every expandable column header. All rendering sites now
   use the unified `.col-expand-pill` (see top of this file). */

.cat-toggle-link {
    background: var(--bg-elevated);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.pr-age-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
}
.pr-age-badge.pr-age-warn {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.45);
}
.pr-age-badge.pr-age-stale {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.gpu-health-table th {
    text-align: center;
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 8px 6px;
}
.gpu-health-table td:first-child {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.85rem;
    white-space: nowrap;
}
.gpu-health-table td {
    text-align: center;
    padding: 6px 4px;
}
.health-cell {
    display: inline-block;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
}
.health-cell.health-good {
    background: rgba(16, 185, 129, 0.18);
    color: var(--status-pass);
    border-color: rgba(16, 185, 129, 0.45);
}
.health-cell.health-warn {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.45);
}
.health-cell.health-bad {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.45);
}
.health-cell.health-na {
    background: transparent;
    color: var(--text-muted, #888);
    font-weight: 400;
}

.dashboard-loading::after {
    content: '· loading…';
    margin-left: 8px;
    color: var(--primary-light, #818cf8);
    font-size: 0.75rem;
    animation: dashLoadPulse 1s ease-in-out infinite;
}
@keyframes dashLoadPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Skeleton loader: subtle shimmering bars users see while data is fetching.
   Drop-in replacement for plain "Loading..." text — looks like content. */
@keyframes hudSkelShimmer {
    0%   { background-position: -100% 0; }
    100% { background-position:  200% 0; }
}
.hud-skel {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 100%
    );
    background-size: 200% 100%;
    animation: hudSkelShimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
    height: 12px;
    width: 60%;
    margin: 4px 0;
}
.hud-skel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}
.hud-skel-row .hud-skel:nth-child(1) { width: 32px; height: 16px; }
.hud-skel-row .hud-skel:nth-child(2) { flex: 1; height: 12px; }
.hud-skel-row .hud-skel:nth-child(3) { width: 80px; height: 12px; }

.rn-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.rn-form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rn-form-row > label:first-child {
    min-width: 140px;
    color: var(--text-secondary, #888);
    font-weight: 500;
    font-size: 0.85rem;
}
.rn-form-row input[type="text"] {
    flex: 1;
    min-width: 280px;
    padding: 8px 10px;
    background: var(--bg-overlay, rgba(0,0,0,0.04));
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    border-radius: 6px;
    color: var(--text-primary, #eee);
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.85rem;
}
.rn-form-row input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-light, #818cf8);
}
.rn-checkboxes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.rn-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}
.rn-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.rn-status {
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
}
.rn-status-ok { color: var(--status-pass); }
.rn-status-error { color: #ef4444; }
.rn-status-loading { color: var(--primary-light, #818cf8); animation: dashLoadPulse 1s ease-in-out infinite; }

.rn-output-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
#rn-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background: var(--bg-overlay, rgba(0,0,0,0.06));
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    border-radius: 6px;
    color: var(--text-primary, #eee);
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 320px;
}
.rn-stats {
    color: var(--text-secondary, #888);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 8px;
}
.rn-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.85rem;
}

/* ===== Release Notes rendered preview ===== */
.rn-preview {
    background: var(--card-bg, rgba(24, 27, 40, 0.8));
    border: 1px solid var(--card-border, rgba(255,255,255,0.08));
    border-radius: 8px;
    padding: 18px 22px;
    max-height: 640px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.55;
}
.rn-preview-header {
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.08));
}
.rn-preview-range {
    color: var(--text-secondary, #aaa);
    font-size: 0.85rem;
}
.rn-preview-range code {
    background: rgba(129,140,248,0.12);
    color: var(--primary-light, #818cf8);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.82rem;
}
.rn-preview-repo {
    margin-bottom: 24px;
}
.rn-preview-repo h3 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    color: var(--text-primary, #eee);
}
.rn-preview-repo h3 a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}
.rn-preview-repo h3 a:hover {
    border-bottom-color: var(--primary-light, #818cf8);
}
.rn-preview-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    font-weight: 400;
    margin-left: 6px;
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}
.rn-preview-count-sm {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    font-weight: 400;
}
.rn-preview-cat {
    margin: 12px 0 6px 0;
    font-size: 0.88rem;
    color: var(--primary-light, #818cf8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.rn-preview-list {
    margin: 0 0 12px 0;
    padding-left: 22px;
    list-style: disc;
}
.rn-preview-list li {
    margin-bottom: 4px;
    color: var(--text-primary, #ddd);
}
.rn-preview-pr {
    color: var(--primary-light, #818cf8);
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    padding: 1px 6px;
    background: rgba(129,140,248,0.1);
    border-radius: 3px;
    margin-right: 4px;
}
.rn-preview-pr:hover {
    background: rgba(129,140,248,0.2);
}
.rn-preview-author {
    color: var(--text-secondary, #aaa);
    text-decoration: none;
    font-size: 0.82rem;
}
.rn-preview-author:hover {
    color: var(--primary-light, #818cf8);
}
.rn-preview-empty {
    color: var(--text-muted, #666);
    font-style: italic;
    padding: 8px 0;
}
.rn-view-toggle label {
    cursor: pointer;
    color: var(--text-secondary, #aaa);
}
.rn-view-toggle input[type="radio"] {
    margin-right: 4px;
    vertical-align: middle;
}

/* ===== Bump expand panel + history (#33) ===== */
.bump-expand-btn {
    background: transparent;
    border: 1px solid var(--card-border, rgba(255,255,255,0.1));
    color: var(--text-primary, #eee);
    width: 24px; height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    line-height: 1;
}
.bump-expand-btn:hover { background: rgba(99,102,241,0.15); border-color: var(--primary-light, #818cf8); }
.bump-expand-btn.expanded { background: rgba(99,102,241,0.25); border-color: var(--primary-light, #818cf8); }
.bump-expand-na { color: var(--text-muted, #888); font-size: 0.8rem; }

.bump-detail-row td { padding: 0 !important; background: var(--bg-overlay, rgba(0,0,0,0.04)); border-top: 0; }
.bump-detail-body { padding: 16px 20px; border-left: 3px solid var(--primary-light, #818cf8); }
.bump-detail-loading { color: var(--text-secondary, #888); font-style: italic; padding: 8px 0; }
.bump-detail-error { color: #ef4444; padding: 8px 12px; background: rgba(239,68,68,0.08); border-radius: 6px; font-size: 0.85rem; }
.bump-detail-note { color: var(--text-secondary, #888); padding: 8px 12px; background: rgba(99,102,241,0.06); border-radius: 6px; margin-top: 10px; font-size: 0.85rem; font-style: italic; }

.bump-sha-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.85rem; }
.bump-sha-strip code { padding: 3px 8px; background: var(--bg-overlay, rgba(0,0,0,0.06)); border-radius: 4px; }
.bump-sha-strip .bump-arrow { color: var(--text-muted); }

.bump-stats-strip { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 14px; background: var(--bg-overlay, rgba(0,0,0,0.04)); border-radius: 8px; }
.bump-stat { display: flex; flex-direction: column; gap: 2px; min-width: 100px; }
.bump-stat-label { font-size: 0.7rem; color: var(--text-secondary, #888); text-transform: uppercase; letter-spacing: 0.04em; }
.bump-stat-val { font-size: 1.1rem; font-weight: 700; color: var(--text-primary, #eee); }
.bump-stat-na { color: var(--text-muted, #888); font-weight: 400; }

.bump-pr-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .bump-pr-list { grid-template-columns: 1fr; } }
.bump-pr-cat { background: var(--bg-overlay, rgba(0,0,0,0.04)); border-radius: 6px; padding: 10px 12px; }
.bump-pr-cat h5 { margin: 0 0 8px; font-size: 0.78rem; color: var(--text-secondary, #888); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.bump-pr-count { background: var(--primary-light, #818cf8); color: white; padding: 1px 8px; border-radius: 8px; font-size: 0.65rem; font-weight: 700; }
.bump-pr-cat ul { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.bump-pr-cat li { padding: 4px 0; font-size: 0.78rem; line-height: 1.4; border-bottom: 1px dashed var(--card-border, rgba(255,255,255,0.05)); }
.bump-pr-cat li:last-child { border-bottom: none; }
.bump-pr-author { color: var(--text-secondary, #888); font-size: 0.72rem; }
.bump-pr-more { color: var(--text-muted, #888); font-style: italic; font-size: 0.72rem; }

.bump-history-container { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .bump-history-container { grid-template-columns: 1fr; } }
.bump-history-section { background: var(--bg-overlay, rgba(0,0,0,0.04)); border-radius: 8px; padding: 12px 16px; }
.bump-history-section h4 { margin: 0 0 10px; font-size: 0.9rem; color: var(--text-primary, #eee); display: flex; align-items: center; gap: 8px; }
.bump-history-loading { font-size: 0.7rem; color: var(--text-muted, #888); font-weight: 400; font-style: italic; }
.bump-history-list { display: flex; flex-direction: column; gap: 4px; }
.bump-history-item { display: grid; grid-template-columns: 62px 64px 104px 64px minmax(0,1fr) max-content; align-items: center; gap: 8px; font-size: 0.78rem; padding: 4px 0; }
.bump-history-item .bh-c-status, .bump-history-item .bh-c-attempt { justify-self: start; }
.bump-history-item .bh-c-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bump-history-time { color: var(--text-secondary, #888); font-size: 0.72rem; }
.bump-history-title { color: var(--text-primary, #eee); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bump-history-empty { color: var(--text-muted, #888); font-style: italic; font-size: 0.78rem; }
.bump-tag { display: inline-block; box-sizing: border-box; min-width: 56px; text-align: center; font-size: 0.6rem; padding: 1px 6px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.bump-tag-merged { background: rgba(168,85,247,0.18); color: #c084fc; border: 1px solid rgba(168,85,247,0.45); }
.bump-tag-open   { background: rgba(34,197,94,0.18);  color: #22c55e; border: 1px solid rgba(34,197,94,0.45); }
.bump-tag-closed { background: rgba(239,68,68,0.14);  color: #f87171; border: 1px solid rgba(239,68,68,0.4); }
.bump-attempt-badge { font-size: 0.62rem; padding: 1px 5px; border-radius: 5px; background: rgba(99,102,241,0.16); color: #818cf8; border: 1px solid rgba(99,102,241,0.35); font-weight: 700; white-space: nowrap; cursor: default; }
/* Collapsed same-base attempt group (issue #38): parent summary row + the
   expandable per-attempt dropdown beneath it. */
.bump-history-group { background: rgba(99,102,241,0.05); border-radius: 5px; }
.bh-group-toggle { margin-right: 4px; }
.bump-history-attempts { margin: 2px 0 6px; border-left: 2px solid var(--card-border); }
.bump-history-sub { padding-left: 12px; opacity: 0.9; }
/* Component filter chips above the open bump-PRs table (issue #38). */
.bump-component-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.bump-chip-label { font-size: 0.78rem; color: var(--text-secondary); margin-right: 2px; }
.bump-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--card-border); background: var(--bg-elevated); color: var(--text-secondary); font-size: 0.76rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.bump-chip:hover { border-color: var(--primary-light, #818cf8); color: var(--text-primary); }
.bump-chip-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bump-chip-count { font-size: 0.66rem; padding: 0 5px; border-radius: var(--radius-pill); background: rgba(127,127,127,0.22); color: inherit; font-weight: 700; }
.bump-chip-active .bump-chip-count { background: rgba(255,255,255,0.25); }
/* Component Insights active-filter banner (issue #38 follow-up). */
.ci-active-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 8px 12px; background: var(--primary-bg, rgba(99,102,241,0.12)); border: 1px solid var(--primary, #6366f1); border-radius: 8px; font-size: 0.82rem; }
.ci-active-icon { width: 15px; height: 15px; color: var(--primary-light, #818cf8); }
.ci-active-label { color: var(--text-secondary); font-weight: 600; }
.ci-active-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: var(--radius-pill); background: var(--bg-elevated); border: 1px solid var(--card-border); color: var(--text-primary); font-weight: 600; }
.ci-active-pill-k { color: var(--text-muted); font-weight: 600; }
.ci-active-pill-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: none; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 0.72rem; line-height: 1; }
.ci-active-pill-x:hover { background: var(--status-fail, #ef4444); color: #fff; }
.ci-active-clear-all { margin-left: auto; padding: 4px 12px; border: 1px solid var(--primary, #6366f1); border-radius: var(--radius-pill); background: transparent; color: var(--primary-light, #818cf8); font-weight: 600; font-size: 0.78rem; cursor: pointer; }
.ci-active-clear-all:hover { background: var(--primary, #6366f1); color: #fff; }
.bump-close-reason { font-size: 0.68rem; padding: 1px 6px; border-radius: 5px; background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); font-style: italic; }
.bump-history-summary { border-bottom: 1px solid var(--card-border, rgba(255,255,255,0.06)); padding-bottom: 6px; margin-bottom: 8px; }
/* Bump History section-scoped filter bar */
.bump-history-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 16px; padding: 10px 14px; background: rgba(127,127,127,0.04); border-radius: 8px; }
.bump-history-filters .bhf-group { display: flex; align-items: center; gap: 8px; }
.bump-history-filters .bhf-label { font-size: 0.82rem; color: var(--text-secondary, #aaa); white-space: nowrap; }
.bump-history-filters .bhf-chips { display: inline-flex; gap: 4px; }
.bump-history-filters .bhf-arrow { color: var(--text-secondary, #888); }
.bump-history-filters .bh-chip { font-size: 0.75rem; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--card-border, rgba(255,255,255,0.14)); background: transparent; color: var(--text-secondary, #aaa); cursor: pointer; }
.bump-history-filters .bh-chip:hover { background: rgba(127,127,127,0.12); }
.bump-history-filters .bh-chip.active { background: rgba(99,102,241,0.18); color: #a5b4fc; border-color: rgba(99,102,241,0.45); font-weight: 600; }
.bump-history-filters input[type="date"], .bump-history-filters select { padding: 4px 8px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 6px; color: var(--text-primary); font-size: 0.8rem; }

/* ===== PR Insights (#30) ===== */
.pri-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pri-controls label { color: var(--text-secondary, #888); font-size: 0.85rem; font-weight: 500; }
.pri-controls select {
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Stat tile row — used at the top of every tab so they all feel like
   siblings. Same visual language as PR Insights / Issues which the team
   liked. `.pri-tiles` retained as alias for existing markup. */
.page-stats, .pri-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3, 14px);
    margin-bottom: var(--space-5, 20px);
}
@media (max-width: 900px) {
    .page-stats, .pri-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .page-stats, .pri-tiles { grid-template-columns: 1fr; }
}
.page-stat {
    padding: var(--space-4, 16px) var(--space-4, 18px);
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--card-border, rgba(255,255,255,0.06));
    border-radius: var(--radius-lg, 10px);
    border-left: 3px solid var(--primary-light, #818cf8);
    position: relative;
}
.page-stat-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-2);
}
.page-stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.page-stat-sub {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.page-stat-good { border-left-color: var(--status-pass); background-image: linear-gradient(90deg, var(--status-pass-bg), transparent 55%); }
.page-stat-warn { border-left-color: var(--status-warn); background-image: linear-gradient(90deg, var(--status-warn-bg), transparent 55%); }
.page-stat-bad  { border-left-color: var(--status-fail); background-image: linear-gradient(90deg, var(--status-fail-bg), transparent 55%); }
.page-stat-neutral { border-left-color: var(--text-muted, #6b7280); }

/* Single-row tab summary bar — replaces the 4-tile page-stats grid on tabs
   where four independent metrics added little value (Multi-Arch, CI Nightly,
   Sanitizers). One status sentence + one sub-line + one drill-in chip. */
.tab-summary-bar {
    display: flex;
    align-items: center;
    gap: var(--space-4, 16px);
    padding: var(--space-4, 14px) var(--space-5, 20px);
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--card-border, rgba(255,255,255,0.06));
    border-radius: var(--radius-lg, 10px);
    border-left: 4px solid var(--text-muted, #6b7280);
    margin-bottom: var(--space-5, 20px);
}
.tab-summary-good    { border-left-color: var(--status-pass); }
.tab-summary-warn    { border-left-color: var(--status-warn); }
.tab-summary-bad     { border-left-color: var(--status-fail); }
.tab-summary-neutral { border-left-color: var(--text-muted, #6b7280); }

.tab-summary-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}
.tab-summary-icon i { width: 18px; height: 18px; }
.tab-summary-good .tab-summary-icon { color: var(--status-pass); background: var(--status-pass-bg); }
.tab-summary-warn .tab-summary-icon { color: var(--status-warn); background: var(--status-warn-bg); }
.tab-summary-bad  .tab-summary-icon { color: var(--status-fail); background: var(--status-fail-bg); }

.tab-summary-body {
    flex: 1 1 auto;
    min-width: 0;
}
.tab-summary-headline {
    font-size: var(--text-base, 1rem);
    font-weight: var(--fw-semibold, 600);
    color: var(--text-primary);
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.tab-summary-sub {
    margin-top: 4px;
    font-size: var(--text-sm, 0.85rem);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.tab-summary-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: var(--text-muted, #6b7280);
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.15s ease, color 0.15s ease;
    outline: none;
}
.tab-summary-info i { width: 14px; height: 14px; }
.tab-summary-info:hover, .tab-summary-info:focus { opacity: 1; color: var(--primary-light, #818cf8); }

.tab-summary-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md, 8px);
    background: rgba(99,102,241,0.10);
    color: var(--primary-light, #818cf8);
    font-size: var(--text-sm, 0.85rem);
    font-weight: var(--fw-semibold, 600);
    text-decoration: none;
    border: 1px solid rgba(99,102,241,0.25);
    transition: background 0.15s ease, transform 0.05s ease;
    white-space: nowrap;
}
.tab-summary-action:hover {
    background: rgba(99,102,241,0.18);
    color: #fff;
}
.tab-summary-action i { width: 14px; height: 14px; }
.tab-summary-action:active { transform: translateY(1px); }

@media (max-width: 700px) {
    .tab-summary-bar {
        flex-wrap: wrap;
    }
    .tab-summary-action {
        flex: 1 1 100%;
        justify-content: center;
    }
}

.pri-tile {
    padding: 16px 18px;
    background: var(--card-bg, var(--bg-elevated, rgba(255,255,255,0.03)));
    border: 1px solid var(--card-border, rgba(255,255,255,0.06));
    border-radius: 10px;
    border-left: 3px solid var(--primary-light, #818cf8);
    display: block;
    text-decoration: none;
    color: inherit;
    /* Establish a stacking context so the absolutely-positioned cover link
       sits above the tile background but below interactive child links. */
    position: relative;
}
.pri-tile-link {
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.pri-tile-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    border-color: rgba(129,140,248,0.5);
}
/* Invisible "cover link" overlay — makes the entire tile clickable without
   needing to wrap the tile content in an <a> (which causes nested-anchor bugs
   when sub-rows have their own real links). z-index 1 so it sits above the
   plain tile background but below explicitly-positioned links. */
.pri-tile-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}
/* Inline links inside a tile (e.g. "older than 30d") — bumped above the
   cover link so they receive their own clicks, not the tile's. */
.pri-tile-inline-link {
    position: relative;
    z-index: 2;
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(129,140,248,0.5);
}
.pri-tile-inline-link:hover {
    text-decoration-color: var(--primary-light, #818cf8);
}
.pri-tile-ext {
    font-size: 0.75rem;
    opacity: 0.55;
    margin-left: 4px;
}
.pri-tile-good { border-left-color: var(--status-pass); background-image: linear-gradient(90deg, var(--status-pass-bg), transparent 55%); }
.pri-tile-warn { border-left-color: var(--status-warn); background-image: linear-gradient(90deg, var(--status-warn-bg), transparent 55%); }
.pri-tile-bad  { border-left-color: var(--status-fail); background-image: linear-gradient(90deg, var(--status-fail-bg), transparent 55%); }
.pri-tile-label { font-size: 0.7rem; color: var(--text-secondary, #888); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; }
.pri-tile-value { font-size: 1.7rem; font-weight: 800; color: var(--text-primary, #eee); line-height: 1.1; }
.pri-tile-sub { margin-top: 4px; font-size: 0.72rem; color: var(--text-secondary, #888); }

.pri-recent-merged {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 480px;
    overflow-y: auto;
}
.pri-recent-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    transition: background 0.1s ease;
    font-size: 0.88rem;
    flex-wrap: wrap;
}
.pri-recent-row:hover {
    background: rgba(255,255,255,0.03);
}
.pri-recent-pr {
    color: var(--primary-light, #818cf8);
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    padding: 1px 6px;
    background: rgba(129,140,248,0.1);
    border-radius: 3px;
    flex-shrink: 0;
}
.pri-recent-pr:hover {
    background: rgba(129,140,248,0.22);
}
.pri-recent-title {
    flex: 1;
    min-width: 200px;
    color: var(--text-primary, #ddd);
}
.pri-recent-meta {
    color: var(--text-secondary, #aaa);
    font-size: 0.78rem;
    white-space: nowrap;
}
.pri-recent-meta a {
    color: inherit;
    text-decoration: none;
}
.pri-recent-meta a:hover {
    color: var(--primary-light, #818cf8);
}
.pri-recent-meta code {
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
}
.pri-recent-empty {
    padding: 16px;
    color: var(--text-muted, #666);
    font-style: italic;
    text-align: center;
}

.pri-chart-wrap {
    position: relative;
    height: 280px;
    margin-top: 8px;
}
.pri-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #ef4444;
}

.trend-panel {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-overlay, rgba(0,0,0,0.04));
    border: 1px solid var(--card-border, rgba(255,255,255,0.06));
    border-radius: 8px;
}
.trend-section { margin-bottom: 10px; }
.trend-section:last-child { margin-bottom: 0; }
.trend-section h4 { margin: 0 0 6px; font-size: 0.78rem; color: var(--text-secondary, #888); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.trend-rows { display: flex; flex-direction: column; gap: 4px; }
.trend-row { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; padding: 3px 6px; border-radius: 4px; }
.trend-row:hover { background: rgba(99,102,241,0.06); }
.trend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-key { color: var(--text-secondary, #888); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.72rem; }
.trend-tag { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 0.62rem; font-weight: 700; line-height: 1.6; flex-shrink: 0; }
.trend-tag.trend-new   { background: rgba(239,68,68,0.18); color: #ef4444; border: 1px solid rgba(239,68,68,0.45); }
.trend-tag.trend-still { background: rgba(245,158,11,0.18); color: #f59e0b; border: 1px solid rgba(245,158,11,0.45); }
.trend-tag.trend-flake { background: rgba(168,85,247,0.18); color: #c084fc; border: 1px solid rgba(168,85,247,0.45); }
.trend-tag.trend-fixed { background: rgba(16,185,129,0.18); color: var(--status-pass); border: 1px solid rgba(16,185,129,0.45); }
.trend-dots { display: inline-flex; gap: 3px; flex-shrink: 0; }
.trend-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 0.65rem; font-weight: 700; border-radius: 3px; }
.trend-dot.trend-pass { background: rgba(16,185,129,0.25); color: var(--status-pass); }
.trend-dot.trend-fail { background: rgba(239,68,68,0.25); color: #ef4444; }
.trend-dot.trend-run  { background: rgba(99,102,241,0.25); color: #818cf8; }
.trend-dot.trend-skip { background: rgba(148,163,184,0.20); color: var(--text-muted, #94a3b8); }
.trend-dot.trend-na   { background: transparent; color: var(--text-muted, #94a3b8); }
.trend-legend { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--card-border, rgba(255,255,255,0.08)); font-size: 0.68rem; color: var(--text-secondary, #888); }
.trend-legend strong { color: var(--text-primary, #eee); }

.tab-content > header > h1,
.tab-content > header h1.tab-title {
    font-size: 1.8rem;
    margin: 0;
}

/* Summary tab: visual rhythm between stacked sections. The actual section
   chrome (.dashboard-section) and content rows (.pri-tile, .pri-recent-row)
   are reused from PR Insights so the look matches the rest of the app. */
.summary-section + .summary-section {
    margin-top: 6px;
}
.summary-section h2 .rn-preview-count {
    background: rgba(255, 255, 255, 0.06);
}
.summary-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 480px;
    overflow-y: auto;
}

/* ===== AI Failure Insights ===== */
.insights-h3 {
    font-size: 0.95rem;
    color: var(--text-primary, #eee);
    margin: 14px 0 8px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.insights-h3 i { font-size: 0.85rem; color: var(--text-secondary, #888); }

/* Narrative callout: highlighted band at the top of the section */
.insights-narrative {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(129,140,248,0.08), rgba(34,211,238,0.04));
    border-left: 3px solid var(--primary-light, #818cf8);
    border-radius: 6px;
    margin-bottom: 6px;
}
.insights-narrative-body {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-primary, #ddd);
    font-style: italic;
}
.insights-narrative-source {
    font-size: 0.7rem;
    color: var(--text-secondary, #888);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Two-column grid for the arch / workflow pivots */
.insights-pivots-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 6px;
}
@media (max-width: 900px) {
    .insights-pivots-grid { grid-template-columns: 1fr; gap: 16px; }
}

.insights-bar-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.insights-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.insights-bar:hover {
    background: rgba(255, 255, 255, 0.03);
}
.insights-bar-rank {
    flex: 0 0 18px;
    text-align: right;
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    opacity: 0.6;
}
.insights-bar-label {
    flex: 0 0 32%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insights-bar-track {
    flex: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.insights-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Severity tiers — set on .insights-bar; cascade picks the fill color.
   The eye reads "where the heat is concentrated" instantly: the top
   one or two rows are deep red, the middle band is amber, the long
   tail is muted gray. Replaces the previous all-red wall. */
.insights-bar.tier-critical .insights-bar-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25) inset;
}
.insights-bar.tier-warning  .insights-bar-fill {
    background: linear-gradient(90deg, #f97316, #fb923c);
}
.insights-bar.tier-notable  .insights-bar-fill {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    opacity: 0.85;
}
.insights-bar.tier-muted    .insights-bar-fill {
    background: linear-gradient(90deg, #64748b, #94a3b8);
    opacity: 0.55;
}
.insights-bar-count {
    flex: 0 0 78px;
    text-align: right;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    color: var(--text-primary, #eee);
}
.insights-bar-count strong {
    font-weight: 600;
}
.insights-bar-share {
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
    font-size: 0.72rem;
    margin-left: 2px;
}
/* Bottom tier rows fade their numbers a bit too, so the visual
   hierarchy is consistent: critical = bold, muted = quiet. */
.insights-bar.tier-critical .insights-bar-count strong { color: #f87171; }
.insights-bar.tier-warning  .insights-bar-count strong { color: #fb923c; }
.insights-bar.tier-muted    .insights-bar-count           { opacity: 0.65; }

/* "Needs attention" cards */
.insights-attention-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Failures tab — per-category section subtitle (workflow chips) */
.failures-cat-meta code {
    background: rgba(255,255,255,0.04);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

/* Failures tab — header window dropdown should align with the rest of the
   header row (refresh button, last-updated, etc.) */
#failures-window-select {
    margin-right: 16px;
}

/* Summary tab — make the failure-insights teaser card visually clickable */
#failure-insights-teaser {
    transition: border-color 0.15s ease, background 0.15s ease;
}
#failure-insights-teaser:hover {
    border-color: rgba(129,140,248,0.4);
    background: rgba(129,140,248,0.03);
}
.insights-attention-card {
    padding: 10px 14px;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid var(--card-border, rgba(255,255,255,0.06));
    border-left: 3px solid var(--text-secondary, #888);
    border-radius: 6px;
}
.insights-sev-high  { background: rgba(239,68,68,0.04); }
.insights-sev-medium{ background: rgba(245,158,11,0.04); }
.insights-sev-low   { background: rgba(16,185,129,0.04); }
.insights-attention-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.insights-attention-reason {
    font-size: 0.8rem;
    color: var(--text-secondary, #aaa);
    margin-left: 38px;
}
@media (max-width: 600px) {
    .insights-attention-reason { margin-left: 0; }
    .insights-bar { gap: 8px; padding: 4px 4px; }
    .insights-bar-rank { display: none; }
    .insights-bar-label { flex: 0 0 38%; }
    .insights-bar-count { flex: 0 0 64px; font-size: 0.72rem; }
}
@media (max-width: 768px) {
    .tab-content > header > h1,
    .tab-content > header h1.tab-title {
        font-size: 1.4rem;
    }
}
.cat-toggle-link:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.6);
}
.cat-toggle-link:active {
    transform: translateY(1px);
}

/* Job sub-header row — vertical text. Pure 90° rotation packs the most
   columns into the smallest horizontal footprint. Smart label
   shortening (_shortenJobLabel in app.js) strips redundant prefixes
   like "Build linux" so unique tokens lead.

   Horizontal alignment: the narrow rotated strip is centered over the
   status-dot column below it. Inner span is inline-block (not block) so
   text-align:center on the parent th can position the strip; otherwise a
   block span fills the cell width and the rotated text anchors at the
   left edge — visibly off-center from the dots below. */
.ci-hud-job-header-row th.col-job-header {
    /* Tightened from 120px → 88px so the rotated label sits close to
       the data column it describes. Old height left ~40-50px of empty
       cell above the bottom-aligned text, which looked like a
       mysterious dark gap when a workflow was expanded with only
       arch sub-headers (and no taller neighbour). 88px still fits
       the longest gfx token (`GFX1153`, `gfx94X-dcgpu` shortened
       to `GFX94X`) at 0.68rem without clipping. */
    padding: 4px 0;
    height: 88px;
    min-width: 32px;
    max-width: 36px;
    width: 34px;
    vertical-align: bottom;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}
.ci-hud-job-header-row th.col-job-header .job-header-text {
    display: inline-block;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 80px;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 0.3px;
    transition: color 0.15s ease;
}
.ci-hud-job-header-row th.col-job-header:hover .job-header-text {
    color: var(--primary-light, #818cf8);
}

/* Job status dot cells */
.col-job-cell {
    padding: 2px !important;
    text-align: center;
    min-width: 32px;
    max-width: 36px;
    width: 34px;
    border-left: 1px solid rgba(255,255,255,0.03);
}
.job-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.1s;
}
.job-dot:hover {
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
    z-index: 5;
    position: relative;
}
.job-dot.job-pass { background: #22c55e; color: #fff; }
.job-dot.job-fail { background: #ef4444; color: #fff; }
.job-dot.job-run  { background: #f59e0b; color: #fff; animation: pulse-dot 1.5s infinite; }
.job-dot.job-na   { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.25); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Light theme */
[data-theme="light"] .col-cat-header:hover { background: rgba(99, 102, 241, 0.08) !important; }
[data-theme="light"] .ci-hud-job-header-row th.col-job-header { border-left-color: rgba(0,0,0,0.06); }
[data-theme="light"] .col-job-cell { border-left-color: rgba(0,0,0,0.04); }
[data-theme="light"] .job-dot.job-na { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.2); }
