.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* FHIR IG Comparison */
body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    color: #1a1a1a;
    background: #f6f8fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.app-header h1 {
    margin-bottom: 0.25rem;
}

.text-muted {
    color: #57606a;
}

.spike-status {
    font-size: 0.875rem;
}

.actions {
    margin: 1.5rem 0;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: #0969da;
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #eaeef2;
    color: #24292f;
}

.btn-outline-primary {
    background: transparent;
    border-color: #0969da;
    color: #0969da;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.alert-danger {
    background: #ffebe9;
    border: 1px solid #ff8182;
    color: #82071e;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table th,
.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #d8dee4;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #f6f8fa;
    font-weight: 600;
}

.row-invalid {
    background: #fff8f0;
}

.validation-errors {
    margin: 0;
    padding-left: 1.25rem;
    color: #bc4c00;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bg-success { background: #dafbe1; color: #116329; }
.bg-primary { background: #ddf4ff; color: #0550ae; }
.bg-secondary { background: #eaeef2; color: #57606a; }
.bg-warning { background: #fff8c5; color: #7d4e00; }
.filters {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.canonical {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.canonical-link {
    color: #0969da;
    text-decoration: none;
}

.canonical-link:hover {
    text-decoration: underline;
}

.comparison-matrix td.ig-col .canonical-link {
    color: #0969da;
}

.match-row.selected {
    background: #ddf4ff;
}

.diff-scroll {
    max-height: 60vh;
    overflow: auto;
}

.cell-mismatch {
    background: #ffebe9;
}

.mismatch-row td:first-child {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
}

section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(246, 248, 250, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.loading-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
}

.loading-title {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}

.loading-context {
    margin: 0 0 1rem;
    color: #57606a;
    font-size: 0.9rem;
    line-height: 1.45;
}

.loading-detail {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #57606a;
    font-variant-numeric: tabular-nums;
}

.loading-bar {
    width: 100%;
    height: 8px;
    margin-bottom: 0.35rem;
}

.loading-bar-overall {
    accent-color: #0969da;
}

.loading-percent {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #24292f;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.loading-indeterminate {
    height: 8px;
    background: linear-gradient(90deg, #0969da 25%, #ddf4ff 50%, #0969da 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 1rem;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #57606a;
}

/* Virtualized matches table */
.matches-table-wrapper .matches-table {
    margin-bottom: 0;
}

.matches-virtual-scroll {
    max-height: 28rem;
    overflow-y: auto;
    border: 1px solid #d8dee4;
    border-radius: 0 0 8px 8px;
}

.matches-virtual-scroll .matches-table {
    margin-top: 0;
    box-shadow: none;
    border-radius: 0;
}

/* Comparison mode switcher */
.comparison-mode .mode-switcher {
    display: inline-flex;
    gap: 0;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    border-right: 1px solid #d0d7de;
}

.mode-option:last-child {
    border-right: none;
}

.mode-option:has(input:checked) {
    background: #ddf4ff;
    color: #0550ae;
    font-weight: 600;
}

.mode-option input {
    margin: 0;
}

/* Manual comparison panel */
.manual-comparison .manual-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 12rem;
}

.filter-field span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #57606a;
}

.form-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    max-width: 100%;
}

.manual-selection-table .form-select {
    width: 100%;
    font-size: 0.85rem;
}

.manual-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.manual-hint {
    margin: 0;
    font-size: 0.875rem;
    color: #57606a;
}

.manual-message {
    margin-top: 0.75rem;
    color: #bc4c00;
    font-size: 0.9rem;
}

.diff-summary {
    margin-bottom: 0.5rem;
}

.diff-selection-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.diff-selection-list li {
    margin-bottom: 0.25rem;
}

/* Profile comparison matrix */
.profile-comparison {
    margin-top: 1.5rem;
}

.version-warning {
    margin-bottom: 1rem;
}

.profile-summary-scroll {
    margin-bottom: 1.5rem;
}

.profile-summary-table th:first-child,
.profile-summary-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
    width: 10rem;
}

.comparison-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dimension-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 0.25rem;
    background: #fff;
}

.dimension-tab {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    color: #57606a;
}

.dimension-tab.active {
    background: #ddf4ff;
    color: #0550ae;
    font-weight: 600;
}

.row-filter {
    min-width: 14rem;
    max-width: 22rem;
}

.row-filter label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #57606a;
    margin-bottom: 0.25rem;
}

.filter-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #57606a;
    line-height: 1.35;
}

