:root {
    /* MD3 Dark Theme Colors */
    --md-sys-color-background: #121212;
    --md-sys-color-surface: #1e1e1e;
    --md-sys-color-surface-variant: #2d2d2d;
    --md-sys-color-on-background: #e3e3e3;
    --md-sys-color-on-surface: #c7c7c7;
    --md-sys-color-primary: #a8c7fa;
    --md-sys-color-on-primary: #062e6f;
    --md-sys-color-primary-container: #004a77;
    
    --success-color: #81c995;
    --success-bg: rgba(129, 201, 149, 0.1);
    --error-color: #f28b82;
    --error-bg: rgba(242, 139, 130, 0.1);
    --neutral-color: #9aa0a6;
    
    --elevation-1: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.12);
    --elevation-2: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.12);
    
    --border-radius: 12px;
    --transition-speed: 0.25s;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* App Bar */
.app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--md-sys-color-surface);
    box-shadow: var(--elevation-1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--md-sys-color-primary);
}

.app-title {
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 0.65rem;
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Buttons */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-primary:not(:disabled):hover {
    box-shadow: var(--elevation-2);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
    background: transparent;
    color: var(--md-sys-color-on-surface);
}

.btn-icon:hover {
    background-color: var(--md-sys-color-surface-variant);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Upload Section */
.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.drop-zone-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
}

.vs-badge {
    background-color: var(--md-sys-color-surface-variant);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--neutral-color);
    box-shadow: var(--elevation-1);
    z-index: 10;
}

.drop-zone {
    flex: 1;
    background-color: var(--md-sys-color-surface);
    border: 2px dashed var(--md-sys-color-surface-variant);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--md-sys-color-primary);
    background-color: rgba(168, 199, 250, 0.05);
}

.drop-icon {
    font-size: 48px;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

.drop-zone:hover .drop-icon {
    color: var(--md-sys-color-primary);
}

.drop-zone h3 {
    font-weight: 600;
}

.drop-zone p {
    color: var(--md-sys-color-on-surface);
    font-size: 0.9rem;
}

.status-chip {
    margin-top: 1rem;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.status-chip.empty {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--neutral-color);
}

.status-chip.loaded {
    background-color: var(--success-bg);
    color: var(--success-color);
}

/* Dashboard */
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--elevation-1);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sysinfo */
.sysinfo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.sys-item {
    background-color: var(--md-sys-color-surface-variant);
    padding: 1rem;
    border-radius: 8px;
}

.sys-item-key {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neutral-color);
    margin-bottom: 4px;
}

.sys-item-val {
    font-size: 0.95rem;
    word-break: break-all;
}

/* Score Dashboard */
.score-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(32, 33, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--elevation-2);
    position: relative;
    overflow: hidden;
}

.score-dashboard::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(168, 199, 250, 0.05) 0%, rgba(32, 33, 36, 0) 100%);
    pointer-events: none;
}

.score-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
}

.score-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neutral-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.total-score {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(90deg, #A8C7FA, #E8F0FE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(168, 199, 250, 0.2);
    line-height: 1;
}

.after-score-card .total-score {
    background: linear-gradient(90deg, #81c995, #ceead6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(129, 201, 149, 0.2);
}

.sub-scores {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.sub-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    flex: 1;
}

.sub-score span {
    font-size: 0.7rem;
    color: var(--neutral-color);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-score strong {
    font-size: 1.1rem;
    color: var(--md-sys-color-on-background);
    font-weight: 600;
}

.score-vs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2rem;
    z-index: 1;
}

.vs-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--md-sys-color-surface-variant);
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: var(--md-sys-color-primary);
    box-shadow: var(--elevation-1);
}

.score-delta {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .score-dashboard {
        flex-direction: column;
        gap: 2rem;
    }
    .score-vs-container {
        padding: 1rem 0;
    }
    .sub-scores {
        flex-direction: column;
    }
}

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.summary-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--elevation-1);
    transition: transform var(--transition-speed);
}

.summary-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 36px;
    padding: 12px;
    border-radius: 50%;
}

.stat-improved .stat-icon {
    color: var(--success-color);
    background-color: var(--success-bg);
}

.stat-regressed .stat-icon {
    color: var(--error-color);
    background-color: var(--error-bg);
}

.stat-neutral .stat-icon {
    color: var(--neutral-color);
    background-color: var(--md-sys-color-surface-variant);
}

.stat-content h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
}

.stat-content h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neutral-color);
    padding: 1rem;
    border-bottom: 2px solid var(--md-sys-color-surface-variant);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    font-size: 0.95rem;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.delta-positive {
    color: var(--success-color);
    font-weight: 600;
}

.delta-negative {
    color: var(--error-color);
    font-weight: 600;
}

.delta-neutral {
    color: var(--neutral-color);
}

