.schema-conflict-auditor {
    --sca-navy: #0f2742;
    --sca-blue: #2563eb;
    --sca-blue-soft: #eff6ff;
    --sca-cyan: #0891b2;
    --sca-critical: #b42318;
    --sca-warning: #9a6700;
    --sca-info: #175cd3;
    --sca-border: #d8e1ea;
    --sca-surface: #ffffff;
    --sca-muted: #526477;
    max-width: 1240px;
    margin: 0 auto;
}

.schema-auditor-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4rem);
    border: 1px solid #cbd9e7;
    border-radius: 24px;
    background:
        radial-gradient(circle at 88% 12%, rgba(8,145,178,.17), transparent 29%),
        linear-gradient(135deg, #f8fbff 0%, #eef6ff 48%, #f7fbfc 100%);
    box-shadow: 0 18px 50px rgba(15,39,66,.09);
}

.schema-auditor-hero::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -90px;
    bottom: -120px;
    border: 36px solid rgba(37,99,235,.08);
    border-radius: 50%;
    pointer-events: none;
}

.schema-auditor-hero h1 {
    max-width: 850px;
    margin: .3rem 0 1rem;
    color: var(--sca-navy);
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.schema-auditor-hero > p:not(.section-eyebrow) {
    max-width: 840px;
    margin: 0;
    color: #334e68;
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.schema-auditor-hero-badges,
.schema-type-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.25rem;
}

.schema-auditor-hero-badges span,
.schema-type-summary span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: .35rem .72rem;
    border: 1px solid #c9d9e9;
    border-radius: 999px;
    background: rgba(255,255,255,.8);
    color: #24445f;
    font-size: .82rem;
    font-weight: 700;
}

.schema-privacy-notice {
    display: grid;
    gap: .22rem;
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.2rem;
    border: 1px solid #9fd8cd;
    border-left: 5px solid #138a72;
    border-radius: 12px;
    background: #effcf8;
    color: #174f45;
}

