.workspace-mark.invoice-reconciliation,
.tool-card-mark.invoice-reconciliation {
    background: linear-gradient(145deg, #1d4ed8, #4f46e5);
    color: #fff;
}

.ir-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    border: 1px solid #c7d7f5;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 58%, #eef2ff 100%);
}

.ir-eyebrow {
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
}

.ir-hero h2 { margin: 6px 0 8px; color: #183153; font-size: 25px; }
.ir-hero p { max-width: 760px; margin: 0; color: #53657c; line-height: 1.7; }

.ir-local {
    flex: 0 0 auto;
    padding: 12px 18px;
    border: 1px solid #b8c9ee;
    border-radius: 12px;
    background: rgba(255, 255, 255, .86);
    color: #5b6f8c;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.ir-local b { color: #1d4ed8; }

.ir-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0;
    color: #53657c;
    font-size: 13px;
}

.ir-steps span { display: inline-flex; align-items: center; gap: 7px; }
.ir-steps b {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
}
.ir-steps i { color: #9aabc3; font-style: normal; }

.ir-service,
.ir-progress,
.ir-result {
    margin: 16px 0;
    padding: 13px 16px;
    border: 1px solid #dae3ef;
    border-radius: 12px;
    background: #f8fafc;
    color: #526278;
}

.ir-service.ready,
.ir-result.success { border-color: #a7d9c0; background: #f0fdf6; color: #166534; }
.ir-service.error,
.ir-progress.error,
.ir-result.error { border-color: #fecaca; background: #fff7f7; color: #b42318; }

.ir-form,
.ir-review {
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(30, 64, 175, .06);
}

.ir-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
}

.ir-upload-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1.5px dashed #9ab3e7;
    border-radius: 14px;
    background: #f8fbff;
}

.ir-upload-card:hover,
.ir-upload-card:focus-within { border-color: #2563eb; background: #f2f7ff; }
.ir-upload-card input { display: none; }
.ir-upload-head { display: flex; align-items: center; gap: 12px; }
.ir-upload-mark {
    display: grid;
    flex: 0 0 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #1d4ed8;
    color: #fff;
    font-weight: 800;
}
.ir-upload-copy { min-width: 0; }
.ir-upload-copy strong { display: block; color: #1d3152; }
.ir-upload-copy small { display: block; margin-top: 4px; color: #6b7c93; line-height: 1.5; }
.ir-file-name { min-height: 20px; color: #47566d; font-size: 13px; overflow-wrap: anywhere; }
.ir-file-name.invalid { color: #b42318; }

.ir-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-top: 1px solid #edf1f6;
    color: #66758a;
    font-size: 13px;
}

.ir-progress > div { display: flex; justify-content: space-between; gap: 16px; }
.ir-progress progress { width: 100%; height: 8px; margin-top: 10px; accent-color: #2563eb; }

.ir-review { margin-top: 18px; overflow: hidden; scroll-margin-top: 82px; }
.ir-review-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 22px 14px; }
.ir-review-head span { color: #1d4ed8; font-size: 12px; font-weight: 700; }
.ir-review-head h3 { margin: 3px 0 0; color: #1d3152; }
.ir-review-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.ir-review-actions .btn-primary { white-space: nowrap; }

.ir-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 0 22px 18px;
}
.ir-summary article { padding: 13px 14px; border-radius: 12px; background: #f4f7fb; }
.ir-summary small { display: block; color: #708096; }
.ir-summary strong { display: block; margin-top: 4px; color: #183d76; font-size: 20px; }
.ir-summary article.warning { background: #fff7e8; }
.ir-summary article.warning strong { color: #b45309; }

.ir-scope,
.ir-issues {
    margin: 0 22px 16px;
    padding: 12px 14px;
    border-radius: 10px;
    line-height: 1.65;
}
.ir-scope { border: 1px solid #cddbf3; background: #f5f8fe; color: #53657d; }
.ir-scope strong { color: #1d4ed8; }
.ir-issues { border: 1px solid #fed7aa; background: #fffaf2; color: #9a5412; }
.ir-issues ul { margin: 6px 0 0; padding-left: 20px; }

.ir-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 22px;
    border-top: 1px solid #e8edf5;
    background: #fafcff;
    color: #66758a;
    font-size: 13px;
}
.ir-filters { display: flex; gap: 8px; }
.ir-filter {
    padding: 6px 10px;
    border: 1px solid #cbd7ea;
    border-radius: 999px;
    background: #fff;
    color: #52657e;
    cursor: pointer;
}
.ir-filter.active { border-color: #2563eb; background: #2563eb; color: #fff; }

.ir-table-guide {
    padding: 8px 22px;
    border-top: 1px solid #e8edf5;
    background: #f8fafc;
    color: #718096;
    font-size: 12px;
}
.ir-table-wrap {
    position: relative;
    max-height: min(62vh, 680px);
    overflow: auto;
    border-top: 1px solid #e8edf5;
    background: #fff;
}
.ir-table { width: 100%; min-width: 1120px; border-collapse: separate; border-spacing: 0; }
.ir-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 13px;
    background: #f5f8fc;
    color: #607087;
    font-size: 12px;
    text-align: left;
}
.ir-table td { padding: 13px; border-top: 1px solid #edf1f6; color: #35475f; font-size: 13px; vertical-align: top; }
.ir-table tr.discrepancy { background: #fffdf5; }
.ir-table th:first-child,
.ir-table td:first-child { left: 0; width: 72px; min-width: 72px; }
.ir-table th:nth-child(2),
.ir-table td:nth-child(2) { left: 72px; min-width: 150px; }
.ir-table th:first-child,
.ir-table th:nth-child(2) { z-index: 4; }
.ir-table td:first-child,
.ir-table td:nth-child(2) { position: sticky; z-index: 1; background: #fff; }
.ir-table tr.discrepancy td:first-child,
.ir-table tr.discrepancy td:nth-child(2) { background: #fffdf5; }
.ir-status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #eaf8f0; color: #166534; font-weight: 700; }
.ir-status.warning { background: #fff0d5; color: #a6530a; }
.ir-cell-stack { display: grid; gap: 5px; min-width: 170px; }
.ir-cell-stack small { color: #7a899e; line-height: 1.45; }
.ir-cell-stack strong { overflow-wrap: anywhere; }
.ir-differences { min-width: 180px; color: #98510e; line-height: 1.55; }
.ir-scope-cell { min-width: 270px; color: #607087; line-height: 1.55; }
.ir-rule-note { padding: 11px 22px; border-top: 1px solid #edf1f6; background: #fafcff; color: #66758a; font-size: 12px; }

@media (max-width: 920px) {
    .ir-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .ir-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
    .ir-steps { align-items: flex-start; flex-direction: column; }
    .ir-steps i { display: none; }
    .ir-upload-grid { grid-template-columns: 1fr; }
    .ir-submit-row, .ir-review-head, .ir-toolbar { align-items: stretch; flex-direction: column; }
    .ir-review-actions { align-items: stretch; justify-content: flex-end; }
    .ir-table th:nth-child(2), .ir-table td:nth-child(2) { position: static; }
    .ir-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 500px) {
    .ir-hero { padding: 19px 17px; }
    .ir-hero h2 { font-size: 20px; }
    .ir-upload-grid { padding: 14px; }
    .ir-summary { grid-template-columns: 1fr; padding-inline: 16px; }
    .ir-scope, .ir-issues { margin-inline: 16px; }
    .ir-filters { flex-wrap: wrap; }
}
