.excel-compare-shell {
    --added-bg: #dcfce7;
    --removed-bg: #fee2e2;
    --modified-bg: #fef9c3;
    --unchanged-bg: #e5e7eb;
    --format-bg: #ede9fe;
    --panel-border: #d1d5db;
}

.drop-zone {
    border: 2px dashed #9ca3af;
    border-radius: 10px;
    padding: 20px;
    background: #f8fafc;
    text-align: center;
    transition: all 0.2s ease;
}

.drop-zone.drag-over,
.drop-zone:hover {
    border-color: #0d6efd;
    background: #eff6ff;
}

.stat-box {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #ffffff;
}

.stat-box .label {
    display: block;
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 3px;
}

.stat-box .value {
    display: block;
    font-weight: 700;
    font-size: 1.15rem;
    color: #111827;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.legend-item {
    font-size: 0.87rem;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    display: inline-block;
}

.swatch-added { background: var(--added-bg); }
.swatch-removed { background: var(--removed-bg); }
.swatch-modified { background: var(--modified-bg); }
.swatch-unchanged { background: var(--unchanged-bg); }

.compact-diff-wrap {
    max-height: 560px;
    overflow: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
}

.compact-diff-table {
    table-layout: fixed;
    font-size: 0.82rem;
}

.compact-diff-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    white-space: nowrap;
}

.compact-diff-table td {
    padding: 0.3rem 0.45rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-color: #e5e7eb;
}

.compact-diff-table .value-cell {
    white-space: pre;
}

.diff-item-row {
    cursor: pointer;
}

.diff-item-row.diff-added { background: var(--added-bg); }
.diff-item-row.diff-removed { background: var(--removed-bg); }
.diff-item-row.diff-modified { background: var(--modified-bg); }
.diff-item-row.diff-format { background: var(--format-bg); }

.diff-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.compare-panel {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: #ffffff;
    padding: 8px 10px;
    min-height: 70px;
}

.panel-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 4px;
}

.panel-value {
    font-size: 0.9rem;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-word;
}

.focused-diff {
    outline: 2px solid #2563eb;
    outline-offset: -1px;
}

.excel-compare-shell.dark-mode {
    background: #0b1220;
    color: #dbeafe;
    border-radius: 10px;
    padding: 10px;
}

.excel-compare-shell.dark-mode .card,
.excel-compare-shell.dark-mode .stat-box,
.excel-compare-shell.dark-mode .compare-panel,
.excel-compare-shell.dark-mode .table {
    background: #111827;
    color: #d1d5db;
    border-color: #374151;
}

.excel-compare-shell.dark-mode .card-header {
    background: #1f2937;
    color: #e5e7eb;
}

.excel-compare-shell.dark-mode .drop-zone {
    background: #111827;
    border-color: #4b5563;
    color: #d1d5db;
}

.excel-compare-shell.dark-mode .drop-zone.drag-over,
.excel-compare-shell.dark-mode .drop-zone:hover {
    background: #1e293b;
    border-color: #60a5fa;
}

.excel-compare-shell.dark-mode .compact-diff-wrap {
    border-color: #374151;
    background: #111827;
}

.excel-compare-shell.dark-mode .compact-diff-table thead th {
    background: #1f2937;
    border-bottom-color: #374151;
}

.excel-compare-shell.dark-mode .compact-diff-table td {
    border-color: #374151;
}

.excel-compare-shell.dark-mode .panel-title,
.excel-compare-shell.dark-mode .legend-item,
.excel-compare-shell.dark-mode .small,
.excel-compare-shell.dark-mode .text-muted {
    color: #9ca3af !important;
}

@media (max-width: 767px) {
    .drop-zone {
        padding: 16px;
    }

    .panel-value {
        font-size: 0.86rem;
    }
}
