.detection-overview {
    margin-bottom: 32px;
}

.detection-header {
    align-items: flex-start;
}

.detection-header .section-desc {
    margin: 6px 0 0;
}

.detection-total {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-color);
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 7px 10px;
}

.detection-source-overview {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding: 18px 0 0;
}

.detection-stack {
    background: var(--bg-tertiary);
    border-radius: 999px;
    display: flex;
    height: 9px;
    overflow: hidden;
    width: 100%;
}

.detection-stack-overall {
    height: 14px;
}

.detection-segment {
    display: block;
    height: 100%;
}

.source-lexical {
    background: var(--brand-green);
}

.source-vector {
    background: var(--info);
}

.source-both {
    background: var(--brand-teal);
}

.source-other {
    background: var(--text-subtle);
}

.detection-source-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 14px;
}

.detection-source-item {
    align-items: center;
    display: grid;
    font-size: 0.82rem;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.detection-source-item > span:last-child {
    color: var(--text-secondary);
    min-width: 3ch;
    text-align: right;
}

.detection-source-name {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    min-width: 0;
}

.detection-swatch {
    border-radius: 3px;
    flex: 0 0 auto;
    height: 10px;
    width: 10px;
}

.detection-vector-summary {
    color: var(--text-secondary);
    font-size: 0.84rem;
    margin: 14px 0 0;
}

.discovery-term-suggestions {
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 16px;
}

.discovery-term-suggestions-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.discovery-term-suggestions h3 {
    color: var(--text-color);
    font-size: 0.95rem;
    margin: 0;
}

.discovery-term-suggestions-header p,
.discovery-term-empty {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 5px 0 0;
}

.discovery-term-suggestions-header .btn {
    flex: 0 0 auto;
}

.discovery-term-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.discovery-term-list li {
    align-items: baseline;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: inline-flex;
    gap: 7px;
    max-width: 100%;
    padding: 7px 10px;
}

.discovery-term-list span {
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.discovery-term-list small {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 0.68rem;
}

.detection-chart-grid {
    display: grid;
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.detection-chart-card {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    min-width: 0;
    padding: 0 18px;
}

.detection-chart-card:first-child {
    border-left: 0;
    padding-left: 0;
}

.detection-chart-card:last-child {
    padding-right: 0;
}

.detection-chart-card h3 {
    color: var(--text-color);
    font-size: 1rem;
    margin: 0;
}

.detection-chart-card > p {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 5px 0 14px;
}

.detection-bar-list {
    display: grid;
    gap: 13px;
}

.detection-bar-row {
    min-width: 0;
}

.detection-row-heading {
    align-items: baseline;
    display: flex;
    font-size: 0.8rem;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 5px;
}

.detection-row-heading span {
    font-weight: 650;
    min-width: 0;
    overflow-wrap: anywhere;
}

.detection-row-heading strong {
    color: var(--text-secondary);
    flex: 0 0 auto;
    font-size: 0.72rem;
}

.detection-breakdown {
    color: var(--text-secondary);
    display: block;
    font-size: 0.68rem;
    line-height: 1.35;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .detection-chart-grid {
        grid-template-columns: 1fr;
    }

    .detection-chart-card,
    .detection-chart-card:first-child,
    .detection-chart-card:last-child {
        border-left: 0;
        border-top: 1px solid var(--border);
        padding: 18px 0;
    }

    .detection-chart-card:first-child {
        border-top: 0;
        padding-top: 0;
    }

    .detection-chart-card:last-child {
        padding-bottom: 0;
    }
}

@media (max-width: 600px) {
    .detection-source-list {
        grid-template-columns: 1fr;
    }

    .detection-total {
        margin-top: 4px;
    }

    .discovery-term-suggestions-header {
        align-items: stretch;
        flex-direction: column;
    }

    .discovery-term-suggestions-header .btn {
        align-self: flex-start;
    }
}
