/* Valdius Capital — thème inspiré de Finary, accent vert jade (sombre par défaut) */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0e;
  --surface: #121419;
  --surface-2: #191c22;
  --surface-3: #22262e;
  --border: rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --text: #f3f3f1;
  --text-2: #b4b7be;
  --muted: #7d818a;
  --accent: #2ec4b6;
  --accent-2: #14a394;
  --accent-ink: #03201d;
  --up: #2ec4b6;
  --down: #f47323;
  --gold: #d9a85a;
  --grid: #23262d;
  --series-1: #2ec4b6;
  --series-2: #3987e5;
  --series-3: #c98500;
  --series-4: #d95926;
  --series-5: #d55181;
  --series-6: #9085e9;
  --series-7: #e66767;
  --series-8: #199e70;
  --neutral: #4a4d55;
  --neutral-dark: #2c2f35;
  --in: #2ec4b6;
  --out: #f47323;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 30px rgba(0,0,0,.35);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #ececea;
  --border: rgba(11,11,11,.08);
  --border-strong: rgba(11,11,11,.16);
  --text: #0e0f12;
  --text-2: #4d5058;
  --muted: #80838b;
  --accent: #0e8f83;
  --accent-2: #0a7168;
  --accent-ink: #ffffff;
  --up: #0e8f83;
  --down: #e8650f;
  --gold: #a8742a;
  --grid: #ececea;
  --series-1: #0e8f83;
  --series-2: #2a78d6;
  --series-3: #eda100;
  --series-4: #eb6834;
  --series-5: #e87ba4;
  --series-6: #6250d6;
  --series-7: #e34948;
  --series-8: #1baf7a;
  --neutral: #c3c2b7;
  --neutral-dark: #74767d;
  --in: #0e8f83;
  --out: #e8650f;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* Textes courants justifiés (paragraphes, bandeaux) ; tableaux, chiffres, titres et boutons gardent leur alignement */
