.cert-validation {
    display: grid;
    gap: 1.5rem;
}

.cert-validation__actions {
    display: flex;
    justify-content: flex-end;
}

.cert-validation__summary {
    display: grid;
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    overflow: hidden;
}

.cert-validation__summary + .cert-validation__summary {
    margin-top: 1rem;
}

.cert-validation__summary-row {
    display: contents;
}

.cert-validation__summary-key,
.cert-validation__summary-value {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(243 244 246);
}

.cert-validation__summary-row:last-child > * {
    border-bottom: 0;
}

.cert-validation__summary-key {
    background: rgb(249 250 251);
    color: rgb(75 85 99);
    font-size: 0.8125rem;
    font-weight: 600;
}

.cert-validation__summary-value {
    min-width: 0;
    color: rgb(17 24 39);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.cert-validation__summary-value--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
}

.cert-validation__summary-value--danger {
    color: rgb(220 38 38);
}

.cert-validation__date {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    border-radius: 0.5rem;
    background: rgb(236 252 203);
    color: rgb(63 98 18);
    font-weight: 600;
}

.cert-validation__result {
    display: grid;
    gap: 0.75rem;
}

.cert-validation__hash {
    display: block;
    padding: 0.875rem 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(249 250 251);
    color: rgb(31 41 55);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.cert-validation__files {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
}

.cert-validation__file {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.75rem;
    background: rgb(255 255 255);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.cert-validation__file--match {
    border-color: rgb(134 239 172);
    background: rgb(240 253 244);
    box-shadow: 0 0 0 1px rgb(34 197 94 / 0.08);
}

.cert-validation__file--mismatch {
    border-color: rgb(252 165 165);
    background: rgb(254 242 242);
    box-shadow: 0 0 0 1px rgb(239 68 68 / 0.08);
}

.cert-validation__file-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.cert-validation__file-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: rgb(243 244 246);
    color: rgb(107 114 128);
}

.cert-validation__file--match .cert-validation__file-icon {
    background: rgb(220 252 231);
    color: rgb(22 163 74);
}

.cert-validation__file-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.cert-validation__file-body {
    flex: 1 1 auto;
    min-width: 0;
}

.cert-validation__file-title {
    margin: 0 0 0.375rem;
    color: rgb(17 24 39);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cert-validation__file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
    color: rgb(107 114 128);
    font-size: 0.75rem;
}

.cert-validation__file-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.cert-validation__file-meta-item svg {
    width: 0.875rem;
    height: 0.875rem;
}

.cert-validation__file-status {
    flex: 0 0 auto;
}

.cert-validation__hash-details {
    margin-top: auto;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.625rem;
    overflow: hidden;
}

.cert-validation__hash-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: rgb(249 250 251);
    color: rgb(75 85 99);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    list-style: none;
}

.cert-validation__hash-summary::-webkit-details-marker {
    display: none;
}

.cert-validation__hash-summary svg {
    width: 1rem;
    height: 1rem;
    transition: transform 150ms ease;
}

.cert-validation__hash-details[open] .cert-validation__hash-summary svg {
    transform: rotate(90deg);
}

.cert-validation__hash-value {
    display: block;
    padding: 0.75rem;
    border-top: 1px solid rgb(229 231 235);
    color: rgb(55 65 81);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.6875rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.cert-validation__tsa-status {
    margin-bottom: 1rem;
}

.dark .cert-validation__summary,
.dark .cert-validation__file,
.dark .cert-validation__hash,
.dark .cert-validation__hash-details {
    border-color: rgb(255 255 255 / 0.1);
}

.dark .cert-validation__summary-key,
.dark .cert-validation__hash-summary {
    background: rgb(255 255 255 / 0.04);
    color: rgb(156 163 175);
}

.dark .cert-validation__summary-key,
.dark .cert-validation__summary-value {
    border-bottom-color: rgb(255 255 255 / 0.06);
}

.dark .cert-validation__summary-value,
.dark .cert-validation__file-title {
    color: rgb(243 244 246);
}

.dark .cert-validation__hash,
.dark .cert-validation__file {
    background: rgb(255 255 255 / 0.025);
    color: rgb(209 213 219);
}

.dark .cert-validation__file--match {
    border-color: rgb(34 197 94 / 0.35);
    background: rgb(34 197 94 / 0.08);
}

.dark .cert-validation__file--mismatch {
    border-color: rgb(239 68 68 / 0.35);
    background: rgb(239 68 68 / 0.08);
}

.dark .cert-validation__file--mismatch .cert-validation__file-icon {
    background: rgb(239 68 68 / 0.15);
    color: rgb(252 165 165);
}

.dark .cert-validation__file-icon {
    background: rgb(255 255 255 / 0.06);
    color: rgb(156 163 175);
}

.dark .cert-validation__file--match .cert-validation__file-icon {
    background: rgb(34 197 94 / 0.15);
    color: rgb(134 239 172);
}

.dark .cert-validation__hash-value {
    border-top-color: rgb(255 255 255 / 0.08);
    color: rgb(209 213 219);
}

.dark .cert-validation__date {
    background: rgb(109 149 58 / 0.18);
    color: rgb(190 242 100);
}

@media (max-width: 640px) {
    .cert-validation__summary {
        display: block;
    }

    .cert-validation__summary-row {
        display: block;
    }

    .cert-validation__summary-key {
        padding-bottom: 0.25rem;
        border-bottom: 0;
    }

    .cert-validation__summary-value {
        padding-top: 0.25rem;
    }

    .cert-validation__file-header {
        flex-wrap: wrap;
    }

    .cert-validation__file-status {
        margin-left: 3.25rem;
    }
}
