/* Page Portefeuilles (portfolio.js) */

.pf-welcome { text-align: center; padding: 48px 24px; }
.pf-welcome-icon { display: inline-flex; padding: 16px; border-radius: 18px; background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.pf-welcome-icon .ic { width: 34px; height: 34px; }
.pf-welcome h2 { margin: 16px 0 8px; font-size: 24px; }
.pf-welcome > p { max-width: 520px; margin: 0 auto 22px; line-height: 1.55; }
.pf-welcome-actions { display: flex; gap: 10px; justify-content: center; }
.pf-welcome-actions button { height: 40px; padding: 0 18px; }
.pf-create { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 560px; margin: 0 auto; }
.pf-create input { flex: 1; min-width: 200px; height: 40px; }
.pf-create select { height: 40px; }
.pf-create button { height: 40px; padding: 0 20px; }
.pf-modal .pf-create { justify-content: stretch; margin-top: 14px; }

.pf-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.pf-tab {
  display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: 150px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer; white-space: nowrap;
}
.pf-tab > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.pf-tab small { color: var(--muted); font-size: 11.5px; }
.pf-tab.active { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.pf-tab.pf-new { flex-direction: row; align-items: center; justify-content: center; min-width: 0; gap: 6px; color: var(--accent); font-weight: 700; border-style: dashed; }
.pf-tab.pf-new.locked { color: var(--accent); }
.pf-tab .ic { width: 15px; height: 15px; }

.pf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-title { display: flex; align-items: center; gap: 12px; }
.pf-title .logo-wrap { width: 44px; height: 44px; border-radius: 12px; }
.pf-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pf-minor { padding: 2px 9px; border-radius: 999px; background: rgba(139, 123, 255, .12); color: var(--accent); font-weight: 700; }
.pf-title h2 { margin: 0; font-size: 22px; }
.pf-title .icon-btn { margin: 0; display: inline-flex; align-items: center; justify-content: center; }
.pf-env { padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); }
.pf-add { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; }
.pf-add .ic { width: 16px; height: 16px; }

.pf-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.pf-summary > div, .pf-summary > .pf-kpi-link { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border); }
.pf-summary > .pf-total { flex: 1.5 1 220px; }
.pf-total { background: linear-gradient(135deg, rgb(var(--accent-rgb) / .14), rgb(var(--brand-1-rgb) / .1)) !important; }
.pf-total b { font-size: 30px; letter-spacing: -.01em; }
.pf-kpi b { font-size: 19px; }
.pf-summary .up { color: var(--up); }
.pf-summary .down { color: var(--down); }