p, .banner { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.login-card p { text-align: center; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  display: flex; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.up { color: var(--up); }
.down { color: var(--down); }
/* Thème sombre : vert atténué hors chiffres en gras ; orange en teinte pleine partout */
:root:not([data-theme="light"]) { --up-soft: color-mix(in srgb, var(--up) 72%, var(--muted)); }
:root:not([data-theme="light"]) .up { color: var(--up-soft); }
:root:not([data-theme="light"]) :is(b, strong, .pill, .kpi-value, .hero-value, .hero-delta, [style*="font-weight:6"], [style*="font-weight:7"]) .up,
:root:not([data-theme="light"]) .up:is(b, strong, .pill, .kpi-value, .hero-value, .hero-delta, [style*="font-weight:6"], [style*="font-weight:7"]) { color: var(--up); }
svg { fill: currentColor; }

/* ---------- Layout ---------- */
.sidebar {
  width: 284px; flex: 0 0 284px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px; padding: 22px 14px;
  border-right: 1px solid var(--border); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; padding: 0 8px; }
.brand b { font-weight: 700; color: var(--accent); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font-weight: 800;
}
.brand-lg { font-size: 22px; justify-content: center; }
.brand-lg .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 20px; }
/* Menu horizontal dans la barre du haut */
.nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; white-space: nowrap;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active svg { color: var(--accent); opacity: 1; }
.sidebar > * { flex-shrink: 0; } /* écran peu haut : la colonne défile au lieu d'écraser son contenu */
.sidebar-foot { margin-top: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.sidebar-foot .muted { overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
/* Titre de page : masqué à l'écran (la page active est signalée dans le menu), conservé pour les lecteurs d'écran */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.view { padding: 28px 32px 64px; max-width: 1360px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* Indicateurs (colonne de gauche) : un seul cadre, une ligne par indicateur ; valeur du compte, puis performance et change */
.stats { display: flex; flex-direction: column; margin-top: 40px; padding: 4px 12px; font-size: 12.5px; font-style: italic; font-variant-numeric: tabular-nums; }
.stats-col { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; min-width: 0; }
.stats-col + .stats-col { border-top: 1px solid var(--border); }
.stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 3px 6px; margin: 0 -6px; border-radius: 6px;
  border: 0; background: none; color: var(--text); font: inherit; text-align: left; white-space: nowrap; }
.stat b { font-weight: 400; }
.stat[hidden] { display: none; }
.stat .muted { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.stat .small { text-align: right; }
:is(a, button).stat { cursor: pointer; }
.live { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Controls ---------- */
.select, .input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; outline: none; min-height: 36px;
}
.select:focus, .input:focus { border-color: var(--accent); }
/* Listes déroulantes : cadre fin, chevron discret ; survol vert jade (liste personnalisable : Edge / Chrome récents) */
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; font-size: 13px; font-weight: 500; min-height: 34px; padding: 7px 32px 7px 12px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238a8f98' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 12px;
  transition: border-color .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.select:hover { border-color: var(--border-strong); }
@supports (appearance: base-select) {
  .select, .select::picker(select) { appearance: base-select; }
  .select { display: inline-flex; align-items: center; gap: 10px; padding-right: 10px; background-image: none; }
  .select::picker-icon { content: ''; width: 12px; height: 12px; background: var(--muted); transition: rotate .2s;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
  .select:open { border-color: var(--accent); }
  .select:open::picker-icon { rotate: 180deg; background: var(--accent); }
  .select::picker(select) {
    margin-top: 6px; padding: 4px; min-width: anchor-size(width); max-height: 320px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.28);
    opacity: 1; translate: 0 0; transition: opacity .15s, translate .15s, overlay .15s allow-discrete, display .15s allow-discrete;
  }
  @starting-style { .select::picker(select):popover-open { opacity: 0; translate: 0 -4px; } }
  .select option { padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; gap: 8px; }
  .select option::checkmark { color: var(--accent); }
  .select option:checked { color: var(--text); font-weight: 600; }
  .select option:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); outline: none; }
}
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--border-strong); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; min-height: 38px; }
.btn:hover { border-color: var(--border-strong); }
.btn-block { width: 100%; }
/* Boutons d'action : fond turquoise translucide (même rendu que « Générer l'IFU ») */
.btn-primary, .btn-soft { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.btn-primary:hover, .btn-soft:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); border-color: var(--accent); }
/* Compte en lecture seule : commandes de modification masquées */
.read-only .wl-del, .read-only .wl-edit, .read-only .search-box, .read-only [data-edit] { display: none !important; }
.ro-banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; }
/* Pastilles hors des cartes : sans fond ; dans une carte, groupées sur un fond léger */
.chips { display: flex; gap: 4px; flex-wrap: wrap; background: transparent; padding: 4px 0; border-radius: 12px; width: fit-content; }
.card .chips { background: var(--surface-2); padding: 4px; }
.chip { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.chip:hover { color: var(--text); }/* Bouton à la taille d'une pastille (.chip) */
.btn.btn-sm { min-height: 0; padding: 5px 12px; border-radius: 9px; font-size: 12.5px; }
.btn[hidden] { display: none; }
.chip.active { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
/* Au-dessus des blocs suivants (chacun a son propre contexte d'empilement via l'animation d'entrée) : suggestions de recherche visibles */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: relative; z-index: 4; } /* sous la barre du haut collante (5) */
.toolbar .grow { flex: 1; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
/* Synthèse : indicateurs empilés à gauche, répartition à droite (graphique et légende côte à côte) */
.g-1-2 { grid-template-columns: minmax(220px, 1fr) minmax(0, 2.4fr); }
.kpis-stack { display: flex; flex-direction: column; gap: 12px; }
.kpis-stack .kpi { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.alloc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: center; }
.alloc .chart-box { margin-top: 0; }
/* Synthèse : courbe du patrimoine à gauche, répartition dans une colonne étroite à droite */
/* les deux blocs ont la même hauteur ; le graphique de répartition est centré dans la place restante */
.g-syn { grid-template-columns: minmax(0, 1fr) 320px; }
.syn-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.syn-side > .card { flex: 1; display: flex; flex-direction: column; }
.syn-side .alloc-col { flex: 1; align-content: center; }
.alloc-col { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.alloc-col .chart-box.sm { height: 200px; }
#alloc-legend .row-item { padding: 5px 4px; font-weight: 500; font-size: 13px; }
#alloc-legend .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 22px 0 6px; }
.card-head + .sec-title { margin-top: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; text-align: right; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; margin-top: 2px; text-align: right; }

/* Hero (patrimoine) */
.hero { padding: 26px 26px 14px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-value { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin: 6px 0 8px; }
.hero-delta { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 400; font-size: 13.5px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 12.5px; }
.pill.up { background: color-mix(in srgb, var(--up) 14%, transparent); }
.pill.down { background: color-mix(in srgb, var(--down) 14%, transparent); }
.readout { color: var(--muted); font-size: 12.5px; min-height: 18px; margin-top: 4px; }
.readout b { color: var(--text); font-weight: 600; }
.chart-box { position: relative; height: 320px; margin-top: 14px; }
.chart-box.sm { height: 240px; }
/* Dividende de la fiche valeur : lignes de la watchlist, sans cadre ni action au clic */
.q-fund { margin-top: 18px; }
.q-fund[hidden] { display: none; }
.q-fund .wl-row { cursor: default; padding-top: 8px; padding-bottom: 8px; }
.q-fund .wl-row:hover { background: none; }
.q-fund .wl-row > .name { flex: 0 1 220px; }
.q-fund .wl-row > .right { flex: 0 0 auto; min-width: 8.5em; }
.q-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-top: 22px; }
.q-head .sec-title { margin: 0; }
.q-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.q-period { margin: 0; }
.q-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 8px; }
.q-legend i:first-child { margin-left: 0; }
.q-charts { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.q-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px 8px; }
.q-charts .chart-box.q-chart { height: 180px; margin-top: 8px; }
.q-title { color: var(--text); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Onglets de la fiche valeur */
.q-tabs { margin-top: 20px; border-bottom: 1px solid var(--border); width: 100%; border-radius: 0; padding-bottom: 8px; }
.q-tabs[hidden], .q-pane[hidden] { display: none; }
/* Onglet Analyse */
.ana-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.ana-flake { height: 270px; position: relative; padding: 8px; }
.ana-scores { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.ana-score { display: grid; grid-template-columns: minmax(0, 1fr) auto 3em; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.ana-score:hover { background: var(--surface-3); }
.ana-score b { text-align: right; font-weight: 600; }
.ana-dots { display: flex; gap: 4px; }
.ana-dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-3); }
.ana-dots i.on { background: var(--up); }
.ana-dots i.low { background: var(--down); }
.ana-note { margin-top: 8px; font-style: italic; }
.chk-list { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.chk-list li { display: flex; gap: 10px; align-items: flex-start; }
.chk { flex: 0 0 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.chk.ok { color: var(--up); background: color-mix(in srgb, var(--up) 15%, transparent); }
.chk.ko { color: var(--down); background: color-mix(in srgb, var(--down) 15%, transparent); }
.chk.na { color: var(--muted); background: var(--surface-3); }
.tgt { margin: 22px 0 8px; }
.tgt-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); }
.tgt-range { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: color-mix(in srgb, var(--up) 30%, transparent); }
.tgt-mark { position: absolute; top: -6px; width: 4px; height: 20px; border-radius: 2px; transform: translateX(-50%); }
.tgt-mean { background: var(--up); }
.tgt-price { background: var(--text); }
.tgt-legend { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.reco-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 12px 0 8px; }
.reco-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.reco-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.q-facts { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-bottom: 12px; }
.q-facts > div { display: flex; flex-direction: column; gap: 2px; }
.q-facts b { font-weight: 600; font-size: 14px; }
/* Juste valeur DCF */
.dcf-head { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.dcf-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
/* Jauge cours / juste valeur (une seule barre) */
.dcf-gauge { margin: 16px 0 8px; }
.dcf-g-bar { position: relative; height: 54px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.dcf-g-base { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--text-2) 28%, transparent); transition: width .2s; overflow: hidden; }
.dcf-g-gap { position: absolute; top: 0; bottom: 0; transition: left .2s, width .2s; padding: 5px 12px 0; white-space: nowrap; overflow: hidden; }
/* Valeurs placées à l'identique des deux côtés : en bas à droite de leur zone (à gauche, contre la limite de la partie grise) */
.dcf-g-lab { position: absolute; right: 11px; bottom: 6px; text-align: right; white-space: nowrap; line-height: 1.2; }
.dcf-g-gap.g-up { --c: var(--up); }
.dcf-g-gap.g-down { --c: var(--down); }
.dcf-g-gap { background: color-mix(in srgb, var(--c) 26%, transparent); border-left: 2px solid var(--c); }
.dcf-g-title { display: block; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.dcf-g-bar b { display: block; font-size: 13px; font-weight: 600; }
/* Libellé en bloc des deux côtés : sinon, à droite, la ligne prend la hauteur de la police du parent et décale le texte */
.dcf-g-bar .small { display: block; line-height: 1.2; }
.dcf-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px; margin: 14px 0 6px; align-items: end; }
.dcf-sliders label { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; }
.dcf-sliders input { grid-column: 1 / -1; grid-row: 2; width: 100%; accent-color: var(--accent); }
.dcf-sliders b { font-weight: 600; text-align: right; }
.dcf-sliders [data-tip] { justify-self: start; cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.dcf-reset { justify-self: start; grid-column: 1 / -1; border: 0; background: none; padding: 2px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.dcf-reset:hover { color: var(--text); }
/* Verdict de l'onglet Analyse : deux notes sur 10 et leur détail */
.rt-card { margin-bottom: 14px; }
.rt-verdict { margin-left: 8px; font-weight: 600; color: var(--accent); }
.rt-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 10px 0 4px; }
.rt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rt-note { font-size: 22px; font-weight: 700; }
.rt-note small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rt-parts { list-style: none; margin: 6px 0 0; padding: 0; }
.rt-parts li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
@media (max-width: 640px) { .rt-cols { grid-template-columns: 1fr; } }
.dcf-facts { margin-top: 14px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.own-t td { padding: 8px 6px; }
.own-t th { padding: 8px 6px; background: transparent; position: static; }
@media (max-width: 640px) { .ana-top { grid-template-columns: 1fr; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { height: 0; border-top: 2px dashed; border-radius: 0; width: 14px; vertical-align: 3px; }

/* ---------- Lists & tables ---------- */
.list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.row-item:last-child { border-bottom: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; }
.logo {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--text-2); overflow: hidden;
}
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.logo.cash { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }

.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t-pos { table-layout: fixed; min-width: 780px; }
table.t-pos .pos-tog { cursor: pointer; user-select: none; } /* montant / pourcentage au clic */
/* Lignes compactes : marges réduites, logo plus petit */
table.t-pos td { padding: 6px 10px; }
table.t-pos th { padding: 8px 10px; }
table.t-pos .logo { width: 26px; height: 26px; flex-basis: 26px; border-radius: 8px; font-size: 9px; }
table.t-pos .logo img { padding: 2px; }
table.t-pos .cell-name { gap: 8px; }
table.t-pos .cell-name > div:not(.logo) { flex: 1; } /* le nom prend la place, pas le logo */
table.t-pos td.theo { font-style: italic; cursor: help; } /* option : prix théorique hors séance */
table.t-pos .cell-name > .itm { flex: 0 0 auto; margin-left: auto; padding-left: 8px; white-space: nowrap; font-size: 11.5px; } /* actions et options : mêmes largeurs de colonnes (POS_COLS) */
table.t-pos .cell-name > div { min-width: 0; }
table.t-pos .cell-name .name, table.t-pos .cell-name .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); cursor: default; }
.t th.sortable { cursor: pointer; }
.t th.sortable:hover { color: var(--text); }
.t td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t .r, .t th.r { text-align: right; }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-name .name { font-weight: 600; }
.cell-name .sub { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.gold { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tag.in { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.tag.out { background: color-mix(in srgb, var(--down) 16%, transparent); color: var(--down); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); font-size: 12.5px; }

/* Watchlist */
.wl-del { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; font-size: 18px; line-height: 1; }
.wl-del:focus { opacity: 1; }
.wl-del:hover { background: var(--surface-3); color: var(--text); }
/* Crayon (tag) à côté de la croix, au survol */
.wl-edit { position: absolute; top: 10px; right: 38px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; display: grid; place-items: center; padding: 0; }
.wl-edit svg { width: 14px; height: 14px; fill: currentColor; }
.wl-row:hover .wl-edit, .wl-edit:focus { opacity: 1; }
.wl-edit:hover { background: var(--surface-3); color: var(--text); }
/* Tag : gris, italique ; en liste, colonne fixe après le nom pour que tous les tags soient alignés */
.wl-tag { color: var(--muted); font-style: italic; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-tag-input { font-style: normal; height: 28px; padding: 3px 8px; font-size: 12.5px; width: min(220px, 100%); }
/* Watchlist en lignes : logo, nom, cours, variation (sans mini-graphique) */
.wl-list { padding: 2px 12px; }
.wl-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; font-size: 13.5px; }
.wl-row .logo { width: 24px; height: 24px; flex-basis: 24px; border-radius: 7px; font-size: 9px; }
.wl-row .logo img { padding: 2px; }
/* Thème sombre : logos retouchés par logoFit (app.js), sans plaque blanche ; masqués le temps de la retouche */
:root:not([data-theme="light"]) .logo img:not(.lg-plain) { background: transparent; }
:root:not([data-theme="light"]) .logo img:not([data-fit]) { opacity: 0; }
:root:not([data-theme="light"]) .logo img.lg-opaque { padding: 0; }
.wl-row .wl-del { width: 22px; height: 22px; font-size: 16px; }
.wl-row:last-child { border-bottom: 0; }
.wl-row:hover { background: var(--surface-2); }
.wl-row .grow { flex: 1; min-width: 0; }
.wl-row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-row .right { text-align: right; font-weight: 600; white-space: nowrap; }
.wl-row .right .ccy { font-size: 12px; color: var(--muted); font-weight: 500; }
.wl-row .pill { min-width: 70px; text-align: center; justify-content: center; padding: 2px 8px; font-size: 12px; }
.wl-row .wl-del, .wl-row .wl-edit { position: static; flex: none; }
.wl-row .wl-edit { width: 22px; height: 22px; }
.wl-row > .name { flex: 0 1 300px; min-width: 0; }
.wl-row > .wl-tag { flex: 1 1 88px; min-width: 0; }
/* Notes sur 10 (qualité, prix) : colonnes fixes et centrées */
.wl-row > .wl-note { flex: 0 0 52px; text-align: center; font-size: 13px; cursor: help; }
.wl-head .wl-note { font-size: 11.5px; font-weight: 500; color: var(--muted); }
@media (max-width: 640px) { .wl-row > .wl-note { display: none; } }
/* Cours et variation à largeur fixe : colonnes de notes alignées d'une ligne et d'un bloc à l'autre */
.wl-row > .right { flex: 0 0 8.5em; }
.wl-row > .pill { flex: 0 0 76px; min-width: 0; }
/* Ligne de titres : mêmes marges que les blocs (bordure + padding de .wl-list), cellules vides invisibles */
.wl-head { padding: 0 13px; margin-bottom: -12px; }
.wl-head .wl-row { border: 0; cursor: default; padding-top: 0; padding-bottom: 0; }
.wl-head .wl-row:hover { background: none; }
.wl-head .logo, .wl-head .pill { visibility: hidden; }
.wl-ph { flex: 0 0 22px; }
/* Un bloc par tag, sans titre */
.wl-groups { display: flex; flex-direction: column; gap: 20px; }
.wl-row:hover .wl-del { opacity: 1; }
.flash-up { animation: flashUp 1s; }
.flash-down { animation: flashDown 1s; }
@keyframes flashUp { from { background: color-mix(in srgb, var(--up) 25%, transparent); } to { background: transparent; } }
@keyframes flashDown { from { background: color-mix(in srgb, var(--down) 25%, transparent); } to { background: transparent; } }
.search-box { position: relative; width: min(420px, 100%); }
.search-box .input { width: 100%; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; background: none; border: 0; text-align: left; cursor: pointer; }
.suggest button:hover, .suggest button.hl { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
/* Défilement porté par #modal-body : la barre reste à l'intérieur du coin arrondi de la carte */
.modal-card { position: relative; display: flex; flex-direction: column; width: min(760px, 100%); max-height: 90vh; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; }
#modal-body { min-height: 0; overflow: auto; padding: 24px; }
.modal-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--border-strong); padding: 10px 16px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
label input { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; outline: none; color: var(--text); }
label input:focus { border-color: var(--accent); }
label.remember { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
label.remember input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.form-error { color: var(--down); font-size: 13px; }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 28px; text-align: center; color: var(--text-2); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* Login */
.login-page { display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; text-align: center; }
.login-stack { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; text-align: left; }

/* Bandeau d'alerte (connexion IBKR) */
.banner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 10px 20px; font-size: 13.5px; font-weight: 600; text-align: center;
  color: var(--down); background: color-mix(in srgb, var(--down) 14%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--down) 40%, transparent); }
.banner.warn { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); border-bottom-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.gold { color: var(--gold); }
.banner a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.banner[hidden] { display: none; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); line-height: 1.5; }
.steps b { color: var(--text); }
.steps code, .help code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
.help h3 { font-size: 13.5px; margin: 18px 0 8px; }
.help details { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.help summary { cursor: pointer; font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; min-height: 18px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Logo : tracé « Valdius » au vert du site, trait et « Capital » couleur du texte (masques PNG coloriés en CSS) ---------- */
.logo-art { position: relative; display: block; aspect-ratio: 439 / 381; }
.logo-art i { position: absolute; inset: 0; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.logo-art .la-script { --m: url(/assets/logo-script.png?v=20); background: var(--accent); }
.logo-art .la-gold { --m: url(/assets/logo-gold.png?v=20); background: var(--text); } /* blanc en thème sombre, quasi noir en thème clair */
.sidebar .logo-art { width: 196px; margin: -6px auto -4px; }
.login-card .logo-art { width: 280px; margin: 0 auto 4px; }
/* ---------- News ---------- */
.news-filter { margin-bottom: 6px; }
.news-day::first-letter { text-transform: uppercase; }
.news-item { display: flex; align-items: center; gap: 14px; padding: 11px 8px; margin: 0 -8px; border-bottom: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.news-item:hover { background: var(--surface-2); }
.news-body { flex: 1; min-width: 0; }
.news-title { font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-meta { margin-top: 3px; }

/* ---------- Mode discret (montants floutés) ---------- */
/* Les icônes montrent l'action proposée : œil barré quand les montants sont visibles, soleil en thème sombre */
.icon-btn .eye-on { display: none; }
.privacy .icon-btn .eye-off { display: none; }
.privacy .icon-btn .eye-on { display: block; }
#theme-btn .moon { display: none; }
:root[data-theme="light"] #theme-btn .moon { display: block; }
:root[data-theme="light"] #theme-btn .sun { display: none; }
.privacy #privacy-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.privacy .num, .privacy .priv, .privacy .kpi-sub, .privacy .pill, .privacy .readout b,
.privacy #period-perf span:not(.muted) {
  filter: blur(7px); user-select: none; transition: filter .2s;
}
/* Les cours de marché (watchlist, fiche valeur) et les dates restent visibles */
.privacy #fx-eurusd .num, .privacy #st-eng .num,.privacy .wl-item .num, .privacy .wl-item .pill, .privacy .modal .num, .privacy .modal .pill, .privacy .num.date, .privacy .num.pub, .privacy .pill.pub, .privacy .tip-row.pub .num { filter: none; user-select: auto; }

/* Cases de la déclaration : détail par compte, courtiers à gauche et montants alignés à droite */
.t td.box-detail { padding-right: 24px; }
/* Largeurs fixes : les montants de toutes les cases tombent sur la même verticale */
.box-detail > div { display: grid; grid-template-columns: var(--bd-name, 17em) var(--bd-amt, 8em); column-gap: 10px; row-gap: 2px; }
.box-detail > div > span:not(.num) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box-detail > div > .num { text-align: right; }

/* Gestion fiscale française pour IBKR : texte explicatif */
.ibkr-rules { line-height: 1.6; margin-bottom: 16px; }
.ibkr-rules p { margin: 0 0 8px; }
.ibkr-rules ul { margin: 0 0 8px; padding-left: 18px; }
.ibkr-rules li { margin-bottom: 4px; }
.ibkr-rules b { color: var(--text-2); }

/* ---------- Infobulles détaillées (explication des calculs) ---------- */
/* Montants à infobulle détaillée : soulignés en pointillé ; les infobulles simples (ancien title, data-tip="t:") gardent l'aspect de leur élément */
[data-tip]:not([data-tip="t:"]) { cursor: help; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 70%, transparent); outline: none; border-radius: 2px; }
[data-tip]:not([data-tip="t:"]):is(:hover, :focus-visible) { border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* Colonne de gauche : infobulle sans soulignement ni surlignage */
.stat[data-tip], .stat[data-tip]:hover, .stat[data-tip]:focus-visible { border-bottom: 0; background: none; cursor: default; }
button.stat[data-tip] { cursor: pointer; }
.tip-pop {
  position: fixed; z-index: 1000; left: 0; top: 0; width: max-content; max-width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow), 0 18px 48px rgba(0,0,0,.28); padding: 14px 16px 12px; font-size: 12.5px; line-height: 1.5; font-weight: 400; text-align: left; white-space: normal;
  pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease;
}
.tip-pop.show { opacity: 1; transform: none; }
/* Infobulle simple (ancien attribut title) : même cadre, plus compact */
.tip-pop:has(> .tip-text:only-child) { max-width: min(320px, calc(100vw - 24px)); padding: 7px 11px; border-radius: 10px; font-size: 12px; color: var(--text-2); }
.tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.tip-head h4 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.tip-head span { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tip-row { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 2px 0; color: var(--text-2); }
.tip-row b { color: var(--text); font-weight: 600; }
.tip-row.sum { border-top: 1px solid var(--border-strong); margin-top: 3px; padding-top: 5px; color: var(--text); font-weight: 600; }
.tip-sep { margin: 10px 0 4px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.tip-note { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.tip-note b { color: var(--text-2); }
.tip-ops { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tip-ops th { color: var(--muted); font-weight: 500; text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); }
.tip-ops td { padding: 3px 6px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.tip-ops tr:last-child td { border-bottom: 0; }
.tip-ops .r { text-align: right; }
.tip-ops th:first-child, .tip-ops td:first-child { padding-left: 0; }
.tip-ops th:last-child, .tip-ops td:last-child { padding-right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .g-3-2, .g-2, .g-1-2, .g-syn, .alloc { grid-template-columns: minmax(0, 1fr); }
}
/* Menu trop large pour la barre (classe posée par fitNav() dans app.js, selon la place réelle et non la largeur
   d'écran : zoom et panneaux du navigateur varient) : icônes, libellé de la page active seulement (libellés en infobulle) */
@media (min-width: 761px) {
  .topbar.nav-compact .nav a:not(.active) span { display: none; }
  .topbar.nav-compact .nav a { padding: 8px 10px; }
}
@media (max-width: 760px) {
  body { display: block; padding-bottom: 68px; overflow-x: hidden; }
  .main { width: 100%; max-width: 100vw; }
  .nav a { min-width: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 17px; }
  .topbar-actions { min-width: 0; gap: 6px; }
  /* Mobile : indicateurs en haut de page (deux colonnes), menu en barre fixe en bas d'écran */
  .sidebar { position: static; width: auto; height: auto; overflow: visible; padding: 12px 16px 0; border-right: 0; gap: 0; }
  .sidebar .logo-art, .sidebar-foot { display: none; }
  .stats { flex-direction: row; font-size: 12px; padding: 4px 0; margin-top: 0; }
  .stats-col { flex: 1 1 0; padding: 2px 10px; }
  .stats-col + .stats-col { border-top: 0; border-left: 1px solid var(--border); }
  .stat { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .stat .small { display: none; }
  .topbar { backdrop-filter: none; background: var(--bg); } /* sinon la barre de menu fixe serait positionnée dans la barre du haut */
  .nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; z-index: 20; padding: 6px 8px; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); }
  .nav a { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10px; flex: 1; text-align: center; }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a[data-route="parametres"] span { display: none; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { font-size: 17px; }
  .live { display: none; }
  .view { padding: 16px 16px 40px; }
  .hero-value { font-size: 32px; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .chart-box { height: 240px; }
  .select { max-width: 150px; }
}
/* Vue compacte (téléphone, écran de voiture, fenêtre réduite) : colonne de gauche seule, positions en dessous
   (logo, cours ou cours du sous-jacent, +/- value latente). En haut : valorisation (icône carte) et EUR/USD (icône $)
   à gauche, logo à droite. Classe compact sur <html> sous 1 000 px de large. */
html:not(.compact) :is(.cpt-pos, .cpt-fx, .cpt-ico) { display: none; }
html.compact .stat:not(#st-total), html.compact .stats-perf, html.compact #st-total .muted { display: none; }
html.compact body { display: block; padding-bottom: 0; }
html.compact .tip-pop { display: none !important; } /* pas d'infobulles (valorisation comprise) */
html.compact .main { display: none; }
html.compact .sidebar { position: static; width: auto; max-width: 480px; height: auto; margin: 0 auto; padding: 16px; border-right: 0; overflow: visible;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; row-gap: 0; align-items: center; }
html.compact .sidebar .logo-art { display: block; width: 104px; margin: 0 14px 0 0; grid-column: 2; grid-row: 1 / span 2; } /* affiché aussi sur téléphone (masqué par la mise en page mobile) */
html.compact .stats { grid-column: 1; grid-row: 1; align-self: end; margin: 0; padding: 0; font-style: normal; }
html.compact .stats-col { padding: 0; border: 0; }
html.compact #st-total, html.compact .cpt-fx { display: grid; grid-template-columns: 38px auto; justify-content: start; align-items: center; gap: 8px; margin: 0; padding: 3px 0; font-size: 14px; }
html.compact #st-total b { font-weight: 600; }
html.compact .cpt-fx { grid-column: 1; grid-row: 2; align-self: start; }
html.compact :is(.stats, .cpt-fx) { position: relative; top: 10px; } /* un peu sous le milieu du logo */
/* Icônes valorisation / EUR/USD : même pastille que les logos des positions (.cpt-row .logo) */
.cpt-ico { box-sizing: border-box; width: 38px; height: 26px; padding: 4px 9px; /* plus large que les logos : « €/$ » lisible */ border-radius: 8px; background: var(--surface-3); color: var(--text-2); fill: currentColor; opacity: .85; /* gris des icônes du menu */
  text-align: center; font-weight: 700; font-size: 14px; line-height: 16px; font-style: normal; }
.cpt-ico-fx { padding: 5px 0; font-size: 13px; letter-spacing: -.02em; white-space: nowrap; }
.cpt-fx b { font-weight: 400; }
html.compact .cpt-pos { display: block; grid-column: 1 / -1; margin-top: 40px; padding: 0 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
html.compact .sidebar-foot { grid-column: 1 / -1; margin-top: 16px; text-align: center; }
.cpt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--border); }
.cpt-row { align-items: center; }
.cpt-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; font-weight: 500; }
.cpt-row .logo { width: 26px; height: 26px; flex-basis: 26px; border-radius: 8px; font-size: 9px; }
.cpt-row .logo img { padding: 2px; }
.cpt-row .num { text-align: right; }
.cpt-head { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
.cpt-gap { margin-top: 22px; } /* options séparées des actions */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Gras réservé aux titres de page et de section (et au logo) : tout le reste en graisse normale, y compris les
   styles en ligne (montants, totaux) et le texte secondaire placé dans un titre */
.q-title { font-weight: 600; }
body :not(h1, h2, h3, h4, h5, h6, .card-title, .sec-title, .q-title, .brand, .brand *, .brandmark *) { font-weight: 400 !important; }