.schema-privacy-notice span { color: #31665c; }

.schema-workflow {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.schema-workflow li {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 54px;
    padding: .7rem;
    border: 1px solid var(--sca-border);
    border-radius: 12px;
    background: #fff;
    color: #516578;
    font-size: .82rem;
}

.schema-workflow li span,
.schema-step-number {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9eff5;
    color: #36516a;
    font-weight: 800;
}

.schema-workflow li.is-current,
.schema-workflow li.is-complete {
    border-color: #8bb4ea;
    background: var(--sca-blue-soft);
    color: #173d70;
}

.schema-workflow li.is-current span,
.schema-workflow li.is-complete span,
.schema-step-number {
    background: var(--sca-blue);
    color: #fff;
}

.schema-step-card,
.schema-results-controls,
.schema-table-card,
.schema-export-card {
    margin-bottom: 1.25rem;
    border: 1px solid var(--sca-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15,39,66,.055);
}

.schema-step-heading {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    margin-bottom: 1.2rem;
}

.schema-step-heading h2,
.schema-results-header h2 {
    margin: .1rem 0 .35rem;
    color: var(--sca-navy);
    font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.schema-step-heading p,
.schema-results-header p { margin: 0; color: var(--sca-muted); }
.schema-step-heading .section-eyebrow,
.schema-results-header .section-eyebrow { color: var(--sca-blue); font-weight: 800; }
.schema-step-number { width: 38px; height: 38px; margin-top: .15rem; }

.schema-input-grid,
.schema-config-columns {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 1rem;
}

.schema-drop-zone {
    display: grid;
    min-height: 250px;
    border: 2px dashed #94add0;
    border-radius: 16px;
    background: #f7fbff;
    transition: border-color .18s, background .18s, transform .18s;
}

.schema-drop-zone.is-dragging {
    border-color: var(--sca-blue);
    background: #eaf3ff;
    transform: translateY(-2px);
}

.schema-drop-zone:focus-within {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.schema-drop-label {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: .5rem;
    padding: 1.5rem;
    color: #294b69;
    text-align: center;
    cursor: pointer;
}

.schema-drop-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 1.65rem;
    font-weight: 800;
}

.schema-drop-label span:last-child { color: #61758a; font-size: .85rem; }
#schema-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
#schema-file-input:focus-visible + * { outline: 3px solid #1d4ed8; }

.schema-paste-panel {
    padding: 1rem;
    border: 1px solid var(--sca-border);
    border-radius: 16px;
    background: #fbfdff;
}

.schema-conflict-auditor label,
.schema-checkbox-fieldset legend {
    display: grid;
    gap: .38rem;
    color: #263f57;
    font-size: .88rem;
    font-weight: 750;
}

.schema-conflict-auditor input,
.schema-conflict-auditor select,
.schema-conflict-auditor textarea {
    width: 100%;
    min-height: 44px;
    padding: .68rem .78rem;
    border: 1px solid #aebdca;
    border-radius: 9px;
    background: #fff;
    color: #142f49;
    font: inherit;
}

.schema-conflict-auditor textarea {
    min-height: 150px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.5;
}

.schema-conflict-auditor input:focus-visible,
.schema-conflict-auditor select:focus-visible,
.schema-conflict-auditor textarea:focus-visible,
.schema-conflict-auditor button:focus-visible,
.schema-conflict-auditor [tabindex]:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.schema-inline-fields,
.schema-mapping-grid,
.schema-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin-bottom: .8rem;
}

.schema-mapping-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.schema-filter-grid { grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(150px, 1fr)); }

.schema-button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    margin-top: 1rem;
}

.schema-status {
    min-height: 1.4rem;
    margin-top: .8rem;
    color: #415c75;
    font-size: .9rem;
}

.schema-status.is-error {
    padding: .7rem .85rem;
    border-left: 4px solid var(--sca-critical);
    background: #fff2f0;
    color: #7a271a;
}

.schema-status.is-success {
    padding: .7rem .85rem;
    border-left: 4px solid #18864b;
    background: #effbf4;
    color: #176b3a;
}

.schema-checkbox-fieldset {
    margin: 1rem 0 0;
    padding: 1rem;
    border: 1px solid var(--sca-border);
    border-radius: 12px;
}

.schema-checkbox-fieldset legend { padding: 0 .35rem; }
.schema-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem .8rem;
}
.schema-checkbox-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schema-checkbox-grid label {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    min-height: 36px;
    font-size: .83rem;
    font-weight: 600;
}
.schema-checkbox-grid input { width: 18px; min-height: 18px; margin-top: .1rem; accent-color: var(--sca-blue); }
.schema-mini-actions { display: flex; gap: .7rem; margin-top: .7rem; }
.schema-mini-actions button { padding: 0; border: 0; background: none; color: #1d5fbf; text-decoration: underline; cursor: pointer; font: inherit; font-size: .82rem; }

.schema-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .7rem;
    margin: .9rem 0;
}
.schema-metric {
    min-width: 0;
    padding: .9rem;
    border: 1px solid var(--sca-border);
    border-radius: 12px;
    background: #f9fbfd;
}
.schema-metric strong { display: block; color: var(--sca-navy); font-size: 1.55rem; line-height: 1.1; }
.schema-metric span { display: block; margin-top: .3rem; color: #5d7185; font-size: .78rem; font-weight: 700; }
.schema-metric.metric-critical { border-color: #efb4ae; background: #fff5f4; }
.schema-metric.metric-critical strong { color: var(--sca-critical); }
.schema-metric.metric-warning { border-color: #ead295; background: #fffbeb; }
.schema-metric.metric-warning strong { color: var(--sca-warning); }

.schema-progress { margin-top: 1rem; }
.schema-progress-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e5edf5; }
.schema-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sca-blue), var(--sca-cyan)); transition: width .2s ease; }
.schema-progress p { margin: .45rem 0 0; color: var(--sca-muted); }

.schema-results { scroll-margin-top: 1rem; }
.schema-results-header,
.schema-export-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 1.8rem 0 1rem;
}
.schema-result-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.schema-results-controls { padding: 1rem; }