.val-with-spark {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sparkline-bar {
    width: 60px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.sparkline-fill {
    height: 100%;
    border-radius: 2px;
}

.spark-positive {
    background-color: var(--success-color);
}

.spark-negative {
    background-color: var(--error-color);
}

.spark-neutral {
    background-color: var(--neutral-color);
}

/* Charts */
.charts-container {
    display: flex;
    justify-content: center;
}

.chart-card {
    width: 100%;
    max-width: 700px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h2 {
    margin-bottom: 0;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-container label {
    font-size: 0.85rem;
    color: var(--neutral-color);
    font-weight: 500;
}

.select-input {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.select-input:hover {
    border-color: var(--md-sys-color-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.select-input:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.2);
}

.canvas-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Heuristics */
.heuristics-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.heuristic-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.heuristic-list li {
    background-color: var(--md-sys-color-surface-variant);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--md-sys-color-primary);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

.heuristic-item-interactive {
    cursor: pointer;
}

.heuristic-item-interactive:hover {
    transform: translateX(4px);
    background-color: rgba(255, 255, 255, 0.08);
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(168, 199, 250, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(168, 199, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(168, 199, 250, 0); }
}

.highlight-pulse {
    animation: highlightPulse 1.2s ease-out;
}

.heuristic-list li strong {
    color: var(--md-sys-color-primary);
    display: block;
    margin-bottom: 4px;
}

/* Layout structure */
.app-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - 64px);
    width: 100%;
}

.sidebar {
    background-color: var(--md-sys-color-surface);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
    z-index: 90;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
}

.history-count {
    font-size: 0.75rem;
    background-color: var(--md-sys-color-surface-variant);
    padding: 2px 8px;
    border-radius: 12px;
    color: var(--neutral-color);
}

.history-list-wrapper {
    flex: 1;
    overflow-y: auto;
}

.history-list {
    list-style: none;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-history {
    color: var(--neutral-color);
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem 1rem;
    line-height: 1.5;
}

.history-item {
    padding: 1rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-item.active {
    background-color: rgba(168, 199, 250, 0.08);
    border-color: var(--md-sys-color-primary);
}

.history-item.comparing {
    background-color: rgba(129, 201, 149, 0.08);
    border-color: var(--success-color);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.history-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
    word-break: break-word;
}

.history-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-item-meta {
    font-size: 0.75rem;
    color: var(--neutral-color);
}

.history-item-device {
    font-size: 0.75rem;
    color: var(--md-sys-color-primary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-item-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success-color);
    margin-top: 2px;
}

/* Main Content area */
.main-content {
    padding: 2rem;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Landing Section */
.landing-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.landing-card {
    background-color: var(--md-sys-color-surface);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--elevation-2);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.main-drop {
    padding: 4rem 2rem;
    margin-bottom: 2rem;
}

.sample-links {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
}

.sample-links p {
    font-size: 0.85rem;
    color: var(--neutral-color);
    margin-bottom: 0.75rem;
}

.sample-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: 16px;
}

.btn-secondary {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-background);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Active Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.active-run-info {
    flex: 1;
    min-width: 250px;
}

.label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neutral-color);
    display: block;
    margin-bottom: 4px;
}

.run-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.run-title-row h2 {
    margin-bottom: 0;
    font-size: 1.25rem;
}

.meta-info {
    font-size: 0.8rem;
    color: var(--neutral-color);
    margin-top: 4px;
}

.comparison-selector {
    min-width: 300px;
}

.comparison-controls {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comparison-selector {
        width: 100%;
        min-width: 0;
    }
    
    .comparison-controls {
        flex-direction: column;
    }
    
    .heuristics-container {
        grid-template-columns: 1fr;
    }
    
    .drop-zone-container, .summary-grid, .heuristics-container {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    .vs-badge {
        margin: -1rem 0;
    }
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--md-sys-color-surface);
    min-width: 220px;
    box-shadow: var(--elevation-2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 6px 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.export-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-background);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background-color var(--transition-speed);
}

.export-item:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-primary);
}

.export-item .material-icons-round {
    font-size: 18px;
    color: var(--neutral-color);
}

.export-item:hover .material-icons-round {
    color: var(--md-sys-color-primary);
}

/* Telemetry Grid & Cards */
.telemetry-highlights-card {
    background-color: var(--md-sys-color-surface);
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.telemetry-item {
    background-color: var(--md-sys-color-surface-variant);
    padding: 1.25rem 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid var(--md-sys-color-primary);
    transition: transform var(--transition-speed);
}

.telemetry-item:hover {
    transform: translateY(-2px);
}

.telemetry-item.status-warn {
    border-left-color: #fdd663;
}

.telemetry-item.status-alert {
    border-left-color: var(--error-color);
}

.telemetry-item.status-good {
    border-left-color: var(--success-color);
}

.telemetry-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.telemetry-item-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--neutral-color);
    font-weight: 600;
}

.telemetry-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
}

