:root {
    --mr-catalyst-red: #BA2025;
    --mr-catalyst-red-hover: color-mix(in srgb, var(--mr-catalyst-red) 88%, #000);
    --mr-catalyst-red-tint: color-mix(in srgb, var(--mr-catalyst-red) 8%, #fff);
    --mr-deep-navy: #182D3D;
    --mr-warm-yellow: #F8B323;
    --mr-charcoal: #333638;
    --mr-light-grey: #F1F1F1;
    --mr-icon-green: #7FA050;
    --mr-grey-200: color-mix(in srgb, var(--mr-charcoal) 12%, #fff);
    --mr-grey-400: color-mix(in srgb, var(--mr-charcoal) 38%, #fff);
    --mr-grey-600: color-mix(in srgb, var(--mr-charcoal) 65%, #fff);
    --mr-border-subtle: var(--mr-grey-200);
    --mr-border-strong: var(--mr-grey-400);
}

.mr-field {
    font-size: 14px;
    color: var(--mr-charcoal);
}

.mr-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 8px;
}

.mr-head__label {
    font-size: 13px;
    color: var(--mr-grey-600);
}

.mr-head__count {
    font-size: 12px;
    color: var(--mr-grey-600);
    background: var(--mr-light-grey);
    border-radius: 4px;
    padding: 0 6px;
    line-height: 18px;
}

.mr-head__sep {
    width: 1px;
    height: 12px;
    background: var(--mr-border-subtle);
}

.mr-tally {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--mr-grey-600);
}

.mr-tally::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mr-grey-400);
}

.mr-tally--ok::before {
    background: var(--mr-icon-green);
}

.mr-tally--warn::before {
    background: var(--mr-warm-yellow);
}

.mr-tally--fail::before {
    background: var(--mr-catalyst-red);
}

.mr-head__spacer {
    flex: 1 1 30px;
}

.mr-link-btn {
    font: inherit;
    font-size: 12px;
    color: var(--mr-catalyst-red);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.mr-link-btn:hover {
    color: var(--mr-catalyst-red-hover);
    text-decoration: underline;
}

.mr-list {
    border: 1px solid var(--mr-border-subtle);
    border-radius: 4px;
    overflow: hidden;
}

.mr-row {
    border-top: 1px solid var(--mr-border-subtle);
    background: #fff;
}

.mr-row:first-child {
    border-top: 0;
}

.mr-row--warn {
    background: color-mix(in srgb, var(--mr-warm-yellow) 8%, #fff);
    border-top-color: color-mix(in srgb, var(--mr-warm-yellow) 35%, #fff);
}

.mr-row--fail {
    background: var(--mr-catalyst-red-tint);
    border-top-color: color-mix(in srgb, var(--mr-catalyst-red) 22%, #fff);
}

.mr-row__line {
    display: grid;
    grid-template-columns: 20px minmax(40px, 1fr) auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    min-height: 30px;
}

.mr-row__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mr-row__url {
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mr-state {
    font-size: 11px;
    line-height: 16px;
    padding: 0 5px;
    border: 1px solid var(--mr-border-strong);
    border-radius: 4px;
    color: var(--mr-grey-600);
    white-space: nowrap;
}

.mr-state--merged {
    color: var(--mr-deep-navy);
    border-color: color-mix(in srgb, var(--mr-deep-navy) 30%, #fff);
}

/* Kept in the DOM (not display:none) so rows without a state (e.g. a
   failed check) still occupy all 5 grid-template-columns tracks, keeping
   the summary/actions columns aligned with rows that do have a state pill. */
.mr-state--empty {
    visibility: hidden;
}

.mr-row__reason {
    font-size: 12px;
    color: var(--mr-grey-600);
    white-space: nowrap;
}

.mr-row__actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--mr-grey-400);
    cursor: pointer;
}

.mr-icon-btn:hover {
    background: var(--mr-light-grey);
    color: var(--mr-deep-navy);
}

.mr-row__detail {
    padding: 2px 10px 9px 36px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mr-detail__title {
    font-size: 12px;
    color: var(--mr-charcoal);
}

.mr-detail__reason {
    font-size: 12px;
    color: var(--mr-grey-600);
}

.mr-row--warn .mr-detail__reason {
    color: color-mix(in srgb, var(--mr-warm-yellow) 28%, var(--mr-charcoal));
}

.mr-row--fail .mr-detail__reason {
    color: var(--mr-catalyst-red-hover);
}

.mr-detail__meta {
    font-size: 12px;
    color: var(--mr-grey-600);
}

.mr-spin {
    animation: mr-spin 900ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .mr-spin {
        animation-duration: 0ms;
    }
}
