:root {
  color-scheme: dark;
  --bg: #0b0c0f;
  --surface: #15171c;
  --surface-2: #1d2027;
  --line: #262a33;
  --text: #f2f1ee;
  --text-2: #a7aab2;
  --text-3: #6d717b;
  --accent: #e2bb63;
  --accent-ink: #1a1405;
  --up: #3ccf72;
  --down: #ff6b61;
  --up-bg: 60, 207, 114;
  --down-bg: 255, 107, 97;
  --s-blue: #3987e5;
  --s-orange: #d4741c;
  --s-aqua: #199e70;
  --s-violet: #9085e9;
  --s-magenta: #d55181;
  --s-green: #0ca30c;
  --s-yellow: #c98500;
  --s-red: #e66767;
  --bench: #9085e9;
  --radius: 18px;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f2ef;
    --surface: #ffffff;
    --surface-2: #f1f0ec;
    --line: #e4e2dc;
    --text: #141414;
    --text-2: #5b5a56;
    --text-3: #8f8d87;
    --accent: #a67c1c;
    --accent-ink: #ffffff;
    --up: #108a3e;
    --down: #d23c33;
    --up-bg: 16, 138, 62;
    --down-bg: 210, 60, 51;
    --s-blue: #2a78d6;
    --s-orange: #c4650f;
    --s-aqua: #1baf7a;
    --s-violet: #6250d6;
    --s-magenta: #e87ba4;
    --s-green: #008300;
    --s-yellow: #eda100;
    --s-red: #e34948;
    --bench: #6250d6;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, select { font: inherit; color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
svg { display: block; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
  min-height: 100vh;
}

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.txt { color: var(--text); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-2); }

/* ---------- barre du haut ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 4px; }
.topbar h1 { font-size: 30px; }
.topbar-actions { display: flex; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text-2); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 36px; height: 36px; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn.back { width: auto; padding: 0 8px 0 0; gap: 2px; display: flex; color: var(--accent); font-weight: 600; }
.detail-title { font-size: 28px; margin-top: 2px; }
.detail-sub { margin: 2px 0 0; }

/* ---------- valeur principale ---------- */
.hero { padding: 10px 0 6px; }
.hero-label { color: var(--text-2); font-size: 14px; font-weight: 500; min-height: 20px; }
.hero-value { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 2px 0 4px; }
.small-hero .hero-value { font-size: 34px; }
.hero-sub { font-size: 15px; min-height: 21px; }
.chg { font-weight: 600; }
.chg.up { color: var(--up); } .chg.down { color: var(--down); } .chg.flat { color: var(--text-2); }
.chg-pct { font-weight: 500; }

/* ---------- graphiques ---------- */
.chart-main { margin: 6px -4px 0; min-height: 200px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-main svg { overflow: visible; }
.lc .grid, .bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .baseline { stroke: var(--text-3); stroke-width: 1; }
.lc .axis, .bars .axis { fill: var(--text-3); font-size: 11px; }
.bars .axis-sel { fill: var(--text); font-weight: 600; }
.lc .ref { stroke-dasharray: 3 4; stroke-width: 1.2; }
.lc .ref-label { fill: var(--text-2); }
.lc .marker { stroke: var(--bg); stroke-width: 2; opacity: 0.95; }
.cursor-line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.cursor-dot { stroke: var(--bg); stroke-width: 2.5; }
.bar { transition: opacity 0.15s; }
.bar.dim { opacity: 0.35; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--text-2); margin: 4px 0 10px; flex-wrap: wrap; }
.legend.left { justify-content: flex-start; margin: 8px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 16px; height: 2.5px; border-radius: 2px; background: var(--c); display: inline-block; }
.lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--text-3); display: inline-block; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; margin-right: 8px; flex: none; }