.pf-table-scroll { overflow-x: auto; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pf-table th { text-align: right; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.pf-table th:first-child, .pf-table td:first-child { text-align: left; }
.pf-table td { text-align: right; padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pf-table td small { font-size: 11.5px; }
.pf-table tbody tr { cursor: pointer; transition: background .15s; }
.pf-table tbody tr:hover { background: var(--panel-2); }
.pf-table td.up, .pf-table small.up { color: var(--up); }
.pf-table td.down, .pf-table small.down { color: var(--down); }
.pf-name { display: flex; align-items: center; gap: 10px; }
.pf-name > span { display: flex; flex-direction: column; }
.pf-weight { display: inline-block; width: 60px; height: 6px; margin-right: 8px; border-radius: 3px; background: var(--panel-2); vertical-align: middle; overflow: hidden; }
.pf-weight span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.pf-empty-lines { display: flex; align-items: center; gap: 16px; padding: 24px; border: 1px dashed var(--border); border-radius: 14px; flex-wrap: wrap; }
.pf-empty-lines > .ic { width: 30px; height: 30px; color: var(--accent); }
.pf-empty-lines > div { flex: 1; min-width: 220px; }
.pf-empty-lines p { margin: 4px 0 0; }
.pf-empty-lines button { height: 40px; padding: 0 18px; }

.pf-history { margin-top: 18px; border: 1px solid var(--border); border-radius: 14px; }
.pf-history summary { display: flex; align-items: center; gap: 8px; padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.pf-history summary::-webkit-details-marker { display: none; }
.pf-history summary .ic { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.pf-history ul { list-style: none; margin: 0; padding: 0 8px 8px; }
.pf-history li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto 30px; align-items: center; gap: 12px; padding: 9px 8px; border-top: 1px solid var(--border); font-size: 13.5px; }
.pf-tx-type { justify-self: start; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--panel-2); }
.pf-tx-type.t-buy { color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.pf-tx-type.t-sell { color: var(--wait); background: rgba(245, 158, 11, .12); }
.pf-tx-type.t-dividend { color: var(--up); background: rgba(34, 197, 94, .12); }
.pf-tx-main { display: flex; flex-direction: column; min-width: 0; }
.pf-tx-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tx-amount { font-weight: 700; white-space: nowrap; }
.pf-tx-del { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pf-tx-del:hover { color: var(--down); background: rgba(239, 68, 68, .1); }
.pf-tx-del .ic { width: 15px; height: 15px; }
.pf-closed { margin-top: 12px; }

/* Fenêtre « Ajouter une opération » */
.pf-modal { max-width: 480px; }
.tx-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.tx-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.tx-form label[hidden] { display: none; }
.tx-form input { height: 40px; }
.tx-types { display: flex; flex-wrap: wrap; width: 100%; }
.tx-types button { flex: 1; justify-content: center; padding: 7px 6px; font-size: 12.5px; }
.tx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tx-row label:only-child, .tx-row label:first-child:nth-last-child(1) { grid-column: 1 / -1; }
.tx-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-weight: 600; }
.tx-picked[hidden] { display: none; }
.tx-picked .link { margin-left: auto; }
.tx-hint { font-weight: 400; font-size: 11.5px; }
.tx-total { min-height: 18px; font-weight: 700; color: var(--text); }
.tx-form button[type=submit] { height: 42px; }
.pf-danger { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pf-danger .danger-btn { align-self: flex-start; height: 36px; padding: 0 14px; }

@media (max-width: 900px) {
  .pf-summary > div { flex-basis: 40%; }
  .pf-summary > .pf-total { flex-basis: 100%; }
}

/* Logos de banques et courtiers */
.logo-wrap.broker .logo-initials .ic { width: 16px; height: 16px; }
.logo-wrap.small { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.logo-wrap.small .logo-initials { font-size: 10px; }

/* Formulaire de portefeuille : enveloppe, établissement, titulaire, nom */
.pf-modal-wide { max-width: 640px; }
.pf-form { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; text-align: left; }
.pf-welcome-form .pf-form { max-width: 640px; margin: 24px auto 0; }
.pf-step { display: flex; flex-direction: column; gap: 8px; }
.pf-step-title { font-size: 13px; font-weight: 700; }
.pf-step[hidden], .pf-step label[hidden], .pf-step small[hidden] { display: none; }
.pf-step input { height: 40px; }
.pf-env-group { display: flex; flex-direction: column; gap: 6px; }
.pf-env-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-env-chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }
.pf-env-chip.active { border-color: var(--accent); background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.pf-broker-pick[hidden], .pf-broker-picked[hidden] { display: none; }
.pf-broker-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.pf-broker-picked .link { margin-left: auto; }
.pf-broker-search { width: 100%; margin-bottom: 8px; }
.pf-broker-grid { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.pf-broker-group { display: flex; flex-direction: column; gap: 6px; }
.pf-broker-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.pf-broker { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.pf-broker:hover { border-color: var(--accent); }
.pf-broker .logo-wrap { width: 26px; height: 26px; border-radius: 7px; flex: none; }
.pf-broker .logo-wrap .logo-initials { font-size: 9.5px; }
.pf-broker span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-broker-other { align-self: flex-start; }
.pf-holder-seg { align-self: flex-start; }
.pf-holder-name { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; }
.pf-form-submit { height: 42px; }

/* Sous-onglets du détail : positions, liquidités, opérations */
.pf-subtabs { margin: 4px 0 14px; }
.pf-subtabs small { margin-left: 4px; opacity: .7; font-weight: 600; }
.pf-cash-row td { background: rgba(34, 197, 94, .05); }
.pf-cash-row .logo-initials .ic { width: 15px; height: 15px; color: var(--up); }
.pf-cash-intro { margin: 0 0 10px; line-height: 1.5; }
.pf-moves { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 14px; }
.pf-moves li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto 96px 30px; align-items: center; gap: 12px; padding: 10px 12px; font-size: 13.5px; }
.pf-moves.pf-ops li { grid-template-columns: 92px minmax(0, 1fr) auto 30px; }
.pf-moves li + li { border-top: 1px solid var(--border); }
.pf-moves li.is-apport { opacity: .7; }
.pf-moves .pf-tx-amount.up { color: var(--up); }
.pf-move-balance { text-align: right; white-space: nowrap; }
.pf-auto { color: var(--accent); font-weight: 600; }
.pf-tx-type.t-deposit, .pf-tx-type.t-interest { color: var(--up); background: rgba(34, 197, 94, .1); }
.pf-tx-type.t-withdrawal, .pf-tx-type.t-fee { color: var(--down); background: rgba(239, 68, 68, .1); }
.pf-tx-type.t-apport { color: var(--muted); }
.pf-weight.wide { width: 100%; margin: 6px 0 2px; }
.pf-ceiling b small { font-size: 13px; font-weight: 600; }

/* Saisie : mode d'achat, alerte d'éligibilité */
.tx-modes { display: flex; width: 100%; }
.tx-modes[hidden] { display: none; }
.tx-modes button { flex: 1; justify-content: center; }
.tx-warn { display: flex; gap: 6px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: rgba(245, 158, 11, .1); color: var(--wait); font-size: 12px; line-height: 1.4; }
.tx-warn[hidden] { display: none; }
.tx-warn .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.tx-row .tx-full { grid-column: 1 / -1; }
.tx-fees-hint, .tx-held { font-weight: 400; font-size: 11.5px; }

@media (max-width: 640px) {
  .pf-moves li { grid-template-columns: 80px minmax(0, 1fr) auto 26px; }
  .pf-move-balance { display: none; }
}

/* Tri des positions */
.pf-table th .pf-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.pf-table th .pf-sort:hover, .pf-table th .pf-sort.on { color: var(--text); }
.pf-sort-arrow { font-size: 8px; opacity: .45; letter-spacing: -1px; }
.pf-sort.on .pf-sort-arrow { opacity: 1; color: var(--accent); }

/* Disponible */
.pf-tab small.pf-tab-cash { color: var(--up); }
.pf-kpi-cash .link { padding: 0; font-size: inherit; }
.pf-cash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding: 14px 16px; border-radius: 14px; background: rgba(34, 197, 94, .07); border: 1px solid var(--border); }
.pf-cash-head > div { display: flex; flex-direction: column; gap: 2px; }
.pf-cash-head b { font-size: 22px; }
.pf-cash-head button { height: 38px; padding: 0 16px; }

/* ---------- Bloc visuel (portfolio-charts.js) ---------- */
/* Teintes des lignes : palette catégorielle validée (daltonisme), une version par thème */
:root { --pf-c1: #3987e5; --pf-c2: #d95926; --pf-c3: #199e70; --pf-c4: #c98500; --pf-c5: #d55181; --pf-c6: #008300; --pf-c7: #9085e9; --pf-c8: #e66767; --pf-other: #5b6578; }
:root[data-theme="light"] { --pf-c1: #2a78d6; --pf-c2: #eb6834; --pf-c3: #1baf7a; --pf-c4: #eda100; --pf-c5: #e87ba4; --pf-c6: #008300; --pf-c7: #6250d6; --pf-c8: #e34948; --pf-other: #9aa3b2; }

.pfv-hero { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); gap: 14px; margin-bottom: 14px; }
.pfv-card { position: relative; padding: 18px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; }
.pfv-card h3 { margin: 0 0 12px; font-size: 14px; }
.pfv-main { background: radial-gradient(120% 140% at 0% 0%, rgb(var(--accent-rgb) / .16), transparent 55%), radial-gradient(90% 120% at 100% 0%, rgb(var(--brand-1-rgb) / .12), transparent 60%), var(--panel-2); }
.pfv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pfv-top > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.pfv-value { font-size: 38px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pfv-change { font-weight: 700; font-size: 14px; min-height: 20px; }
.pfv-change.up { color: var(--up); }
.pfv-change.down { color: var(--down); }
.pfv-change small { font-weight: 500; margin-left: 2px; }
.pfv-ranges button { padding: 6px 10px; font-size: 12.5px; }
.pfv-ranges button.off { opacity: .35; cursor: not-allowed; }
.pfv-empty { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; }
.pfv-main { display: flex; flex-direction: column; }
.pfv-chart-wrap { position: relative; flex: 1; min-height: 260px; margin: 14px -6px 0; transition: opacity .2s; }
.pfv-chart-wrap.loading { opacity: .45; }
#pfv-chart, #wv-chart { position: absolute; inset: 0; }
.pf-table th { white-space: nowrap; }
.pfv-tip { position: absolute; top: 4px; z-index: 3; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); pointer-events: none; white-space: nowrap; }
.pfv-tip b { font-size: 15px; }
.pfv-tip .up { color: var(--up); }
.pfv-tip .down { color: var(--down); }
.pfv-note { margin: 8px 0 0; }
.skeleton-inline { display: inline-block; width: 140px; height: 14px; border-radius: 6px; background: var(--panel); }

.pfv-alloc { display: flex; flex-direction: column; }
.pfv-donut { position: relative; width: 200px; height: 200px; margin: 0 auto 14px; }
.pfv-donut svg { width: 100%; height: 100%; overflow: visible; }
.pfv-seg { fill: none; stroke-width: 24; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1), stroke-width .15s, opacity .15s; cursor: pointer; }
.pfv-seg:hover { stroke-width: 30; }
.pfv-seg.dim, .pfv-legend li.dim { opacity: .3; }
.pfv-donut-center { position: absolute; inset: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; pointer-events: none; }
.pfv-donut-center small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-donut-center b { font-size: 22px; }
.pfv-donut-center span { font-size: 12px; color: var(--muted); }
.pfv-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pfv-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 13px; cursor: default; transition: opacity .15s, background .15s; }
.pfv-legend li:hover { background: var(--panel); }
.pfv-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-legend small { min-width: 64px; text-align: right; }
.pfv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pf-name .pfv-dot { width: 4px; height: 26px; border-radius: 2px; margin-right: -2px; }

.pfv-contrib { margin: 14px 0 16px; }
.pfv-contrib ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pfv-contrib li { display: grid; grid-template-columns: minmax(140px, 1.1fr) minmax(0, 2fr) 96px 64px; align-items: center; gap: 12px; font-size: 13px; padding: 3px 4px; border-radius: 8px; cursor: pointer; }
.pfv-contrib li:hover { background: var(--panel); }
.pfv-contrib-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-contrib-bar { display: grid; grid-template-columns: 1fr 1fr; height: 12px; }
.pfv-contrib-bar > span { display: flex; }
.pfv-contrib-bar .neg { justify-content: flex-end; border-right: 1px solid var(--border); }
.pfv-contrib-bar i { display: block; height: 100%; animation: pfv-grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.pfv-contrib-bar .pos i { background: var(--up); border-radius: 0 4px 4px 0; transform-origin: left; }
.pfv-contrib-bar .neg i { background: var(--down); border-radius: 4px 0 0 4px; transform-origin: right; }
.pfv-contrib b, .pfv-contrib small { text-align: right; }
.pfv-contrib .up { color: var(--up); }
.pfv-contrib .down { color: var(--down); }
@keyframes pfv-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .pfv-seg, .pfv-contrib-bar i { transition: none; animation: none; } }

@media (max-width: 900px) {
  .pfv-hero { grid-template-columns: 1fr; }
  .pfv-value { font-size: 32px; }
  .pfv-chart-wrap { min-height: 220px; }
  .pfv-contrib li { grid-template-columns: minmax(0, 1fr) 90px; }
  .pfv-contrib-bar, .pfv-contrib small { display: none; }
}

/* Diversification : score et répartition */
.pfv-divers { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 28px; margin-bottom: 14px; }
.pfv-divers > .skeleton { grid-column: 1 / -1; }
.pfv-score h3 { margin-bottom: 4px; }
.pfv-gauge-wrap { position: relative; width: 220px; margin: 0 auto; }
.pfv-gauge { width: 100%; display: block; }
.pfv-gauge path { fill: none; stroke-width: 16; stroke-linecap: round; }
.pfv-gauge-track { stroke: var(--panel); }
.pfv-gauge-arc { transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.pfv-gauge-arc.up { stroke: var(--up); }
.pfv-gauge-arc.wait { stroke: var(--wait); }
.pfv-gauge-arc.down { stroke: var(--down); }
.pfv-gauge-value { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.pfv-gauge-value b { font-size: 40px; letter-spacing: -.02em; line-height: 1; }
.pfv-level { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 14px; font-weight: 700; font-size: 14px; }
.pfv-level .ic { width: 16px; height: 16px; }
.pfv-level.up { color: var(--up); }
.pfv-level.wait { color: var(--wait); }
.pfv-level.down { color: var(--down); }
.pfv-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pfv-part { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 10px; font-size: 12.5px; }
.pfv-part b { text-align: right; }
.pfv-part-bar, .pfv-bar { height: 8px; border-radius: 4px; background: var(--panel); overflow: hidden; }
.pfv-part-bar i, .pfv-bar i { display: block; height: 100%; border-radius: 4px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.pfv-part-bar i.up { background: var(--up); }
.pfv-part-bar i.wait { background: var(--wait); }
.pfv-part-bar i.down { background: var(--down); }
.pfv-bar i { background: var(--accent); }
.pfv-dims { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pfv-dim-tabs { align-self: flex-start; }
.pfv-dim-tabs button { padding: 6px 12px; font-size: 12.5px; }
.pfv-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pfv-bars li { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 56px; align-items: center; gap: 12px; font-size: 13px; }
.pfv-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.pfv-bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-bar-label .flag { flex: none; }
.pfv-cur { display: inline-flex; justify-content: center; min-width: 34px; padding: 1px 4px; border-radius: 5px; background: var(--panel); font-size: 10.5px; color: var(--muted); }
.pfv-cur .ic { width: 12px; height: 12px; }
.pfv-cover { display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.pfv-cover .ic { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* Formule gratuite : aperçu flou */
.pfv-locked { display: block; min-height: 300px; }
.pfv-locked-preview { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 28px; filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.pfv-locked-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center;
  background: radial-gradient(60% 70% at 50% 50%, color-mix(in srgb, var(--panel-2) 85%, transparent), transparent); }
.pfv-locked-cta h3 { margin: 4px 0 0; font-size: 18px; }
.pfv-locked-cta p { margin: 0 0 8px; max-width: 420px; line-height: 1.5; }
.pfv-locked-cta button { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; }
.pfv-locked-icon { display: inline-flex; padding: 12px; border-radius: 14px; background: rgba(139, 123, 255, .16); color: var(--accent); }
.pfv-locked-icon .ic { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .pfv-divers, .pfv-locked-preview { grid-template-columns: 1fr; }
  .pfv-bars li { grid-template-columns: minmax(0, 1fr) 80px 50px; }
}
@media (prefers-reduced-motion: reduce) { .pfv-gauge-arc, .pfv-part-bar i, .pfv-bar i { transition: none; } }

/* Bulles d'aide : les cartes ne coupent plus ce qui dépasse */
.pfv-card { overflow: visible; }
.pfv-main { background-clip: padding-box; }

/* En-tête : bouton « Analyser » */
.pf-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-analyze { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 6px 20px rgb(var(--brand-1-rgb) / .3); }
.pf-analyze:hover { filter: brightness(1.08); }
.pf-analyze.locked { background: var(--panel-2); color: var(--accent); border-color: var(--border); box-shadow: none; }
.pf-analyze .ic { width: 16px; height: 16px; }

/* Objectif */
.pfv-goal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr); gap: 24px; margin-bottom: 14px; }
.pfv-goal.pfv-goal-empty { display: block; }
.pfv-goal > .skeleton { grid-column: 1 / -1; }
.pfv-goal-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pfv-goal-cta > div:nth-child(2) { flex: 1; min-width: 240px; }
.pfv-goal-cta h3 { margin: 0 0 4px; font-size: 16px; }
.pfv-goal-cta p { margin: 0; line-height: 1.5; }
.pfv-goal-cta button { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; }
.pfv-goal-cta-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pfv-goal-icon { display: inline-flex; padding: 12px; border-radius: 14px; background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.pfv-goal-icon .ic { width: 22px; height: 22px; }
.pfv-goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pfv-goal-head h3 { margin: 2px 0 0; font-size: 18px; }
.pfv-goal-progress { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.pfv-goal-pct { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pfv-goal-pct b { font-size: 32px; letter-spacing: -.02em; }
.pfv-goal-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--panel); }
.pfv-goal-status .ic { width: 14px; height: 14px; }
.pfv-goal-status.up { color: var(--up); }
.pfv-goal-status.wait { color: var(--wait); }
.pfv-goal-status.down { color: var(--down); }
.pfv-goal-bar { height: 12px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.pfv-goal-bar i { display: block; height: 100%; border-radius: 6px; transition: width 1.1s cubic-bezier(.2, .8, .2, 1); background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }
.pfv-goal-bar i.wait { background: linear-gradient(90deg, var(--accent), var(--wait)); }
.pfv-goal-bar i.down { background: linear-gradient(90deg, var(--accent), var(--down)); }
.pfv-goal-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.45; }
.pfv-goal-facts li { display: flex; gap: 10px; align-items: flex-start; }
.pfv-goal-facts .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.pfv-goal-chart { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.pfv-proj { width: 100%; height: 190px; }
.pfv-proj-line { fill: none; stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.pfv-proj-target { stroke: var(--up); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.pfv-proj-deadline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.pfv-proj-label, .pfv-proj-year { fill: var(--muted); font-size: 11px; }
.pfv-proj-label { fill: var(--text); font-weight: 600; }
.goal-form [hidden] { display: none !important; }
.goal-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.goal-types button { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); text-align: left; cursor: pointer; }
.goal-types button small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.goal-types button.active { border-color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.goal-form .tx-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.goal-fill-note { margin: 0; }
.goal-form .link.goal-delete { align-self: center; color: var(--down); }

/* Analyse du portefeuille */
.pfa-modal { max-width: 760px; max-height: calc(100vh - 40px); overflow-y: auto; }
.pfa-loading { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 10px; gap: 6px; }
.pfa-loading h2 { margin: 12px 0 0; }
.pfa-orb { display: inline-flex; padding: 18px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); animation: pfa-pulse 1.4s ease-in-out infinite; }
.pfa-orb .ic { width: 28px; height: 28px; }
@keyframes pfa-pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgb(var(--brand-1-rgb) / .12); } }
.pfa-head { padding: 4px 0 16px; border-bottom: 1px solid var(--border); }
.pfa-head h2 { margin: 10px 0 6px; font-size: 21px; line-height: 1.3; }
.pfa-head p { margin: 0; line-height: 1.55; }
.pfa-verdict { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--panel-2); }
.pfa-verdict .ic { width: 15px; height: 15px; }
.pfa-verdict.up { color: var(--up); background: rgba(34, 197, 94, .12); }
.pfa-verdict.wait { color: var(--wait); background: rgba(245, 158, 11, .12); }
.pfa-verdict.down { color: var(--down); background: rgba(239, 68, 68, .12); }
.pfa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.pfa-grid section { padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.pfa-grid section.wide { grid-column: 1 / -1; }
.pfa-grid h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; font-size: 14px; }
.pfa-grid h3 .ic { width: 16px; height: 16px; color: var(--accent); }
.pfa-grid p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.pfa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.pfa-list li { display: flex; gap: 8px; align-items: flex-start; }
.pfa-list .ic { width: 15px; height: 15px; flex: none; margin-top: 3px; }
.pfa-list.pfa-up .ic { color: var(--up); }
.pfa-list.pfa-wait .ic { color: var(--wait); }
.pfa-list.pfa-accent .ic { color: var(--accent); transform: rotate(-90deg); }
.pfa-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 900px) {
  .pfv-goal, .pfa-grid { grid-template-columns: 1fr; }
}

/* Objectif : projection et versements réels */
.pfv-goal-side { display: flex; flex-direction: column; gap: 14px; justify-content: center; min-width: 0; }
.pfv-proj { height: 180px; }
.pfv-track { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.pfv-track-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.pfv-track-chart { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; height: 82px; }
.pfv-track-col { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pfv-track-col small { font-size: 10px; color: var(--muted); }
.pfv-track-col.current small { color: var(--text); font-weight: 700; }
.pfv-track-bar { flex: 1; width: 100%; max-width: 22px; display: flex; align-items: flex-end; border-radius: 4px; background: var(--panel); }
.pfv-track-bar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--muted); opacity: .5; }
.pfv-track-bar i.met { background: var(--up); opacity: 1; }
.pfv-track-bar i.part { background: var(--wait); opacity: .9; }
.pfv-track-plan { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--accent); pointer-events: none; }
.pfv-track-drift { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 0; font-size: 12.5px; font-weight: 600; }
.pfv-track-drift .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.pfv-track-drift.wait { color: var(--wait); }
.pfv-track-drift.up { color: var(--up); }

/* Suivi en direct */
.pfv-live-wrap { display: flex; align-items: center; gap: 8px; min-height: 18px; margin-top: 2px; }
.pfv-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--panel); }
.pfv-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pfv-live.on { color: var(--up); background: rgba(34, 197, 94, .12); }
.pfv-live.on i { background: var(--up); animation: pfv-pulse 1.6s ease-out infinite; }
@keyframes pfv-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 100% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
.pfv-flash-up { animation: pfv-flash-up 1.4s ease-out; }
.pfv-flash-down { animation: pfv-flash-down 1.4s ease-out; }
@keyframes pfv-flash-up { 0% { background: rgba(34, 197, 94, .35); } 100% { background: transparent; } }
@keyframes pfv-flash-down { 0% { background: rgba(239, 68, 68, .35); } 100% { background: transparent; } }
.pfv-value.pfv-flash-up, .pf-kpi b.pfv-flash-up, .pfv-value.pfv-flash-down, .pf-kpi b.pfv-flash-down { border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .pfv-live.on i, .pfv-flash-up, .pfv-flash-down { animation: none; } }

/* Objectif : saisie de la durée, constats et conseils */
.goal-years-row { display: flex; align-items: center; gap: 8px; }
.goal-years-row input { width: 90px; }
.goal-years-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.goal-years-chips button { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.goal-years-chips button.active { border-color: var(--accent); background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.pfv-insight { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border-left: 3px solid var(--up); background: var(--panel); font-size: 13.5px; line-height: 1.5; }
.pfv-insight-wait { border-left-color: var(--wait); }
.pfv-insight-down { border-left-color: var(--down); }
.pfv-insight p { margin: 0; }
.pfv-insight b { font-size: 14.5px; }
.pfv-insight-perf { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px !important; }
.pfv-insight-perf .ic { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--accent); }
.pfv-insight-lever { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px !important; color: var(--text); }
.pfv-insight-lever .ic { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--accent); }

/* Projection interactive de l'objectif */
.pfv-proj-box { display: flex; flex-direction: column; gap: 10px; }
.pfv-proj-wrap { position: relative; }
.pfv-proj-paid { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.pfv-proj-reach { fill: var(--up); stroke: var(--panel-2); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pfv-proj-cursor { stroke: var(--text); stroke-opacity: .35; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pfv-proj-dot { fill: var(--accent); stroke: var(--panel-2); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pfv-proj-hit { fill: transparent; cursor: crosshair; }
.pfv-proj-tip { position: absolute; top: 0; z-index: 4; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); pointer-events: none; white-space: nowrap; }
.pfv-proj-tip b { font-size: 15px; }
.pfv-k { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.pfv-k.paid { background: var(--muted); }
.pfv-k.gain { background: var(--accent); }
.pfv-whatif { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 6px 14px; padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.pfv-whatif-title { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--accent); }
.pfv-whatif-title .ic { width: 15px; height: 15px; }
.pfv-whatif label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.pfv-whatif input[type=range] { width: 100%; accent-color: var(--accent); }
.pfv-whatif-result, .pfv-whatif [data-wi-apply] { grid-column: 1 / -1; margin: 0; }
.pfv-whatif-result:empty { display: none; }
.pfv-whatif [data-wi-apply] { justify-self: start; }
@media (max-width: 640px) { .pfv-whatif { grid-template-columns: 1fr; } }

/* Objectifs crypto : scénarios */
.pfv-scen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 8px; }
.pfv-scen-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border-top: 3px solid var(--muted); }
.pfv-scen-item.s-central { border-top-color: var(--accent); }
.pfv-scen-item.s-optimiste { border-top-color: var(--up); }
.pfv-scen-item b { font-size: 14px; text-transform: capitalize; }
.pfv-scen-item small { font-size: 11.5px; }
.pfv-scen-note { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 12px; }
.pfv-scen-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--wait); }
.pfv-proj-fan { fill: var(--accent); fill-opacity: .12; }
.pfv-proj-bound { fill: none; stroke: var(--accent); stroke-opacity: .45; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.goal-form select { height: 40px; }

/* Vue patrimoine (wealth.js) */
.pf-tab-overview .logo-initials .ic { width: 15px; height: 15px; color: var(--accent); }
.wv-icon { display: inline-flex; padding: 10px; border-radius: 12px; background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.wv-icon .ic { width: 24px; height: 24px; }
.wv-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none; }
.wv-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.wv-switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); transition: background .2s; }
.wv-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.wv-toggle input:checked + .wv-switch { background: rgb(var(--accent-rgb) / .3); border-color: var(--accent); }
.wv-toggle input:checked + .wv-switch::after { transform: translateX(16px); background: var(--accent); }
.wv-toggle input:focus-visible + .wv-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.wv-alloc { display: flex; flex-direction: column; }
.wv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.wv-grid .pfv-card h3 { margin-bottom: 14px; }
.wv-divers-body { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
.wv-divers .pfv-gauge-wrap { width: 190px; }
.wv-top { margin: 12px 0 0; line-height: 1.6; }
.wv-list h3 { margin-bottom: 8px; }
.wv-table tbody tr { cursor: pointer; }
@media (max-width: 900px) {
  .wv-grid, .wv-divers-body { grid-template-columns: 1fr; }
}

/* ETF à la loupe */
.pfv-exp li { grid-template-columns: minmax(180px, 260px) 1fr 56px; }
.pfv-exp-name { display: flex; flex-direction: column; min-width: 0; }
.pfv-exp-name b, .pfv-exp-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-exp-name small { font-size: 11px; }
.pfv-bars .pfv-exp-name b { text-align: left; }
.pfv-overlaps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pfv-overlaps li { padding: 12px 14px; border-radius: 12px; background: var(--panel); }
.pfv-overlaps p { margin: 8px 0 0; line-height: 1.5; }
.pfv-ov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pfv-ov-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--panel-2); }
.pfv-ov-tag .ic { width: 13px; height: 13px; }
.pfv-ov-tag.wait { color: var(--wait); background: rgba(245, 158, 11, .12); }
.pfv-ov-tag.muted { color: var(--muted); }
.pfv-ov-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.pfv-ov-bars > span { display: grid; grid-template-columns: minmax(0, 110px) 1fr 40px; align-items: center; gap: 8px; font-size: 12.5px; }
.pfv-ov-bars small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfv-ov-bars b { text-align: right; }
.pfv-etf-ok { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--up); font-weight: 600; }
.pfv-etf-ok .ic { width: 16px; height: 16px; }
.pfv-fees-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.pfv-fees-sum > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--panel); }
.pfv-fees-sum b { font-size: 22px; }
.pfv-fees-table { margin-bottom: 8px; }
.pfv-fees-table tbody tr { cursor: default; }
@media (max-width: 900px) {
  .pfv-ov-bars, .pfv-fees-sum { grid-template-columns: 1fr; }
  .pfv-exp li { grid-template-columns: minmax(0, 1fr) 70px 50px; }
}