.schema-view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding-top: .85rem;
    border-top: 1px solid var(--sca-border);
}
.schema-view-tabs button {
    min-height: 40px;
    padding: .55rem .8rem;
    border: 1px solid #b8c6d4;
    border-radius: 8px;
    background: #fff;
    color: #304b63;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.schema-view-tabs button[aria-selected="true"] { border-color: #2563eb; background: #eaf2ff; color: #174ea6; }

.schema-table-meta,
.schema-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
}
.schema-table-meta { margin-bottom: .7rem; }
.schema-table-meta p { margin: 0; color: var(--sca-muted); font-size: .88rem; }
.schema-table-meta label { display: flex; align-items: center; gap: .45rem; }
.schema-table-meta select { width: auto; min-height: 38px; }
.schema-table-wrap { overflow-x: auto; border: 1px solid var(--sca-border); border-radius: 10px; }
.schema-table-wrap table { width: 100%; min-width: 860px; border-collapse: collapse; background: #fff; }
.schema-table-wrap th,
.schema-table-wrap td { padding: .72rem .78rem; border-bottom: 1px solid #e5ebf0; text-align: left; vertical-align: top; font-size: .82rem; line-height: 1.45; }
.schema-table-wrap th { position: sticky; top: 0; z-index: 1; background: #f1f5f9; color: #263f57; font-weight: 800; white-space: nowrap; }
.schema-table-wrap tbody tr:hover { background: #f8fbff; }
.schema-table-wrap code { overflow-wrap: anywhere; color: #173d70; font-size: .77rem; }
.schema-table-wrap .schema-cell-clamp { display: -webkit-box; max-width: 320px; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.schema-table-wrap .schema-evidence-button { padding: .35rem .55rem; border: 1px solid #9fb2c5; border-radius: 6px; background: #fff; color: #174ea6; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 750; }
.schema-pagination { justify-content: center; margin-top: .85rem; }

.schema-severity {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .5rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.schema-severity::before { content: "●"; font-size: .58rem; }
.schema-severity-critical { color: var(--sca-critical); background: #fff3f1; }
.schema-severity-warning { color: var(--sca-warning); background: #fff9e8; }
.schema-severity-info { color: var(--sca-info); background: #eff6ff; }

.schema-detail-dialog {
    width: min(920px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: #18344d;
    box-shadow: 0 28px 90px rgba(7,25,43,.34);
}
.schema-detail-dialog::backdrop { background: rgba(7,25,43,.62); }
.schema-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--sca-border); background: #fff; }
.schema-dialog-header h2 { margin: 0; font-size: 1.35rem; }
.schema-dialog-header button { width: 42px; height: 42px; border: 1px solid #aebdca; border-radius: 8px; background: #fff; color: #233f58; cursor: pointer; font-size: 1.5rem; }
#schema-detail-content { padding: 1.2rem; }
#schema-detail-content h3 { margin: 1.25rem 0 .5rem; color: var(--sca-navy); }
#schema-detail-content pre { max-height: 340px; overflow: auto; padding: 1rem; border-radius: 10px; background: #0d2135; color: #e8f2fa; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; line-height: 1.55; }
#schema-detail-content dl { display: grid; grid-template-columns: minmax(120px, .3fr) minmax(0, 1fr); gap: .4rem .8rem; }
#schema-detail-content dt { font-weight: 800; }
#schema-detail-content dd { margin: 0; overflow-wrap: anywhere; }

.schema-export-card { padding: 1.1rem; }
.schema-export-card h3 { margin: 0 0 .3rem; }
.schema-export-card p { margin: 0; color: var(--sca-muted); }
.schema-export-card .schema-button-row { justify-content: flex-end; margin-top: 0; }
.schema-explainer code { padding: .1rem .3rem; border-radius: 4px; background: #edf2f7; }

@media (prefers-reduced-motion: reduce) {
    .schema-conflict-auditor *, .schema-conflict-auditor *::before, .schema-conflict-auditor *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 980px) {
    .schema-workflow { grid-template-columns: repeat(5, minmax(125px, 1fr)); overflow-x: auto; padding-bottom: .35rem; }
    .schema-input-grid,
    .schema-config-columns { grid-template-columns: 1fr; }
    .schema-mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schema-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schema-metric-grid,
    .schema-result-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .schema-export-card { align-items: flex-start; flex-direction: column; }
    .schema-export-card .schema-button-row { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .schema-auditor-hero { padding: 1.5rem 1.1rem; border-radius: 16px; }
    .schema-auditor-hero h1 { font-size: 2.05rem; }
    .schema-step-card { padding: 1rem; }
    .schema-workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .schema-workflow li:last-child { grid-column: 1 / -1; }
    .schema-step-heading { gap: .6rem; }
    .schema-inline-fields,
    .schema-mapping-grid,
    .schema-filter-grid,
    .schema-checkbox-grid,
    .schema-checkbox-grid-compact { grid-template-columns: 1fr; }
    .schema-metric-grid,
    .schema-result-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schema-results-header { align-items: flex-start; flex-direction: column; }
    .schema-button-row .btn { width: 100%; justify-content: center; }
    .schema-table-meta { align-items: flex-start; flex-direction: column; }
    #schema-detail-content dl { grid-template-columns: 1fr; }
    #schema-detail-content dd { margin-bottom: .45rem; }
}