.chips { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; margin: 4px 0 18px; }
.chips.scroll { overflow-x: auto; background: none; padding: 0; gap: 8px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: 1; text-align: center; padding: 7px 0; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.chips.scroll .chip { flex: none; padding: 7px 14px; background: var(--surface); border-radius: 20px; }
.chip.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.chips.scroll .chip.on { background: var(--text); color: var(--bg); }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.kpi[role=button]:active { background: var(--surface-2); }
.kpi-label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-label .i svg { width: 14px; height: 14px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.kpi-value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }

/* ---------- cartes ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.flush { padding: 4px 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 8px; }
.card-head h2 { font-size: 18px; }
.big-pct { font-size: 18px; font-weight: 700; color: var(--accent); }

.alloc { display: flex; gap: 18px; align-items: center; }
.donut-wrap { position: relative; flex: none; }
.donut-track { stroke: var(--surface-2); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.donut-center b { font-size: 22px; }
.donut-center span { font-size: 12px; color: var(--text-2); }
.alloc-list { flex: 1; display: grid; gap: 12px; min-width: 0; }
.alloc-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.alloc-name { display: flex; align-items: center; font-weight: 600; min-width: 0; }
.alloc-val { font-size: 14px; }
.alloc-bar { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; position: relative; }
.alloc-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c); }
.alloc-bar em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text); border-radius: 1px; transform: translateX(-1px); }
.row-btn { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 0 0; margin-top: 14px; border-top: 1px solid var(--line); color: var(--text); }
.row-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2; flex: none; }
.row-btn > span { display: flex; align-items: center; gap: 0.3em; flex-wrap: wrap; }
.row-btn > span .sw { margin-right: 4px; }
.sheet .row-btn { margin-top: 0; padding: 13px 0; }

.progress { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin: 2px 0 10px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #f1d48f); border-radius: 5px; }
.progress.thin { height: 6px; margin-bottom: 4px; }
.meter-row { display: flex; justify-content: space-between; margin: 14px 0 6px; font-size: 14px; }

.pos-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border-top: 1px solid var(--line); }
.card-head + .pos-row { border-top: 0; padding-top: 0; }
.pos-main { flex: 1; min-width: 0; }
.pos-name { font-weight: 600; }
.pos-spark { flex: none; }
.pos-right { text-align: right; font-weight: 600; }
.adot { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.adot.big { width: 42px; height: 42px; font-size: 18px; }

/* ---------- actifs ---------- */
.asset-cards { display: grid; gap: 12px; }
.asset-card { display: block; width: 100%; background: var(--surface); border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.asset-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c); opacity: .9; }
.ac-top { display: flex; gap: 12px; align-items: center; }
.ac-name { font-weight: 700; font-size: 17px; }
.ac-id { min-width: 0; }
.ac-id .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-mid { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; }
.ac-price { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.ac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.ac-grid > div { display: flex; flex-direction: column; min-width: 0; }
.ac-grid span { font-size: 12px; color: var(--text-2); }
.ac-grid b { font-size: 16px; }
.ac-grid em { font-style: normal; font-size: 12px; color: var(--text-2); }
.ac-grid em.up { color: var(--up); } .ac-grid em.down { color: var(--down); }
.position-card .ac-grid { border-top: 0; padding-top: 4px; }
.pc-main { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; gap: 8px; flex-wrap: wrap; }
.pc-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.insight { margin-top: 16px; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.insight p { margin: 4px 0 0; color: var(--text-2); }

/* ---------- opérations ---------- */
.tx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border-top: 1px solid var(--line); }
.card-head + .tx-row { border-top: 0; }
.card.flush .tx-row { padding: 10px 16px; }
.card.flush .tx-row:first-child { border-top: 0; }
.tx-row:active { background: var(--surface-2); }
.tx-main { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; font-size: 14.5px; }
.tx-right { text-align: right; font-weight: 600; font-size: 14.5px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.tag-line { font-size: 13px; color: var(--text-2); }
.group { margin-bottom: 14px; }
.group-head { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: capitalize; padding: 0 4px 6px; }

/* ---------- analyse ---------- */
.bar-detail { font-size: 13.5px; margin-top: 8px; min-height: 20px; }
.heat { display: grid; gap: 4px; margin-bottom: 10px; }
.heat-row { display: grid; grid-template-columns: 34px repeat(12, 1fr); gap: 3px; align-items: center; }
.heat-row.head span { font-size: 11px; color: var(--text-3); text-align: center; }
.heat-y { font-size: 12px; color: var(--text-2); }
.heat-cell { aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--text); min-width: 0; }
.heat-cell.up { background: rgba(var(--up-bg), var(--a)); }
.heat-cell.down { background: rgba(var(--down-bg), var(--a)); }
.heat-cell.flat { background: var(--surface-2); }
.heat-cell.none { background: transparent; border: 1px dashed var(--line); }
.hbars { display: grid; gap: 14px; margin-top: 12px; }
.hbar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.hbar.me .hbar-label { font-weight: 600; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--c); border-radius: 5px; }
.hbar .small { margin-top: 3px; }
.contrib { display: grid; gap: 10px; }
.contrib-row { display: grid; grid-template-columns: 90px 1fr 84px; gap: 8px; align-items: center; font-size: 14px; }
.contrib-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contrib-track { position: relative; height: 12px; }
.contrib-track::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-3); }
.contrib-track span { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.contrib-track span.up { left: calc(50% + 2px); background: var(--up); }
.contrib-track span.down { right: calc(50% + 2px); background: var(--down); }
.contrib-val { text-align: right; font-weight: 600; }
.stat-list .stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.stat-list .stat:first-child { border-top: 0; padding-top: 0; }
.stat b { white-space: nowrap; }

/* ---------- bas de page ---------- */
.foot { text-align: center; color: var(--text-3); font-size: 12px; margin: 18px 0 0; }
.banner { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 8px; }
.empty { text-align: center; padding: 40px 0; display: grid; gap: 10px; }

/* ---------- barre d'onglets ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  padding: 6px 8px calc(var(--safe-b) + 4px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
#tabbar[hidden] { display: none; }
#tabbar .tabs { display: flex; width: 100%; max-width: 560px; }
#tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--text-3); padding: 4px 0; text-align: center; }
#tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tabbar button.on { color: var(--accent); }

/* ---------- feuille du bas ---------- */
#sheet-root { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#sheet-root.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s; }
#sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 6px 16px calc(var(--safe-b) + 24px);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
#sheet-root.open .sheet { transform: none; }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 6px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { font-size: 20px; }
.sheet .sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 22px 0 8px; }
.info-text { font-size: 16px; line-height: 1.5; color: var(--text); }

