/*
 * Inspection page (/inspect) specifics: deviation controls, legend gradient,
 * histogram and annotation list. Everything else reuses style.css,
 * cnc-components.css and scan-wizard.css.
 */

.inspect-hide-unscanned {
    margin: 12px 0 8px;
}

.inspect-scope-note {
    font-size: 0.85rem;
    color: var(--text-secondary, #9aa7bd);
    margin: 0 0 8px;
    line-height: 1.45;
}

.inspect-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    margin-bottom: 12px;
}

.inspect-scope .hint {
    flex-basis: 100%;
    margin: 0;
}

.inspect-controls {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 12px;
}

.inspect-controls .stock-input {
    max-width: 120px;
}

#inspect-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}

.inspect-block-title {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary, #9aa7bd);
    margin-bottom: 6px;
}

/* Stepped diverging colour legend. The discrete band gradient is generated
   by inspect_deviation.js so the bands always match the painted map; this
   continuous fallback only shows before the first run. */
.inspect-legend-bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(to right,
        #1c7ed6 0%, #22b8cf 25%, #37b24d 50%, #f59f00 75%, #e03131 100%);
}

/* Tolerance limit markers on the legend bar. */
.inspect-legend-tick {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 1px;
}

.inspect-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-secondary, #9aa7bd);
    margin-top: 4px;
}

.inspect-histogram-wrap canvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
}

.inspect-anno-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inspect-anno-head .inspect-block-title {
    margin-bottom: 0;
}

.inspect-anno-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inspect-anno-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

.inspect-anno-num {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59f00;
    color: #111;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inspect-anno-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.inspect-anno-status {
    color: var(--text-secondary, #9aa7bd);
}

.inspect-anno-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-secondary, #9aa7bd);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 6px;
}

.inspect-anno-remove:hover {
    color: #e03131;
}