.matrix-meta {
    margin-bottom: 0.5rem;
}

.comparison-matrix-wrapper {
    border: 1px solid #d8dee4;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.comparison-matrix-scroll {
    max-height: 50vh;
    overflow: auto;
}

.comparison-matrix {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    table-layout: fixed;
    width: 100%;
}

.comparison-matrix col.col-element-id {
    width: 28%;
}

.comparison-matrix col.col-compat {
    width: 6.5rem;
}

.comparison-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f6f8fa;
    box-shadow: 0 1px 0 #d8dee4;
}

.comparison-matrix .element-col {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.comparison-matrix th.ig-col {
    text-align: right;
}

.comparison-matrix td.ig-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-matrix th.compat-col,
.comparison-matrix td.compat-col {
    font-weight: 600;
    text-align: center;
}

.comparison-matrix td.compat-col {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-diff {
    background: #fff8c5;
}

.compat-conflict {
    background: #ffebe9;
    color: #82071e;
}

.compat-warning {
    background: #fff8c5;
    color: #7d4e00;
}

.compat-ok {
    background: #dafbe1;
    color: #116329;
}

/* Getting started intro */
.getting-started {
    margin-bottom: 1.5rem;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    overflow: hidden;
}

.getting-started-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
}

.getting-started:has(.getting-started-panel) .getting-started-bar {
    border-bottom: 1px solid #d0d7de;
}

.getting-started:not(:has(.getting-started-panel)) .getting-started-bar {
    border-bottom: none;
}

.getting-started-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #24292f;
}

.getting-started-toggle {
    flex-shrink: 0;
}

.getting-started-panel {
    padding: 1rem 1.25rem 1.25rem;
}

.getting-started-lede {
    margin: 0 0 0.75rem;
    max-width: 72ch;
    line-height: 1.5;
    color: #24292f;
}

.getting-started-note {
    margin: 0 0 1.25rem;
    padding: 0.65rem 0.85rem;
    max-width: 72ch;
    font-size: 0.9rem;
    line-height: 1.45;
    background: #fff8c5;
    border: 1px solid #d4a72c;
    border-radius: 6px;
    color: #7d4e00;
}

.getting-started-steps {
    margin: 0;
    padding-left: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.getting-started-steps > li {
    padding-left: 0.35rem;
}

.getting-started-steps h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #24292f;
}

.getting-started-steps p {
    margin: 0 0 0.5rem;
    max-width: 72ch;
    line-height: 1.5;
    color: #57606a;
    font-size: 0.9rem;
}

.getting-started-meta {
    margin-bottom: 0 !important;
    font-size: 0.85rem !important;
}

.getting-started-code {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.45;
}

.getting-started-code code {
    color: #24292f;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
}

.getting-started-tree code {
    tab-size: 2;
}

@media (max-width: 640px) {
    .getting-started-bar {
        flex-wrap: wrap;
    }

    .getting-started-panel {
        padding: 0.85rem 1rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .getting-started-panel {
        animation: none;
    }
}

/* Site footer */
.app-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 2.5rem;
    border-top: 1px solid #d0d7de;
}

.app-footer-text {
    margin: 0;
    font-size: 0.875rem;
    color: #57606a;
    line-height: 1.5;
}

.app-footer-link {
    color: #0969da;
    text-decoration: none;
    font-weight: 500;
}

.app-footer-link:hover {
    text-decoration: underline;
}

.app-footer-link:focus-visible {
    outline: 2px solid #0969da;
    outline-offset: 2px;
    border-radius: 2px;
}