/* Fiscalité */
.pfv-tax { margin-bottom: 14px; }
.pfv-tax h3 { margin-bottom: 14px; }
.pfv-tax-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; }
.pfv-tax-left { display: flex; flex-direction: column; gap: 14px; }
.pfv-tax-ms, .pfv-tax-ceil { display: flex; flex-direction: column; gap: 6px; }
.pfv-tax-ms-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; }
.pfv-tax-ms-head > span { display: inline-flex; align-items: center; gap: 6px; }
.pfv-tax-ms-head .ic { width: 15px; height: 15px; color: var(--accent); }
.pfv-tax-ms.done .pfv-tax-ms-head .ic { color: var(--up); }
.pfv-tax-ms small, .pfv-tax-ceil small { line-height: 1.45; }
.pfv-tax-est { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pfv-tax-est li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border-left: 3px solid var(--border); }
.pfv-tax-est li > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pfv-tax-est li > b { font-size: 16px; white-space: nowrap; }
.pfv-tax-est li.pfv-tax-up { border-left-color: var(--up); }
.pfv-tax-est li.pfv-tax-wait { border-left-color: var(--wait); }
.pfv-tax-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.5; }
.pfv-tax-notes li { display: flex; gap: 8px; align-items: flex-start; }
.pfv-tax-notes .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.pfv-tax-foot { margin: 14px 0 0; }
.pf-opened-row { display: flex; gap: 8px; }
.pf-opened-row select { height: 40px; flex: 1; }
.pf-opened-row input { width: 110px; }
.pf-step.pf-opened[hidden] { display: none; }
@media (max-width: 900px) { .pfv-tax-grid { grid-template-columns: 1fr; } }

