:root {
    --cd-accent: #10b981;
    --cd-navy: #1e2a4a;
    --cd-border: #d1d5db;
}

.ic-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 16px;
    line-height: 1.6;
}

.ic-actionbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ic-btn {
    background: var(--cd-navy);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ic-btn:hover {
    background: #16213e;
}

.ic-btn-outline {
    background: #fff;
    color: var(--cd-navy);
    border: 1px solid var(--cd-border);
}

.ic-btn-outline:hover {
    border-color: var(--cd-navy);
    background: #f9fafb;
}

.cd-select-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--cd-navy);
    background: #fff;
    border: 1px solid var(--cd-border);
    border-radius: 7px;
    padding: 9px 12px;
}

.cd-select {
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--cd-navy);
    cursor: pointer;
}

.cd-select:focus {
    outline: none;
}

.cd-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cd-navy);
    background: #fff;
    border: 1px solid var(--cd-border);
    border-radius: 7px;
    padding: 9px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.cd-check input {
    accent-color: var(--cd-accent);
    cursor: pointer;
}

.cd-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--cd-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}

.cd-panel {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cd-panel:first-child {
    border-right: 1px solid var(--cd-border);
}

.cd-panel-header {
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid var(--cd-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--cd-navy);
}

.cd-textarea {
    flex: 1;
    min-height: 220px;
    border: none;
    resize: vertical;
    padding: 14px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cd-navy);
    background: #fff;
}

.cd-textarea:focus {
    outline: none;
}

.cd-stats {
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid var(--cd-border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cd-navy);
    text-align: center;
}

.cd-stats .cd-added-count { color: #0d9668; }
.cd-stats .cd-removed-count { color: #b91c1c; }

.cd-diff-panel {
    background: #fff;
    border: 1px solid var(--cd-border);
    border-radius: 10px;
    overflow: hidden;
}

.cd-diff-header {
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid var(--cd-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--cd-navy);
}

.cd-diff-output {
    max-height: 600px;
    overflow-y: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
}

/* Unified view rows */
.cd-line {
    display: flex;
    white-space: pre;
}

.cd-line-num {
    flex-shrink: 0;
    width: 44px;
    text-align: right;
    padding: 2px 8px;
    color: #9ca3af;
    background: #f9fafb;
    border-right: 1px solid var(--cd-border);
    user-select: none;
}

.cd-line-content {
    flex: 1;
    padding: 2px 10px;
    overflow-x: auto;
}

.cd-line.cd-equal .cd-line-content { color: #374151; }
.cd-line.cd-delete { background: #fef2f2; }
.cd-line.cd-delete .cd-line-content { color: #b91c1c; }
.cd-line.cd-delete .cd-line-num { background: #fee2e2; }
.cd-line.cd-insert { background: #ecfdf5; }
.cd-line.cd-insert .cd-line-content { color: #0d9668; }
.cd-line.cd-insert .cd-line-num { background: #d1fae5; }

/* Side-by-side view */
.cd-sbs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.cd-sbs-cell {
    display: flex;
    white-space: pre;
    border-right: 1px solid var(--cd-border);
}

.cd-sbs-cell:last-child {
    border-right: none;
}

.cd-sbs-cell.cd-empty {
    background: #f9fafb;
}

@media (max-width: 720px) {
    .cd-panels,
    .cd-sbs-row {
        grid-template-columns: 1fr;
    }

    .cd-panel:first-child {
        border-right: none;
        border-bottom: 1px solid var(--cd-border);
    }

    .cd-textarea {
        min-height: 160px;
    }

    .ic-actionbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ic-actionbar .ic-btn,
    .ic-actionbar .ic-btn-outline,
    .ic-actionbar .cd-select-label,
    .ic-actionbar .cd-check {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}
