/* Final alignment layer for the approved team-history mockup. */

/* Contact name is a separate hierarchy level above the event body. */
.history-contact-row-v2 {
    margin: 0 0 6px 40px;
    line-height: 1.15;
}
.history-contact-inline {
    color: #2f1b73;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.01em;
}

/* Entity colors: the event type and the funnel kind are two separate visual levels. */
.history-legend-strip .legend-contact {
    color: #267eea;
}
.history-legend-strip .legend-action {
    color: #7047e8;
}
.history-legend-strip .legend-funnel {
    color: #0c9aa6;
}

/* Contact = blue, action = violet, funnel entity = teal. */
.history-timeline-v2 .history-event.history-type-contact {
    --entity-color: #267eea;
    --entity-soft: #eaf3ff;
}
.history-timeline-v2 .history-event.history-type-action {
    --entity-color: #7047e8;
    --entity-soft: #f0ebff;
}
.history-timeline-v2 .history-event.history-type-funnel,
.history-timeline-v2 .history-event.history-type-funnel.history-funnel-product,
.history-timeline-v2 .history-event.history-type-funnel.history-funnel-business {
    --entity-color: #0c9aa6;
    --entity-soft: #e7f8fa;
}

/* Funnel kind keeps its own color inside the funnel block:
   product = violet, business = teal. */
.history-funnel-panel.funnel-tone-product {
    --funnel-color: #7651db;
    --funnel-soft: #f4f0ff;
    border-color: #ddd5f7;
    background: #faf9ff;
}
.history-funnel-panel.funnel-tone-business {
    --funnel-color: #0c9aa6;
    --funnel-soft: #e8f8fa;
    border-color: #ccebed;
    background: #f7fcfc;
}
.history-funnel-panel.funnel-tone-product .history-funnel-kind {
    background: #eee9ff;
    color: #6d49d3;
}
.history-funnel-panel.funnel-tone-business .history-funnel-kind {
    background: #def6f7;
    color: #087f89;
}

/* The entity icon is anchored to the two-line event block: type/status + heading. */
.history-primary-row {
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}
.history-entity-icon {
    align-self: center;
    margin: 0;
}
.history-primary-copy {
    display: grid;
    align-content: center;
    min-height: 34px;
}
.history-kicker-row {
    margin: 0;
}
.history-event-heading {
    margin-top: 2px;
}

/* Metadata follows the text column, not the icon column. */
.history-timeline-v2 .history-action-details,
.history-open-contact,
.history-funnel-panel,
.history-next-step,
.history-no-next-step,
.history-details-after-funnel {
    margin-left: 40px;
}

/* Funnel: one vertical block. Label first, diagram directly below it. */
.history-funnel-panel.is-embedded {
    width: min(100%, 900px);
    padding: 8px 10px 9px;
}
.history-funnel-layout {
    display: block;
}
.history-funnel-label {
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.history-funnel-visual {
    min-width: 0;
    width: 100%;
}
.compact-funnel-track {
    width: 100%;
    max-width: 680px;
    margin: 8px 0 0;
}
.history-funnel-panel.is-standalone {
    width: min(100%, 780px);
    padding: 7px 10px 8px;
}
.history-funnel-standalone-layout {
    display: block;
}
.history-funnel-panel.is-standalone .compact-funnel-track {
    width: 100%;
    max-width: 680px;
    margin: 6px 0 0;
}

/* The diagram itself communicates the transition; textual duplication stays hidden. */
.history-funnel-transition-line,
.history-funnel-standalone-copy,
.history-funnel-transition-copy,
.history-funnel-current-copy {
    display: none !important;
}

/* Keep the arrow visually tied to the current target stage. */
.compact-funnel-arrow {
    top: -5px;
    left: -12px;
}

@media (max-width: 980px) {
    .compact-funnel-track,
    .history-funnel-panel.is-standalone .compact-funnel-track {
        max-width: 580px;
    }
}

@media (max-width: 720px) {
    .history-contact-row-v2 {
        margin: 0 0 5px 35px;
    }
    .history-contact-inline {
        font-size: 12px;
    }
    .history-primary-row {
        grid-template-columns: 27px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }
    .history-primary-copy {
        min-height: 31px;
    }

    .history-timeline-v2 .history-action-details,
    .history-open-contact,
    .history-funnel-panel,
    .history-next-step,
    .history-no-next-step,
    .history-details-after-funnel {
        margin-left: 0 !important;
    }

    .history-funnel-layout {
        display: block;
    }
    .history-funnel-label {
        white-space: nowrap;
    }
    .compact-funnel-track,
    .history-funnel-panel.is-standalone .compact-funnel-track {
        width: 100%;
        max-width: 100%;
        margin: 7px 0 0;
    }
    .compact-funnel-stage-label {
        display: none;
    }
    .compact-funnel-mobile-summary {
        display: flex;
        margin-top: 4px;
    }
}