/* ETF à la loupe, dans la diversification */
.pfv-etf-in { display: flex; flex-direction: column; gap: 12px; }
.pfv-etf-tabs { align-self: flex-start; }
.pfv-etf-tabs button { padding: 5px 11px; font-size: 12px; }
.pfv-dim-tabs button .ic { width: 13px; height: 13px; }

/* Saisie : confirmation d'un titre non éligible au PEA */
.tx-confirm { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .4); }
.tx-confirm p { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13.5px; line-height: 1.5; }
.tx-confirm .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--wait); }
.tx-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tx-confirm-actions button { height: 38px; padding: 0 14px; }
.tx-confirm-yes { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 10px; cursor: pointer; }
.pfv-tax-bar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.pfv-tax-bar b { font-size: 13px; min-width: 44px; text-align: right; }

/* Saisie : autres cotations proposées, suppression d'une ligne */
.tx-alt { display: flex; flex-direction: column; gap: 6px; }
.tx-alt button { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.tx-alt button:hover { border-color: var(--accent); }
.pf-row-actions { width: 34px; padding-left: 0 !important; }
.pf-row-actions .pf-tx-del { opacity: 0; transition: opacity .15s; }
.pf-table tr:hover .pf-row-actions .pf-tx-del, .pf-row-actions .pf-tx-del:focus-visible { opacity: 1; }
@media (hover: none) { .pf-row-actions .pf-tx-del { opacity: 1; } }

/* ---------- Import d'un relevé ---------- */
.pf-import { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 700; cursor: pointer; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.pf-import:hover { border-color: var(--accent); }
.pf-import.locked { color: var(--muted); }
.pf-import .ic { width: 16px; height: 16px; }
.pf-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-empty-actions button:not(.primary) { display: inline-flex; align-items: center; gap: 6px; }
.imp-modal { width: min(920px, calc(100vw - 32px)); max-width: none; }
.imp-body { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--accent); background: var(--panel-2); }
.imp-drop .ic { width: 30px; height: 30px; color: var(--accent); }
.imp-privacy { display: flex; gap: 6px; align-items: flex-start; }
.imp-privacy .ic { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.imp-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.imp-loading .spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: imp-spin .8s linear infinite; }
@keyframes imp-spin { to { transform: rotate(360deg); } }
.imp-summary { margin: 0; }
.imp-todo { color: var(--wait); font-weight: 700; }
.imp-table-scroll { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.imp-table th { position: sticky; top: 0; background: var(--panel); text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--border); z-index: 1; }
.imp-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.imp-table tr.off td { opacity: .45; }
.imp-table input:not([type=checkbox]), .imp-table select { height: 32px; font-size: 12.5px; padding: 0 8px; }
.imp-table input[type=date] { width: 132px; }
.imp-table input[data-imp-field=quantity], .imp-table input[data-imp-field=fees] { width: 76px; }
.imp-table input[data-imp-field=price] { width: 90px; }
.imp-table select { max-width: 230px; margin-top: 4px; }
.imp-title { min-width: 180px; }
.imp-label { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-title small { display: block; font-size: 11px; }
.imp-money { display: inline-flex; align-items: center; gap: 4px; }
.imp-status { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--wait); }
.imp-table tr.s-duplicate .imp-status, .imp-table tr.s-twin .imp-status { color: var(--muted); }
.imp-msg td { padding-top: 0; font-size: 11.5px; color: var(--wait); border-bottom: 1px solid var(--border); }
.imp-msg.s-duplicate td, .imp-msg.s-twin td { color: var(--muted); }
.imp-msg .ic { width: 12px; height: 12px; vertical-align: -2px; }
.imp-table tr[data-imp-row]:has(+ .imp-msg) td { border-bottom: 0; }
.imp-skipped ul { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.imp-skipped li { display: flex; justify-content: space-between; gap: 10px; }
.imp-skipped summary { cursor: pointer; }
.imp-files { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.imp-files li { display: flex; align-items: center; gap: 8px; }
.imp-files li .ic { width: 14px; height: 14px; color: var(--up, #16a34a); flex: none; }
.imp-files li.err .ic, .imp-files li.err span { color: var(--wait); }
.imp-file { display: block; max-width: 130px; margin-top: 3px; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-more { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.imp-add { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent); font-weight: 600; }
.imp-add .ic { width: 14px; height: 14px; }
.imp-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-actions .primary { height: 42px; padding: 0 20px; }
.imp-empty { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--panel-2); }
.imp-empty .ic { width: 20px; height: 20px; color: var(--wait); flex: none; }
@media (max-width: 640px) {
  .pf-import { flex: 1; justify-content: center; }
  .imp-table-scroll { max-height: 60vh; }
}

/* Explication des intérêts des livrets */
.pf-livret-help { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.pf-livret-help summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 700; font-size: 13.5px; list-style: none; }
.pf-livret-help summary::-webkit-details-marker { display: none; }
.pf-livret-help summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.pf-livret-help[open] summary::after { transform: rotate(180deg); }
.pf-livret-help summary .ic { width: 16px; height: 16px; color: var(--accent); }
.pf-livret-help-body { padding: 0 14px 14px; font-size: 13px; line-height: 1.55; }
.pf-livret-help-body p { margin: 0 0 8px; }
.pf-livret-help-body ul { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.pf-livret-example { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); margin: 0 !important; }
.pf-reprise-hint { margin: 12px 0 0; }
.pf-reprise small { display: block; margin-top: 6px; line-height: 1.45; }
.pf-inelig { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--wait); background: rgba(245, 158, 11, .12); width: fit-content; cursor: help; }
.pf-inelig .ic { width: 11px; height: 11px; }
.tx-warn.soft { background: var(--panel-2); color: var(--muted); }

/* Détail des intérêts d'un livret */
.pf-livret-modal { width: min(820px, calc(100vw - 32px)); max-width: none; }
.pf-livret-years { margin-top: 12px; }
.pf-kpi-link { align-items: flex-start; justify-content: flex-start; height: auto; margin: 0; text-align: left; cursor: pointer; font: inherit; font-weight: 400; color: inherit; box-shadow: none; }
.pf-kpi-link:hover { border-color: var(--accent); }
.pf-kpi-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.pf-kpi-more .ic { width: 13px; height: 13px; }
.pf-livret-detail h4 { margin: 16px 0 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pf-livret-scroll { overflow-x: auto; }
.pf-livret-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-livret-table th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pf-livret-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.pf-livret-table td small { display: block; font-size: 11px; margin-top: 2px; }
.pf-livret-table tr.total td { border-bottom: 2px solid var(--border); background: var(--panel-2); }
.pf-livret-detail > p { margin: 10px 0 0; }

/* Répartition cible (portfolio-target.js) */
.pfv-legend.has-target li { grid-template-columns: 12px minmax(0, 1fr) auto auto auto; }
.pft-goal { font-size: 11.5px; white-space: nowrap; }
.pft-goal.wait { color: var(--wait); font-weight: 600; }
.pft { margin-top: auto; padding-top: 12px; }
.pft:empty { display: none; }
.pft-cta { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.pft-cta small { line-height: 1.45; }
.pft-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; }
.pft-btn .ic { width: 15px; height: 15px; }
.pft-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--panel); border-top: 0; }
.pft-status > .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.pft-status.up > .ic, .pft-status.up b { color: var(--up); }
.pft-status.wait > .ic, .pft-status.wait b { color: var(--wait); }
.pft-status div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.pft-status small { line-height: 1.4; }
.pft-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pft-modal { width: min(560px, calc(100vw - 32px)); max-width: none; }
.pft-plan-modal { width: min(680px, calc(100vw - 32px)); }
.pft-quick { display: flex; gap: 14px; flex-wrap: wrap; }
.pft-rows { display: flex; flex-direction: column; gap: 6px; }
.target-form .pft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; }
.pft-row-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pft-row-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pft-input { display: flex; align-items: center; gap: 6px; }
.pft-input input { width: 100%; text-align: right; }
.pft-sum { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.pft-sum .ic { width: 15px; height: 15px; }
.pft-sum.up { color: var(--up); }
.pft-sum.down { color: var(--down); }
.pft-tol { display: flex; width: fit-content; margin-top: 4px; }
.target-form .link.goal-delete { align-self: center; color: var(--down); }
.pft-amount { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pft-amount input { width: 140px; }
.pft-plan { margin-top: 14px; }
.pft-table td:nth-child(n+2), .pft-table th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.pft-name-cell { max-width: 0; width: 100%; }
.pft-name-cell .pft-row-name { display: flex; }
.pft-table tr.pft-skip td { color: var(--muted); }
.pft-table td.wait { color: var(--wait); }
.pft-verdict { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 6px; font-size: 13.5px; line-height: 1.45; }
.pft-verdict .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.pft-verdict.up { color: var(--up); }
.pft-verdict.up .ic { color: var(--up); }
.pft-verdict.wait .ic { color: var(--wait); }
@media (max-width: 560px) {
  .target-form .pft-row { grid-template-columns: minmax(0, 1fr) 92px; }
  .target-form .pft-row > small { display: none; }
  .pft-table th:nth-child(2), .pft-table td:nth-child(2) { display: none; }
}
.pft-rules { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.pft-rules legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.pft-whole { display: flex; width: fit-content; flex-wrap: wrap; }
.pft-rules-recap, .pft-blocked { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 8px; }
.pft-rules-recap .ic, .pft-blocked .ic, .pft-verdict:not(.up):not(.wait) .ic { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* Diagramme de répartition actuelle / cible */
.pfv-alloc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.pfv-alloc-head h3 { margin: 0; }
.pft-view button { font-size: 12px; padding: 4px 9px; }
.pft-chart { display: none; }
.pft-show-target .pft-chart { display: block; margin-bottom: 12px; }
.pft-show-target .pfv-donut, .pft-show-target .pfv-legend { display: none; }
.pft-bars { display: flex; flex-direction: column; gap: 4px; }
.pft-bars-key { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.pft-bars-key span { display: inline-flex; align-items: center; gap: 6px; }
.pft-bars-key i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--muted); }
.pft-bars-key i.k-add { background-color: var(--muted); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px); opacity: .7; }
.pft-bars-key i.k-tick { width: 2px; height: 14px; border-radius: 1px; background: var(--text); }
.pft-bar-row { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 64px; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 8px; font-size: 13px; outline: none; }
.pft-bar-row:hover, .pft-bar-row:focus-visible { background: var(--panel); }
.pft-bar-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pft-bar-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pft-bar-track { position: relative; height: 10px; border-radius: 4px; background: var(--border); }
.pft-bar-cur { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.pft-bar-add { position: absolute; top: 0; bottom: 0; margin-left: 2px; border-radius: 0 4px 4px 0; opacity: .7; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px); }
.pft-bar-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); box-shadow: 0 0 0 2px var(--panel-2); }
.pft-bar-val { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pft-bar-val b { font-size: 13px; }
.pft-bar-val b.wait { color: var(--wait); }
.pft-bar-val small { font-size: 11px; }
.pft-bar-tip { display: none; position: absolute; left: 6px; right: 6px; bottom: calc(100% + 2px); z-index: 5; padding: 6px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.4; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.pft-bar-row:hover .pft-bar-tip, .pft-bar-row:focus-visible .pft-bar-tip { display: block; }
.pft-plan .pft-bars { margin: 4px 0 14px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.target-form .pft-row { grid-template-columns: minmax(0, 1fr) auto 104px 28px; }
.pft-row.prospect { border-style: dashed; }
.pft-remove { width: 28px; height: 28px; }
.pft-remove .ic { width: 14px; height: 14px; }
.pft-row-warn { grid-column: 1 / -1; font-size: 12px; line-height: 1.4; }
.pft-row-warn.down { color: var(--down); }
.pft-row-warn.wait { color: var(--wait); }
.pft-add { position: relative; }
@media (max-width: 560px) {
  .target-form .pft-row { grid-template-columns: minmax(0, 1fr) 92px 28px; }
  .pft-bar-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .pft-bar-track { grid-column: 1 / -1; grid-row: 2; }
}
