/* ── benchmark.css — Sector Benchmarking UI ────────────────────────────────── */

.benchmark-no-sector { font-size: .88rem; color: var(--bm-muted, #8899aa); margin: 12px 0 4px; }

.benchmark-block {
    margin-top: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
}

/* Header row */
.bm-header {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bm-icon {
    font-size: 1.1rem;
    color: #2dd4bf;
}

.bm-sector-name {
    color: #94a3b8;
    font-weight: 500;
}

/* ── Loading state ─────────────────────────────────────────────────────────── */
.benchmark-loading .bm-loading-text {
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

/* ── Unavailable state ─────────────────────────────────────────────────────── */
.bm-unavail-body {
    color: #94a3b8;
    font-size: 0.9rem;
}

.bm-unavail-msg {
    margin: 0 0 0.75rem;
    color: #cbd5e1;
}

.bm-unavail-msg strong {
    color: #e2e8f0;
}

.bm-progress-wrap {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.bm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d9488, #2dd4bf);
    border-radius: 4px;
    transition: width 0.4s ease;
    min-width: 4px;
}

.bm-unavail-count {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    color: #64748b;
}

.bm-unavail-note {
    margin: 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

/* ── Available state — overall card ───────────────────────────────────────── */
.bm-overall-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Score row */
.bm-score-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bm-score-cell {
    text-align: center;
    flex: 1;
}

.bm-score-val {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.bm-score-pct {
    font-size: 1rem;
    font-weight: 500;
}

.bm-score-yours  { color: #2dd4bf; }
.bm-score-median { color: #94a3b8; }
.bm-score-mean   { color: #64748b; }

.bm-score-lbl {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bm-score-divider {
    width: 1px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Percentile badge */
.bm-pct-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.bm-pct-top     { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
.bm-pct-upper   { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.bm-pct-mid     { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.bm-pct-low     { background: rgba(239, 68, 68, 0.12);  color: #f87171; }

/* Distribution bar */
.bm-dist-wrap {
    margin-top: 0.5rem;
}

.bm-dist-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.bm-dist-bar {
    position: relative;
    height: 12px;
    border-radius: 6px;
    overflow: visible;
    display: flex;
    margin-bottom: 1.8rem;
}

.bm-dist-segment {
    height: 100%;
}

.bm-dist-segment:first-child { border-radius: 6px 0 0 6px; }
.bm-dist-segment:last-child  { border-radius: 0 6px 6px 0; }

.bm-dist-q1 { background: rgba(239, 68, 68, 0.35); }
.bm-dist-q2 { background: rgba(251, 191, 36, 0.35); }
.bm-dist-q3 { background: rgba(99, 102, 241, 0.35); }
.bm-dist-q4 { background: rgba(45, 212, 191, 0.35); }

.bm-dist-marker {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 18px;
    background: #2dd4bf;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(45, 212, 191, 0.7);
    z-index: 2;
}

.bm-dist-ticks {
    position: relative;
    height: 1.8rem;
}

.bm-dist-ticks span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.bm-count-note {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 0.75rem;
    text-align: right;
}

/* ── Section comparison ───────────────────────────────────────────────────── */
.bm-section-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.bm-section-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.bm-section-row {
    display: grid;
    grid-template-columns: 9rem 1fr 5rem;
    align-items: center;
    gap: 0.75rem;
}

.bm-sec-label {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-sec-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bm-sec-bar-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bm-sec-bar-lbl {
    font-size: 0.65rem;
    color: #475569;
    width: 2.4rem;
    flex-shrink: 0;
    text-align: right;
}

.bm-sec-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.bm-sec-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

.bm-bar-yours { background: #2dd4bf; }
.bm-bar-peers { background: #475569; }

.bm-sec-bar-val {
    font-size: 0.7rem;
    color: #64748b;
    width: 2.2rem;
    text-align: right;
    flex-shrink: 0;
}

/* Diff badge */
.bm-sec-diff {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.bm-diff-ahead  { background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }
.bm-diff-behind { background: rgba(239, 68, 68, 0.12);  color: #f87171; }
.bm-diff-par    { background: rgba(148, 163, 184, 0.10); color: #94a3b8; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .bm-section-row {
        grid-template-columns: 6rem 1fr 4rem;
        gap: 0.5rem;
    }

    .bm-score-val {
        font-size: 1.5rem;
    }

    .bm-score-row {
        gap: 0.5rem;
    }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
    .benchmark-block {
        border-color: #ccc;
        background: #fff;
        color: #000;
    }

    .bm-header,
    .bm-score-val,
    .bm-sec-label {
        color: #000 !important;
    }

    .bm-score-yours  { color: #0d9488 !important; }
    .bm-score-median { color: #475569 !important; }
    .bm-bar-yours    { background: #0d9488 !important; }
    .bm-bar-peers    { background: #94a3b8 !important; }
}