.telemetry-item-unit {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--neutral-color);
    margin-left: 4px;
}

.telemetry-item-sub {
    font-size: 0.75rem;
    color: var(--neutral-color);
}

/* Chart Title Group & Controls */
.chart-title-group {
    display: flex;
    flex-direction: column;
}

.chart-subtitle {
    font-size: 0.75rem;
    color: var(--neutral-color);
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-toggle-group {
    display: inline-flex;
    background-color: var(--md-sys-color-surface-variant);
    border-radius: 20px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-toggle {
    background: transparent;
    border: none;
    color: var(--neutral-color);
    padding: 6px 14px;
    border-radius: 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-speed);
}

.btn-toggle .material-icons-round {
    font-size: 16px;
}

.btn-toggle.active {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-weight: 600;
}

/* Table Card Header & Search */
.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-subtitle {
    font-size: 0.8rem;
    color: var(--neutral-color);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    font-size: 18px;
    color: var(--neutral-color);
    pointer-events: none;
}

.search-input {
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 32px 6px 34px;
    color: var(--md-sys-color-on-background);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-speed);
    width: 220px;
}

.search-input:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.2);
    width: 260px;
}

.clear-search {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--neutral-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search .material-icons-round {
    font-size: 16px;
}

/* Subsystem Filter Chips */
.subsystem-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.filter-chip {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-color);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-chip:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--md-sys-color-on-background);
}

.filter-chip.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

/* Sortable Table Headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-speed);
}

th.sortable:hover {
    color: var(--md-sys-color-primary);
}

.sort-icon {
    font-size: 14px;
    vertical-align: middle;
    opacity: 0.4;
    transition: opacity var(--transition-speed);
}

th.sortable:hover .sort-icon {
    opacity: 1;
}

th.sorted-asc .sort-icon,
th.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

/* Heuristic Severity Badges */
.heuristic-list li {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.heuristic-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.severity-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
}

.severity-critical {
    background-color: var(--error-bg);
    color: var(--error-color);
    border: 1px solid rgba(242, 139, 130, 0.3);
}

.severity-warning {
    background-color: rgba(253, 214, 99, 0.1);
    color: #fdd663;
    border: 1px solid rgba(253, 214, 99, 0.3);
}

.severity-info {
    background-color: rgba(168, 199, 250, 0.1);
    color: var(--md-sys-color-primary);
    border: 1px solid rgba(168, 199, 250, 0.3);
}

/* Modal Dialog */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin-bottom: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-description {
    font-size: 0.85rem;
    color: var(--neutral-color);
}

.modal-body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-textarea {
    width: 100%;
    height: 350px;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.modal-html-preview {
    width: 100%;
    height: 350px;
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.6;
    overflow-y: auto;
}

.modal-html-preview h1, .modal-html-preview h2, .modal-html-preview h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--md-sys-color-primary);
}

.modal-html-preview h1 { font-size: 1.25rem; }
.modal-html-preview h2 { font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 4px; }

.modal-html-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8rem;
}

.modal-html-preview th, .modal-html-preview td {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-html-preview th {
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-html-preview ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 80px; /* Below app-bar, or adjust based on layout */
    z-index: 50;
    background-color: var(--md-sys-color-background);
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: var(--neutral-color);
    border: none;
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-background);
}

.tab-btn.active {
    color: var(--md-sys-color-primary);
    background-color: rgba(168, 199, 250, 0.08); /* subtle background highlight */
    border-bottom: 3px solid var(--md-sys-color-primary);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.tab-panel {
    width: 100%;
}

@media (max-width: 768px) {
    .dashboard-tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
    }
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[data-theme="light"] {
    --md-sys-color-background: #f5f5f5;
    --md-sys-color-surface: #ffffff;
    --md-sys-color-surface-variant: #e8eaed;
    --md-sys-color-on-background: #1f1f1f;
    --md-sys-color-on-surface: #444746;
    --md-sys-color-primary: #1a73e8;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d2e3fc;
    --success-color: #1e8e3e;
    --success-bg: rgba(30, 142, 62, 0.1);
    --error-color: #d93025;
    --error-bg: rgba(217, 48, 37, 0.1);
    --neutral-color: #5f6368;
    --elevation-1: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --elevation-2: 0 4px 6px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.04);
}

[data-theme="light"] .total-score {
    background: linear-gradient(90deg, #1a73e8, #174ea6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="light"] .score-dashboard {
    background: rgba(232, 234, 237, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .score-dashboard::before {
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.05) 0%, transparent 100%);
}
[data-theme="light"] .sub-score {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .history-item {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .history-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .history-item.active {
    background-color: rgba(26, 115, 232, 0.08);
    border-color: var(--md-sys-color-primary);
}
[data-theme="light"] tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}
