/*
 * Cockpit · Source-span hover (Phase 3 / Agent 3C)
 *
 * Highlights AI-extracted excerpts inside rep messages. The span is
 * subtle (faint underline + accent text colour) so it doesn't shout
 * through the message body, but visible enough that the manager
 * notices it's interactive on hover.
 *
 * The tooltip uses a fixed dark background regardless of theme so
 * the confidence colours (red / amber / green) are always readable.
 */

.cockpit-source-span {
    background: rgba(76, 110, 245, 0.06);
    border-bottom: 1px dotted rgba(76, 110, 245, 0.6);
    padding: 0 1px;
    cursor: help;
    transition: background 0.15s, border-color 0.15s;
}

.cockpit-source-span:hover {
    background: rgba(76, 110, 245, 0.18);
    border-bottom-color: rgba(76, 110, 245, 1);
    border-bottom-style: solid;
}

.cockpit-source-span-tooltip {
    position: absolute;
    background: #111;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, "Segoe UI", sans-serif;
    line-height: 1.45;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 10000;
    min-width: 220px;
    max-width: 320px;
}

.cockpit-source-span-tooltip-row {
    margin: 2px 0;
}

.cockpit-source-span-tooltip-label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-right: 4px;
}

.cockpit-source-span-tooltip strong {
    color: #fff;
    font-weight: 600;
}

/* === [Phase 6.2 / Agent 6C] density-aware citations === START === */
/* Plain language: in Simple density we DEFER the citation chrome
 * (no inline underline / dot, no hover tooltip cursor) so Jean's
 * eyes stay on the prose. The citations are NOT removed — the
 * spans still exist in the DOM, they are just visually quieter.
 * A per-card "Voir les justifications" toggle in the layout (added
 * by cd-c6c-citations-toggle in cockpit-density-utilities.css)
 * surfaces them on demand.
 *
 * In Standard the existing inline marker + hover tooltip stay as
 * before. In Expert we make the marker slightly louder (heavier
 * underline) so the audit-trail signal pops in the dense view.
 */

.cockpit-density-simple .cockpit-source-span {
    background: transparent;
    border-bottom: none;
    cursor: text;
}

.cockpit-density-simple .cockpit-source-span:hover {
    background: transparent;
    border-bottom: none;
}

/* When the user expands the per-card "Voir les justifications"
 * toggle, the toggle's [aria-expanded="true"] sibling carries the
 * `cd-c6c-citations-icons` class; inside that container the spans
 * regain their underline so the citations become reachable. Pure
 * CSS — no JS branch needed. */
.cockpit-density-simple .cd-c6c-citations-icons .cockpit-source-span {
    background: rgba(76, 110, 245, 0.06);
    border-bottom: 1px dotted rgba(76, 110, 245, 0.6);
    cursor: help;
}
.cockpit-density-simple .cd-c6c-citations-icons .cockpit-source-span:hover {
    background: rgba(76, 110, 245, 0.18);
    border-bottom-color: rgba(76, 110, 245, 1);
    border-bottom-style: solid;
}

.cockpit-density-expert .cockpit-source-span {
    /* Slightly heavier border + higher contrast for the dense view. */
    border-bottom: 1px solid rgba(76, 110, 245, 0.85);
    background: rgba(76, 110, 245, 0.10);
}
/* === [Phase 6.2 / Agent 6C] density-aware citations === END === */
