/* ==========================================================================
   Pipelines — fiche d'une pipeline.
   Même gabarit que la fiche modèle (panneau, pastilles) ; teinte de la
   pipeline via .pp-tone--blue / --green (tokens --ae-*, light + dark).
   ========================================================================== */

.pp-tone--orange {
    --c-fill: var(--ae-orange-fill);
    --c-edge: var(--ae-orange-edge);
    --c-glow: var(--ae-orange-glow);
    --c-deep: var(--ae-orange-deep);
    --c-shadow: var(--ae-orange-shadow);
}

.pp-tone--blue {
    --c-fill: var(--ae-blue-fill);
    --c-edge: var(--ae-blue-edge);
    --c-glow: var(--ae-blue-glow);
    --c-deep: var(--ae-blue-deep);
    --c-shadow: var(--ae-blue-shadow);
}

.pp-tone--green {
    --c-fill: var(--ae-green-fill);
    --c-edge: var(--ae-green-edge);
    --c-glow: var(--ae-green-glow);
    --c-deep: var(--ae-green-deep);
    --c-shadow: var(--ae-green-shadow);
}

.pp-tone--pink {
    --c-fill: var(--ae-pink-fill);
    --c-edge: var(--ae-pink-edge);
    --c-glow: var(--ae-pink-glow);
    --c-deep: var(--ae-pink-deep);
    --c-shadow: var(--ae-pink-shadow);
}

/* Fil d'Ariane dans la teinte de la pipeline */
.pipelines-detail-page .breadcrumbs a,
.pipelines-detail-page .breadcrumbs a:hover {
    color: var(--c-deep);
}

/* ---------- Panneau ---------- */
.pipelines-detail-page .pp-detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 32px;
}

.pp-detail__intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 28px;
}

.pp-detail__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.pipelines-detail-page .pp-detail__name {
    margin: 0;
    line-height: 1.1;
}

.pp-detail__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--c-deep);
    color: var(--c-fill);
    font-size: 1.2rem;
    box-shadow: 0 8px 18px -10px var(--c-shadow);
}

.pp-detail__summary {
    margin: 0;
    max-width: 70ch;
    color: var(--ae-ink-soft);
    font-size: 0.9375rem;
    line-height: 1.6;
}

body.ae-refresh .pipelines-detail-page .pp-detail__specs {
    margin-top: 8px;
}

/* ---------- Sections ---------- */
.pp-detail__section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 0;
    border-top: 1px solid var(--ae-line-soft);
}

.pp-detail__section:last-child {
    padding-bottom: 0;
}

.pp-detail__section-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-detail__section-title {
    margin: 0;
    color: var(--ae-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.pp-detail__section-lede {
    margin: 0;
    max-width: 72ch;
    color: var(--ae-ink-muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

/* ---------- Schéma (blocs AlphaEdge Pipeline) ---------- */
.pp-detail__schema {
    --pp-blocks-bg: var(--ae-surface-2);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ae-line);
    border-radius: var(--ae-radius-lg, 14px);
    background-color: var(--ae-surface-2);
    background-image: radial-gradient(circle, color-mix(in srgb, var(--ae-ink) 10%, transparent) 1px, transparent 1.2px);
    background-size: 18px 18px;
}

.pp-detail__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ae-ink-muted);
    font-size: 0.8125rem;
}

.pp-detail__legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pp-detail__swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--ppb-soft);
    box-shadow: inset 0 3px 0 var(--ppb-c), inset 0 0 0 1px color-mix(in srgb, var(--ppb-c) 35%, transparent);
}

/* ---------- Étapes ---------- */
.pp-detail__steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.pp-detail__step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--ae-line);
    border-radius: var(--ae-radius, 10px);
    background: var(--ae-surface);
}

.pp-detail__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ae-surface-3);
    color: var(--ae-ink-soft);
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pp-detail__step-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pp-detail__step-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-height: 28px;
}

.pp-detail__step-label {
    color: var(--ae-ink);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.pp-detail__step-kind {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: var(--ae-radius-pill, 999px);
    background: var(--ppb-soft);
    color: var(--ppb-c);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.pp-detail__step--io { --ppb-c: #0f4c4a; --ppb-soft: #e3f6dc; }
.pp-detail__step--logic { --ppb-c: #4a5568; --ppb-soft: #edf0f4; }
.pp-detail__step--model { --ppb-c: #24439a; --ppb-soft: #dbe8ff; }
.pp-detail__step--out { --ppb-c: #24439a; --ppb-soft: #dbe8ff; }

html.dark .pp-detail__step--io { --ppb-c: #bfe6a8; --ppb-soft: rgba(191, 230, 168, 0.13); }
html.dark .pp-detail__step--logic { --ppb-c: #b8c2d3; --ppb-soft: rgba(184, 194, 211, 0.13); }
html.dark .pp-detail__step--model,
html.dark .pp-detail__step--out { --ppb-c: #9db8f5; --ppb-soft: rgba(157, 184, 245, 0.15); }

.pp-detail__step-desc {
    margin: 0;
    color: var(--ae-ink-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* ---------- Capacités + endpoint ---------- */
.pp-detail__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.pp-detail__block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.pp-detail__feats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pp-detail__feats li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    column-gap: 10px;
    color: var(--ae-ink-soft);
    font-size: 0.875rem;
    line-height: 1.5;
}

.pp-detail__feats i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--c-fill);
    color: var(--c-deep);
    font-size: 0.625rem;
}

.pp-detail__endpoint-note {
    margin: 0;
    max-width: 44ch;
    color: var(--ae-ink-muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

.pp-detail__endpoint-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    margin-top: 4px;
    padding: 0 16px;
    border: 1px solid var(--c-edge);
    border-radius: var(--ae-radius, 10px);
    background: var(--c-fill);
    color: var(--c-deep);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--ae-ease), border-color var(--ae-ease);
}

.pp-detail__endpoint-btn:hover {
    border-color: color-mix(in srgb, var(--c-deep) 45%, var(--c-edge));
    background: var(--c-glow);
    color: var(--c-deep);
}

.pp-detail__endpoint-btn:focus-visible {
    outline: 2px solid var(--c-deep);
    outline-offset: 2px;
}

.pp-detail__endpoint-btn i {
    font-size: 0.85em;
}

/* ---------- Autres pipelines ---------- */
.pp-detail-others__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.pp-detail-other {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--ae-line);
    border-radius: var(--ae-radius-lg, 14px);
    background: var(--ae-surface);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--ae-ease), box-shadow var(--ae-ease);
}

.pp-detail-other:hover,
.pp-detail-other:focus-visible {
    border-color: var(--c-edge);
    box-shadow: var(--ae-shadow-sm);
    outline: none;
}

.pp-detail-other__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--c-fill);
    color: var(--c-deep);
}

.pp-detail-other__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pp-detail-other__copy strong {
    color: var(--ae-ink);
    font-size: 0.875rem;
}

.pp-detail-other__copy span {
    overflow: hidden;
    color: var(--ae-ink-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-detail-other__arrow {
    color: var(--ae-ink-faint);
    font-size: 0.8rem;
    transition: transform var(--ae-ease), color var(--ae-ease);
}

.pp-detail-other:hover .pp-detail-other__arrow {
    color: var(--c-deep);
    transform: translateX(2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .pipelines-detail-page .pp-detail {
        padding: 22px 18px;
    }

    .pp-detail__columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    body.ae-refresh .pipelines-detail-page .pp-detail__specs {
        flex-wrap: wrap;
    }

    body.ae-refresh .pipelines-detail-page .pp-detail__specs .model-spec-stat-chip {
        flex: 1 1 220px;
    }
}
