/* ============================================================
   Onglet Portefeuille : coquille de configuration sur la charte
   commune (08/10/2026), même géométrie que l'onglet Comparaison.
   Préfixe `.pf-`, tokens `.bk-*` de book_theme.css : la surface
   `.bk-block-card` est fixe et sombre dans les deux thèmes, donc
   tout ce qui vit dedans lit les tokens ré-épinglés par la carte
   (jamais un littéral de couleur seul, règle D1b).
   Les résultats (`p4-*`) vivent HORS de `.pf-root`.
   ============================================================ */

.pf-root { font-family: var(--font-primary); }

.pf-root .comparison-strategy-dropdown { margin-bottom: 0; }

/* --- Répartitions proposées : quatre boutons de même poids --- */
.pf-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.pf-root .pf-preset-btn {
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 12px;
}

/* --- Aperçu des stratégies retenues --- */
.pf-line-cards:empty { display: none; }
.pf-line-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}
.pf-line-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--bk-glass-border);
    border-radius: 12px;
    background: var(--bk-glass-bg);
    min-width: 0;
}
.pf-line-main { min-width: 0; }
.pf-line-side { text-align: right; flex-shrink: 0; }
.pf-line-name {
    font-weight: 600;
    color: var(--bk-cyan);
    overflow-wrap: anywhere;
}
.pf-line-meta {
    font-size: 0.78rem;
    color: var(--bk-muted);
    font-variant-numeric: tabular-nums;
}

/* --- Poids et rôle de chaque ligne --- */
.pf-weights-section {
    margin-top: 1.6rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--bk-glass-border);
}
.pf-weight-list:empty { display: none; }
.pf-weight-line {
    padding: 10px 0;
    border-bottom: 1px solid var(--bk-glass-border);
}
.pf-weight-line:last-child { border-bottom: 0; }
.pf-weight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}
.pf-weight-name {
    font-weight: 600;
    color: var(--bk-ink);
    overflow-wrap: anywhere;
    min-width: 0;
}
.pf-root .pf-weight-input {
    width: 150px;
    flex-shrink: 0;
}
.pf-root .pf-weight-input .form-control {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Actions : lancer (CTA) et enregistrer, même rangée que Comparaison --- */
.pf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.pf-actions .pf-cta { flex: 1 1 260px; }

@media (max-width: 767.98px) {
    .pf-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-line-cards { grid-template-columns: 1fr; }
    .pf-root .pf-weight-input { width: 120px; }
}

/* --- Multi-select des stratégies ---
   Sans la classe `comparison-strategy-dropdown` (pensée pour UNE valeur :
   libellé coupé en `nowrap`, la 2e puce sortait « T... ») : les puces
   gardent leur nom entier et passent à la ligne, jamais hors du cadre. */
.pf-strategy-dropdown .Select-menu-outer { z-index: 10050 !important; }
.pf-strategy-dropdown .Select-option,
.pf-strategy-dropdown .VirtualizedSelectOption {
    height: auto !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    padding: 8px 12px !important;
}
.pf-root .pf-strategy-dropdown .Select--multi .Select-value {
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 10px);
}
.pf-root .pf-strategy-dropdown .Select--multi .Select-value-label {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .pf-line-card { flex-direction: column; gap: 4px; }
    .pf-line-side { text-align: left; }
}