.field { display: block; margin: 10px 0; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 17px; outline: none; -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field.inline { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field.inline > span { margin: 0; color: var(--text); font-size: 15px; display: flex; align-items: center; }
.suffix { position: relative; }
.suffix input { padding-right: 34px; }
.suffix em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-3); pointer-events: none; }
.small-in { width: 130px; flex: none; }
.small-in input { text-align: right; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; margin: 10px 0; gap: 2px; }
.seg button { flex: 1; text-align: center; padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 18px; border-radius: 14px; background: var(--surface-2); font-weight: 600; font-size: 16px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--down); background: transparent; }
.btn.wide { width: 100%; margin-top: 10px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; }
.split-row { display: flex; align-items: center; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.split-row > div { flex: 1; }
.split-amt { font-size: 20px; }

/* ---------- accueil vide ---------- */
.welcome { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: center; }
.welcome-logo { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 20px; background: var(--surface); color: var(--accent); display: grid; place-items: center; }
.welcome-logo svg { width: 44px; height: 44px; }
.welcome h1 { font-size: 30px; line-height: 1.15; }
.welcome p { margin: 0 0 14px; }

@media (min-width: 620px) { #app { padding-top: 28px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.usd-hint { margin: -4px 0 0; min-height: 0; }
.range-card { padding: 14px 16px; }
.range-ends { display: flex; justify-content: space-between; }
.range-ends div { display: flex; flex-direction: column; }
.range-ends .r { text-align: right; }
.range-ends span, .range-ends em { font-size: 12px; color: var(--text-2); font-style: normal; }
.range-ends b { font-size: 16px; }
.range-bar { position: relative; height: 6px; border-radius: 3px; margin: 10px 0 10px; background: linear-gradient(90deg, rgba(var(--down-bg), .55), var(--surface-2) 50%, rgba(var(--up-bg), .55)); }
.range-bar span { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--surface); transform: translate(-50%, -50%); }
.range-card p { margin: 0; }
.i-inline svg { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; fill: none; stroke: var(--text-3); stroke-width: 2; }
.ac-grid > div[role=button] { cursor: pointer; }

/* ---------- v2 : patrimoine, futur ---------- */
.hero-mini { margin-top: 2px; }
.bench-row { display: flex; align-items: center; gap: 10px; margin: -8px 0 18px; }
.bench-row > span { flex: none; }
.bench-row .chips { margin: 0; }
.bench-row .chip { padding: 6px 12px; font-size: 12.5px; }
.seg.mini { margin: 0; padding: 2px; }
.seg.mini button { padding: 5px 10px; font-size: 12.5px; }
.alloc-sub { grid-column: 1 / -1; margin-top: -4px; }
.section-title { font-size: 20px; margin: 22px 2px 10px; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.adot.tiny { font-size: 11px; letter-spacing: -0.02em; }
.card.flush .pos-row { padding: 10px 16px; }
.card.flush .pos-row:first-child { border-top: 0; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.trio span { display: block; font-size: 12px; color: var(--text-2); }
.trio b { font-size: 17px; }
.group-head > span:first-child { display: inline-flex; align-items: center; }
.group-head .sw { margin-right: 6px; }
.group-head { text-transform: none; }
.hint-card p { margin: 6px 0 4px; }
.pick-list { display: grid; }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pick:first-child { border-top: 0; }
.pick > div { flex: 1; }
.pick > svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.hist-row span { flex: 1; color: var(--text-2); font-size: 14px; }
.hist-row .icon-btn { width: 32px; height: 32px; }
.hist-row .icon-btn svg { width: 16px; height: 16px; }
.big-line { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.big-num { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.budget-rows { display: grid; }
.budget-row { display: grid; grid-template-columns: 56px 1fr 44px; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); width: 100%; }
.b-month { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.b-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.b-bar span { display: block; height: 100%; border-radius: 4px; }
.b-bar span.up { background: var(--up); } .b-bar span.down { background: var(--down); }
.b-val { text-align: right; font-weight: 700; font-size: 14px; }
.b-sub { grid-column: 2 / -1; font-size: 12px; }
.date-in { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 15px; width: 160px; }
#sim-chart { min-height: 190px; }
#tabbar button { font-size: 10px; }

/* ---------- v3 : marchés ---------- */
.center { text-align: center; }
.pad { padding: 30px 0; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 12px; padding: 0 12px; margin: 4px 0 12px; height: 40px; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; height: 100%; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.wl-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
#mk-main .seg + .wl-row { border-top: 0; }
.wl-main { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 0; min-width: 0; }
.wl-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wl-id b { font-size: 17px; }
.wl-id span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-spark { flex: none; }
.wl-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 92px; }
.wl-price { font-weight: 600; font-size: 15px; }
.pill { display: inline-block; min-width: 76px; text-align: right; padding: 3px 8px; border-radius: 7px; font-size: 13.5px; font-weight: 700; color: #fff; }
.pill.up { background: var(--up); } .pill.down { background: var(--down); } .pill.flat { background: var(--surface-2); color: var(--text-2); }
.wl-del { width: 26px; height: 26px; border-radius: 50%; background: var(--down); color: #fff; font-weight: 700; font-size: 18px; line-height: 1; flex: none; display: grid; place-items: center; }
.wl-move { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 18px; flex: none; text-align: center; }
.wl-move[disabled] { opacity: .3; }
.res-row { display: flex; align-items: center; border-top: 1px solid var(--line); padding: 0 12px 0 16px; }
.res-row:first-child { border-top: 0; }
.res-main { flex: 1; display: flex; flex-direction: column; padding: 10px 0; min-width: 0; }
.res-main span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-main em { font-style: normal; font-size: 12px; color: var(--text-3); }
.res-add { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-size: 20px; font-weight: 600; flex: none; text-align: center; }
.res-add.on { background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 8px; }
.stat-grid > div { display: flex; flex-direction: column; }
.stat-grid span { font-size: 12px; color: var(--text-2); }
.stat-grid b { font-size: 15px; }
.order-btns { display: flex; gap: 10px; margin: 6px 0 6px; }
.order-btns .btn { flex: 1; }
.order-px { font-size: 22px; margin: 6px 0 4px; }
.tx-row.static { cursor: default; }
.seg button[disabled] { opacity: .35; }
#tabbar button { font-size: 10px; }

/* ---------- v4 : comparaisons sur mesure ---------- */
.chip.plus { color: var(--accent); }
.chips.scroll .chip.custom:not(.on) { box-shadow: inset 0 0 0 1px var(--s-aqua); }
.bench-edit { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -10px 2px 16px; }
.cb-part { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cb-part > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cb-part span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-part .small-in { width: 96px; }
.cb-part .small-in input { height: 40px; }
.res-pick { display: flex; flex-direction: column; width: 100%; padding: 9px 4px; border-top: 1px solid var(--line); }
.res-pick span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-pick em { font-style: normal; font-size: 12px; color: var(--text-3); }
.sheet .search { background: var(--surface-2); margin-top: 12px; }
.btn[disabled] { opacity: .6; }
.cb-part .small-in input { width: 100%; height: 40px; padding: 0 28px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); text-align: right; font-size: 16px; outline: none; }
.cb-part .small-in input:focus { border-color: var(--accent); }
.cb-part .icon-btn { flex: none; }

/* ---------- v5 : ratios, apprendre, bitcoin, verrouillage ---------- */
.seg button { white-space: nowrap; }
.ratio-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 16px 0 4px; font-weight: 600; }
.ratio { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 0; border-top: 1px solid var(--line); }
.ratio-h + .ratio { border-top: 0; }
.ratio-l { color: var(--text); font-size: 14.5px; }
.ratio-v { display: flex; align-items: center; gap: 8px; text-align: right; }
.ratio-v b { font-size: 15px; }
.tag2 { font-style: normal; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.tag-low { color: var(--s-aqua); background: color-mix(in srgb, var(--s-aqua) 15%, transparent); }
.tag-mid { color: var(--text-2); background: var(--surface-2); }
.tag-high { color: var(--s-yellow); background: color-mix(in srgb, var(--s-yellow) 16%, transparent); }
.tag-good { color: var(--up); background: rgba(var(--up-bg), .14); }
.tag-bad { color: var(--down); background: rgba(var(--down-bg), .14); }
.event-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.event-card > div { display: flex; flex-direction: column; }
.event-card span, .event-card em { font-size: 12px; color: var(--text-2); font-style: normal; }
.event-card b { font-size: 15px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 52px; gap: 8px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.hbar-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-row b { text-align: right; font-size: 13.5px; }
.hold-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ratio-h + .hold-row { border-top: 0; }
.hold-row > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hold-row b { white-space: nowrap; }
.news-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.card-head + .news-row { border-top: 0; }
.news-row > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.news-row b { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.news-row img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.lesson-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border-top: 1px solid var(--line); }
.lesson-row:first-child { border-top: 0; }
.lesson-row > div { flex: 1; display: flex; flex-direction: column; }
.lesson-row svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2; flex: none; }
.lesson { font-size: 15.5px; line-height: 1.55; }
.lesson p, .lesson ul, .lesson ol { margin: 0 0 12px; }
.lesson ul, .lesson ol { padding-left: 20px; }
.lesson li { margin-bottom: 6px; }
.lesson-key { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; }
.lesson-key b { display: block; color: var(--accent); margin-bottom: 2px; }
.card-btn { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; border-top: 0; }
.dca-table { display: grid; margin: 8px 0; }
.dca-table > div { display: grid; grid-template-columns: 1.3fr 1fr 0.9fr; gap: 6px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.dca-table > div:first-child { border-top: 0; }
.dca-table em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-3); }
.dca-table b { text-align: right; color: var(--text); }
.dca-table .me span:first-child { font-weight: 700; color: var(--text); }
.dca-table .best b { color: var(--up); }
.fg-val { display: flex; align-items: baseline; gap: 10px; }
.fg-val b { font-size: 34px; font-weight: 700; }
.fg-val span { font-weight: 600; color: var(--text-2); }
.fg-bar { position: relative; height: 8px; border-radius: 4px; margin: 10px 0 4px; background: linear-gradient(90deg, rgba(var(--down-bg), .8), var(--surface-2) 50%, rgba(var(--up-bg), .8)); }
.fg-bar span { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--surface); transform: translate(-50%, -50%); }
.fg-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.fg-spark { margin-top: 10px; }
.fg-spark svg { width: 100%; }
.cycle-table { display: grid; font-size: 13px; }
.cycle-table > div { display: grid; grid-template-columns: 0.9fr 1.6fr 0.6fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.cycle-table .ct-h { color: var(--text-3); font-size: 11.5px; border-top: 0; }
.cycle-table .ct-now { color: var(--accent); font-weight: 600; }
.cycle-table span:last-child { text-align: right; }
.kpis.two { margin: 8px 0 4px; }
.stat.as-btn { width: 100%; }
.stat .link { font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; max-width: 90vw; opacity: 0; pointer-events: none; transition: all .25s; z-index: 40; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body.locked { overflow: hidden; }
#lock { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.lock-box { width: 100%; max-width: 320px; text-align: center; display: grid; gap: 10px; }
.lock-box h2 { font-size: 22px; margin-bottom: 6px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 10px; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--text-2); }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; justify-items: center; }
.pin-pad button { width: 70px; height: 70px; border-radius: 50%; background: var(--surface); font-size: 26px; font-weight: 500; text-align: center; }
.pin-pad button:active { background: var(--surface-2); }
.pin-pad button[disabled] { visibility: hidden; }
