/* ══════════════════════════════════
   SOURCE DIVERGENCE — Split Intelligence View
   ══════════════════════════════════ */

.source-divergence-panel {
    margin-bottom: 28px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* ── Header ── */

.sd-header {
    margin-bottom: 20px;
}

.sd-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.sd-icon {
    width: 3px;
    height: 40px;
    border-radius: 2px;
    background: linear-gradient(180deg, #4A9E78, #B56060);
    flex-shrink: 0;
    margin-top: 2px;
}

.sd-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.02em;
    margin-bottom: 4px;
}

.sd-sub {
    font-size: .72rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: .03em;
    line-height: 1.4;
}

.sd-period {
    font-family: var(--font-mono);
    font-size: .6rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    letter-spacing: .04em;
}

/* ── Split Header (Official vs Think Tank) ── */

.sd-split-header {
    display: grid;
    grid-template-columns: 1fr 150px 1fr;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.sd-split-left {
    text-align: right;
    padding-right: 12px;
}

.sd-split-right {
    text-align: left;
    padding-left: 12px;
}

.sd-split-label {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sd-split-label.official {
    color: #4A9E78;
}

.sd-split-label.thinktank {
    color: #B56060;
}

.sd-split-meta {
    display: block;
    font-family: var(--font-mono);
    font-size: .55rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
    letter-spacing: .03em;
}

.sd-split-center-label {
    text-align: center;
    font-family: var(--font-mono);
    font-size: .55rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Section tags ── */

.sd-section-tag {
    font-family: var(--font-mono);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Butterfly chart ── */

.sd-butterfly {
    margin-bottom: 20px;
}

.sd-butterfly-row {
    display: grid;
    grid-template-columns: 1fr 150px 1fr;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.15s;
}

.sd-butterfly-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.sd-butterfly-row:last-child {
    border-bottom: none;
}

/* Left side (Official) — bars grow from right to left */
.sd-butterfly-left {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-right: 8px;
}

.sd-butterfly-left .sd-bar-label {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    min-width: 36px;
    text-align: right;
}

.sd-butterfly-left .sd-bar-track {
    flex: 1;
    height: 12px;
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.sd-butterfly-left .sd-bar-fill {
    height: 100%;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(90deg, rgba(74, 158, 120, 0.25), rgba(74, 158, 120, 0.65));
    transition: width 0.5s ease;
    min-width: 2px;
}

/* Center (theme/entity name + gap) */
.sd-butterfly-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 0 4px;
}

.sd-butterfly-name {
    font-size: .75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.sd-gap-badge {
    font-family: var(--font-mono);
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.sd-gap-badge.gap-official {
    color: #4A9E78;
    background: rgba(74, 158, 120, 0.12);
}

.sd-gap-badge.gap-thinktank {
    color: #B56060;
    background: rgba(181, 96, 96, 0.12);
}

.sd-gap-badge.gap-neutral {
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

/* Right side (Think Tank) — bars grow from left to right */
.sd-butterfly-right {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
}

.sd-butterfly-right .sd-bar-label {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    min-width: 36px;
    text-align: left;
}

.sd-bar-label-zero {
    color: rgba(255, 255, 255, 0.2) !important;
    font-style: italic;
}

.sd-butterfly-right .sd-bar-track {
    flex: 1;
    height: 12px;
    position: relative;
    display: flex;
    justify-content: flex-start;
}

.sd-butterfly-right .sd-bar-fill {
    height: 100%;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, rgba(181, 96, 96, 0.65), rgba(181, 96, 96, 0.25));
    transition: width 0.5s ease;
    min-width: 2px;
}

/* ── Entity header with tabs ── */

.sd-entity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sd-entity-header .sd-section-tag {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sd-entity-tabs {
    display: flex;
    gap: 1px;
    background: rgba(10, 18, 30, .8);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px;
}

.sd-entity-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: .6rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all .15s ease;
}

.sd-entity-tab:hover {
    color: var(--text-secondary);
}

.sd-entity-tab.active {
    background: rgba(59, 123, 255, .12);
    color: var(--accent);
    border: 1px solid rgba(59, 123, 255, .2);
}
