button.bar-fill-red[data-archive-quality-detail] {
    position: relative;
    min-width: 2px;
    padding: 0;
    border: 0;
    color: white;
    font: inherit;
    cursor: pointer;
}

button.bar-fill-red[data-archive-quality-detail]:hover {
    filter: brightness(0.92) saturate(1.12);
}

button.bar-fill-red[data-archive-quality-detail]:focus-visible {
    outline: 2px solid white;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 4px rgba(183, 28, 28, 0.75);
}

.archive-quality-tooltip {
    position: fixed;
    z-index: 1400;
    display: none;
    width: max-content;
    max-width: min(720px, calc(100vw - 24px));
    padding: 11px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: #182534;
    color: white;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
    pointer-events: none;
}

.archive-quality-tooltip.show { display: block; }
.aqd-tooltip-title { max-width: 680px; overflow: hidden; color: white; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.aqd-tooltip-meta { margin-top: 2px; color: #b9c8d8; font-size: 11px; }
.aqd-tooltip-items { display: flex; flex-flow: row wrap; gap: 6px; margin-top: 9px; }
.aqd-tooltip-item { display: inline-flex; align-items: center; gap: 7px; max-width: 330px; padding: 5px 7px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 4px; background: rgba(255, 255, 255, 0.08); }
.aqd-tooltip-label { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.aqd-tooltip-count { flex: 0 0 auto; color: #ffb4ae; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }

body.archive-quality-modal-open { overflow: hidden; }

.archive-quality-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1350;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 31, 44, 0.48);
}

.archive-quality-backdrop.open { display: flex; }

.archive-quality-dialog {
    display: flex;
    width: min(1080px, 100%);
    max-height: min(860px, calc(100vh - 40px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d8e1e8;
    border-radius: 6px;
    background: white;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.aqd-dialog-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 20px 15px; border-bottom: 1px solid #e3e9ee; }
.aqd-dialog-heading { min-width: 0; }
.aqd-dialog-context { overflow: hidden; color: #708090; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.aqd-dialog-title { margin: 3px 0 0; overflow-wrap: anywhere; color: #22313f; font-size: 19px; line-height: 1.35; }
.aqd-close { display: inline-grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; padding: 0; border: 1px solid #d4dde5; border-radius: 4px; background: white; color: #657585; font-size: 24px; line-height: 1; }
.aqd-close:hover { border-color: #b42318; color: #b42318; }
.aqd-close:focus-visible { outline: 3px solid rgba(180, 35, 24, 0.2); outline-offset: 1px; }
.aqd-dialog-body { overflow: auto; }
.aqd-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid #e3e9ee; background: #f7f9fb; }
.aqd-summary-item { min-width: 0; padding: 14px 18px; border-right: 1px solid #e3e9ee; }
.aqd-summary-item:last-child { border-right: 0; }
.aqd-summary-label { color: #708090; font-size: 11px; }
.aqd-summary-value { display: block; margin-top: 4px; overflow: hidden; color: #22313f; font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.aqd-scope { padding: 10px 20px; border-bottom: 1px solid #edf1f4; color: #617181; font-size: 12px; }
.aqd-section { padding: 17px 20px 20px; border-bottom: 1px solid #e3e9ee; }
.aqd-section:last-child { border-bottom: 0; }
.aqd-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.aqd-section-head h3 { margin: 0; color: #263746; font-size: 15px; }
.aqd-section-note { color: #7b8996; font-size: 11px; }
.aqd-table-wrap { overflow: auto; border: 1px solid #dfe6ec; border-radius: 4px; }
.aqd-table { width: 100%; min-width: 760px; border-collapse: collapse; color: #314252; font-size: 12px; }
.aqd-table th, .aqd-table td { padding: 9px 11px; border-bottom: 1px solid #e8edf1; text-align: left; vertical-align: top; }
.aqd-table th { position: sticky; top: 0; z-index: 1; background: #f5f7f9; color: #607080; font-size: 11px; white-space: nowrap; }
.aqd-table tbody tr:last-child td { border-bottom: 0; }
.aqd-table tbody tr:hover { background: #fafcfd; }
.aqd-code { color: #a62d27; font-family: Consolas, "SFMono-Regular", monospace; font-size: 11px; font-weight: 700; }
.aqd-number { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aqd-muted { color: #7b8996; }
.aqd-empty { padding: 26px 18px; color: #7b8996; text-align: center; }

@media (max-width: 720px) {
    .archive-quality-backdrop { align-items: flex-end; padding: 0; }
    .archive-quality-dialog { max-height: 92vh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 6px 6px 0 0; }
    .aqd-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aqd-summary-item:nth-child(2) { border-right: 0; }
    .aqd-summary-item:nth-child(-n + 2) { border-bottom: 1px solid #e3e9ee; }
    .aqd-dialog-header, .aqd-section { padding-right: 14px; padding-left: 14px; }
    .aqd-scope { padding-right: 14px; padding-left: 14px; }
}
