* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
    background-color: #f4f5f7;
    margin: 0;
    padding: 0;
    color: #222;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.app-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.app-subtitle {
    color: #666;
    margin-top: 0;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.description {
    color: #444;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed #bbb;
    border-radius: 6px;
    background: #fafafa;
}

.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #eee;
    color: #333;
    margin-top: 12px;
}

.error-box {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #a12622;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.result-summary p {
    margin: 4px 0;
}

.claude-analysis pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    line-height: 1.6;
    background: #f7f9fc;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e3e7ee;
}

.diff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.diff-table th,
.diff-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 10px;
    text-align: left;
}

.diff-table th {
    background: #f0f2f5;
}

.diff-row.diff-ValueMismatch {
    background: #fff8e1;
}

.diff-row.diff-RowOnlyInA,
.diff-row.diff-ColumnOnlyInA,
.diff-row.diff-SheetOnlyInA {
    background: #e8f4ff;
}

.diff-row.diff-RowOnlyInB,
.diff-row.diff-ColumnOnlyInB,
.diff-row.diff-SheetOnlyInB {
    background: #ffeef0;
}

.mode-switch {
    margin-top: 16px;
    font-size: 14px;
    color: #555;
}

.header-notice {
    background: #eef6ff;
    border: 1px solid #bcd9f7;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.header-notice p {
    margin: 4px 0;
    font-size: 14px;
    color: #1d4ed8;
}

.header-notice-sub {
    color: #555 !important;
    font-size: 13px !important;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group.type-group {
    flex: 0 0 180px;
}

.form-group select {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 9px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.field-validation-error {
    display: block;
    color: #a12622;
    font-size: 13px;
    margin-top: 4px;
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.topbar form {
    display: inline;
}

.topbar .btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.card h3 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.sub-label {
    font-weight: 600;
    font-size: 14px;
    margin: 16px 0 8px;
}

.sub-label:first-of-type {
    margin-top: 4px;
}

/* 컬럼 선택 화면: 번호가 매겨진 각 단계를 색깔 있는 구획으로 나눠서 한눈에 구분되도록 함 */
.config-section {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 18px 20px 20px;
    margin-bottom: 18px;
}

.config-section h3 {
    margin-top: 0;
}

.config-section:last-of-type {
    margin-bottom: 24px;
}

.config-section-1 { background: #e8f5e9; border-color: #a5d6a7; }
.config-section-2 { background: #e3f2fd; border-color: #90caf9; }
.config-section-3 { background: #fff3e0; border-color: #ffcc80; }
.config-section-4 { background: #fffde7; border-color: #fff59d; }
.config-section-5 { background: #f3e5f5; border-color: #ce93d8; }
.config-section-6 { background: #fce4ec; border-color: #f48fb1; }
.config-section-7 { background: #e0f7fa; border-color: #80deea; }
.config-section-8 { background: #e8eaf6; border-color: #9fa8da; }
.config-section-9 { background: #e0f2f1; border-color: #80cbc4; }

.hint {
    font-size: 13px;
    color: #777;
    margin-top: -4px;
    margin-bottom: 10px;
}

.btn-add-column {
    display: inline-block;
    background: none;
    border: 1px dashed #999;
    color: #444;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
}

.btn-add-column:hover {
    background: #f2f2f2;
}

.hidden-row {
    display: none;
}

.checkbox-group {
    background: #f7f9fc;
    border: 1px solid #e3e7ee;
    border-radius: 6px;
    padding: 12px 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-group .hint {
    margin-top: 8px;
    margin-bottom: 0;
}

.summary-item.ai-matched {
    background: #eef6ff;
    border-color: #bcd9f7;
}

.summary-item.mask-matched {
    background: #f2f9f0;
    border-color: #b7dfa8;
}

.summary-item.model-matched {
    background: #fdf2f8;
    border-color: #f3b6d9;
}

.ai-badge {
    display: inline-block;
    background: #1d4ed8;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.mask-badge {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.model-badge {
    display: inline-block;
    background: #be185d;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.legend-highlight {
    background-color: #fff59d;
    padding: 1px 5px;
    border-radius: 3px;
    color: #665c00;
}

.option-highlight {
    background-color: #fff59d;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.processing-box {
    text-align: center;
    padding: 32px 40px;
    max-width: 420px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #2563eb;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
}

.processing-sub {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.summary-item {
    background: #f7f9fc;
    border: 1px solid #e3e7ee;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.summary-item .label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.summary-item .value {
    display: block;
    font-size: 18px;
    font-weight: 700;
}

.summary-item.warn {
    background: #fff8e1;
    border-color: #f3d97a;
}

.summary-item.duplicate-warn {
    background: #fdf0ff;
    border-color: #e0b3f0;
}

.summary-item.diff-nonzero .value {
    color: #c0392b;
}

.diff-row.diff-Matched {
    background: #f2f9f0;
}

.diff-row.diff-Mismatched {
    background: #fff8e1;
}

.diff-row.diff-OnlyInA {
    background: #e8f4ff;
}

.diff-row.diff-OnlyInB {
    background: #ffeef0;
}

.diff-row.diff-DuplicateA,
.diff-row.diff-DuplicateB {
    background: #fbeeff;
}

.diff-highlight {
    background: #e53935 !important;
    color: #fff !important;
    font-weight: 700;
}

/* "빡치기!" 버튼 - 화끈하고 강렬하게, 은은하게 펄스로 끓어오르는 느낌 */
.btn-rage {
    display: inline-block;
    padding: 16px 40px;
    border: none;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ff512f 0%, #dd2476 60%, #ff0844 100%);
    background-size: 200% 200%;
    box-shadow: 0 6px 18px rgba(221, 36, 118, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: rage-pulse 1.3s ease-in-out infinite, rage-gradient 3s ease infinite;
}

.btn-rage:hover {
    transform: scale(1.06) rotate(-1deg);
    box-shadow: 0 8px 26px rgba(255, 8, 68, 0.75);
}

.btn-rage:active {
    transform: scale(0.96) rotate(0deg);
}

@keyframes rage-pulse {
    0%, 100% {
        box-shadow: 0 6px 18px rgba(221, 36, 118, 0.55);
    }
    50% {
        box-shadow: 0 6px 30px rgba(255, 81, 47, 0.9);
    }
}

@keyframes rage-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
