:root {
  --paper: #EEF1EC;
  --card: #FFFFFF;
  --ink: #16233B;
  --ink-2: #3C4A60;
  --muted: #6B7584;
  --line: #D9DFD8;
  --brass: #B8862E;
  --brass-soft: #F3E6CC;
  --gain: #1F7A55;
  --loss: #B03A2E;
  --focus: #3A6FD8;
  --r-lg: 18px;
  --r-sm: 8px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E1624; --card: #16213A; --ink: #E8ECF2; --ink-2: #B9C2D0; --muted: #8A95A8;
    --line: #26334F; --brass: #D9A548; --brass-soft: #3A3120; --gain: #4CC38A; --loss: #F07B6C;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
body { min-height: 100vh; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.gain { color: var(--gain); } .loss { color: var(--loss); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { padding: 28px 18px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; font-weight: 700; margin-bottom: 26px; }
.brand svg { width: 30px; height: 30px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--brass); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.side .spacer { flex: 1; }
main { padding: 32px clamp(16px, 4vw, 48px) 110px; max-width: 1240px; width: 100%; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.tabbar { display: none; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding-top: 20px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-decoration: none; color: var(--muted); padding: 4px 0; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar svg { width: 22px; height: 22px; }
  h1 { font-size: 1.55rem; }
}

/* ---------- blocs ---------- */
.panel { background: var(--card); border-radius: var(--r-lg); padding: 20px; border: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* le volant : l'élément signature du tableau de bord */
.hero { min-width: 0; display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 28px; align-items: center; background: var(--ink); color: #F4F1E6; border-radius: 26px; padding: 28px; }
@media (prefers-color-scheme: dark) { .hero { background: #1B2A48; } }
.hero .muted { color: #A8B3C4; }
.wheel { position: relative; width: 100%; aspect-ratio: 1; }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.wheel .big { font-family: var(--display); font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; }
.wheel.spin svg .arcs { animation: spin 1.4s cubic-bezier(.2,.8,.2,1) both; transform-origin: 50% 50%; }
@keyframes spin { from { transform: rotate(-120deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wheel.spin svg .arcs { animation: none; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px 18px; }
.kpi .label { font-size: 0.85rem; color: #A8B3C4; }
.kpi .value { font-family: var(--display); font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.hero .gain { color: #7FD8A8; } .hero .loss { color: #FF9C8F; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding: 22px; } .wheel { max-width: 300px; margin: 0 auto; } }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }

/* ---------- tableaux ---------- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { padding: 10px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
tbody tr:hover { background: color-mix(in srgb, var(--brass) 7%, transparent); }
tr.click { cursor: pointer; }
.tick { font-weight: 600; }
.sub { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--brass); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.78rem; background: var(--brass-soft); color: var(--ink); }
.tag.warn { background: color-mix(in srgb, var(--loss) 16%, transparent); }

/* ---------- formulaires ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--ink-2); }
input, select, textarea { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; min-width: 0; }
textarea { min-height: 110px; resize: vertical; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 99px; cursor: pointer; font-weight: 600; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: #1B1406; }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.btn.danger { background: transparent; color: var(--loss); border-color: currentColor; }
.btn[disabled] { opacity: .55; cursor: progress; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--card); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 99px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.drop { border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 24px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--brass); background: var(--brass-soft); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .pitch { background: var(--ink); color: #F4F1E6; padding: clamp(28px, 6vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth .pitch h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 14ch; }
.auth .pitch p { color: #B9C2D0; max-width: 46ch; }
.auth .pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #DCE2EA; }
.auth .pitch li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--brass); margin-right: 10px; vertical-align: middle; }
.auth .box { padding: clamp(28px, 6vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 460px; width: 100%; margin: 0 auto; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth .pitch { padding-bottom: 36px; } }

.err { color: var(--loss); font-size: 0.9rem; min-height: 1.2em; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 99px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); color: var(--ink); padding: 22px; width: min(560px, 94vw); }
dialog::backdrop { background: rgb(10 16 28 / .5); }
.chartbox { position: relative; height: 260px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 150px; }
.months .m { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 0.75rem; color: var(--muted); }
.months .m i { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--brass); min-height: 2px; }
.md h3 { margin: 16px 0 6px; } .md p, .md li { color: var(--ink-2); } .md ul { padding-left: 18px; }
.empty { text-align: center; padding: 40px 20px; }
.empty p { max-width: 44ch; margin: 8px auto 18px; color: var(--muted); }

/* ---------- listes lisibles sur téléphone ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; }
.li.click:active { background: color-mix(in srgb, var(--brass) 8%, transparent); }
.li-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.li-main b { font-weight: 600; overflow-wrap: anywhere; }
.li-main span { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; flex: none; max-width: 52%; }
.li-side b { font-weight: 600; white-space: nowrap; }
.li-side span { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.li-side span.gain { color: var(--gain); } .li-side span.loss { color: var(--loss); }
.li-side.row { flex-direction: row; gap: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.linkbtn { background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: .84rem; text-decoration: underline; cursor: pointer; }
.linkbtn.danger { color: var(--loss); }
.only-mob { display: none; }
@media (max-width: 820px) { .only-mob { display: flex; } .only-desk { display: none; } }

/* ---------- lignes « libellé / valeur » ---------- */
.kvs { display: flex; flex-direction: column; margin-top: 6px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > span:not(.pill) { color: var(--ink-2); display: flex; flex-direction: column; min-width: 0; }
.kv small { color: var(--muted); font-size: .8rem; line-height: 1.35; margin-top: 2px; }
.kv > b { font-weight: 600; text-align: right; }
.pill { display: inline-flex; justify-content: center; min-width: 56px; padding: 4px 12px; border-radius: 99px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; flex: none; }
.p5 { background: #2E7D32; } .p4 { background: #7CB342; } .p3 { background: #D4C73A; color: #2A2400; } .p2 { background: #EE955A; } .p1 { background: #D9534F; }
.p-na { background: var(--line); color: var(--muted); }

/* ---------- fiche titre ---------- */
.back { text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 6px; }
.fhead { margin-bottom: 16px; }
.fname { font-size: 1.45rem; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 16px; }
.tabs button { background: none; border: 0; padding: 10px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 1rem; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); font-weight: 600; }
.scroll { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.seg.scroll { display: flex; width: fit-content; }
.seg button { white-space: nowrap; }
.price { display: flex; flex-direction: column; margin-bottom: 10px; }
.price b { font-family: var(--display); font-size: 2rem; letter-spacing: -0.02em; }
#frange { margin-top: 10px; }
.range52 { margin-top: 14px; font-size: .82rem; }
.range52 .row { flex-wrap: nowrap; }
.track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--loss), #D4C73A, var(--gain)); margin-top: 8px; opacity: .8; }
.track i { position: absolute; top: -5px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); }
.fgrid { display: grid; grid-template-columns: minmax(96px, 1.3fr) repeat(var(--n), minmax(0, 1fr)); gap: 10px 8px; font-size: .88rem; align-items: baseline; }
.fgrid b { text-align: right; color: var(--muted); font-weight: 500; }
.fgrid span.num { text-align: right; }
.fgrid > span:not(.num) { color: var(--ink-2); }
.summary { font-size: .9rem; margin-top: 12px; }

/* ---------- diversification ---------- */
.donut-wrap { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 24px; align-items: center; margin-top: 12px; }
.donut { position: relative; aspect-ratio: 1; max-width: 280px; width: 100%; margin: 0 auto; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-c b { font-family: var(--display); font-size: 1.4rem; }
@media (max-width: 820px) { .donut-wrap { grid-template-columns: 1fr; } .donut { max-width: 240px; } }

.search { position: relative; }
.search input { width: 100%; }
#qres:not(:empty) { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; margin-top: 6px; }
.check { flex-direction: row !important; align-items: center; gap: 8px; }
.alerts { padding-left: 18px; margin: 8px 0 14px; } .alerts li { margin-bottom: 8px; color: var(--ink-2); }
.hero-note { margin: 0; font-size: .85rem; }

/* ---------- ajustements téléphone ---------- */
@media (max-width: 820px) {
  main { padding-left: 14px; padding-right: 14px; }
  .head { align-items: stretch; flex-direction: column; }
  .head select { width: 100%; }
  .panel { padding: 16px; border-radius: 16px; }
  .hero { padding: 20px 16px; border-radius: 20px; gap: 18px; }
  .kpi .value { font-size: 1.2rem; }
  .form { grid-template-columns: 1fr 1fr; }
  .form label { min-width: 0; }
  .form input, .form select { width: 100%; }
  .btn { width: auto; }
  #add-tx { width: 100%; }
  .chartbox { height: 220px; }
  .stat .v { font-size: 1.2rem; }
  .months span { font-size: .65rem; }
}
html, body { overflow-x: clip; }
@media (max-width: 820px) {
  .seg.scroll { width: 100%; }
  .seg.scroll button { flex: 1; padding: 6px 6px; font-size: .86rem; }
}

/* ---------- fiche titre : lignes épurées, fond blanc, onglets soulignés ---------- */
.fx { --fx-blue: #2F5BEA; --fx-head: #F3F5F9; --fx-label: #6B7280; max-width: 760px; margin: -32px auto 0; background: var(--card); min-height: 100vh; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx { --fx-head: #121C30; --fx-label: #9AA5B8; --fx-blue: #7EA0FF; } }
:root[data-theme="dark"] .fx { --fx-head: #121C30; --fx-label: #9AA5B8; --fx-blue: #7EA0FF; }
.fx-head { background: var(--fx-head); padding: 14px 20px 0; position: relative; }
.fx-back { position: absolute; left: 8px; top: 10px; font-size: 1.8rem; line-height: 1; text-decoration: none; color: var(--ink); padding: 4px 10px; }
.fx-id { display: flex; align-items: center; gap: 14px; padding: 30px 0 4px; }
.fx-logo { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--card); flex: none; display: grid; place-items: center; box-shadow: 0 0 0 6px color-mix(in srgb, var(--card) 55%, transparent); overflow: hidden; }
.fx-logo img { width: 30px; height: 30px; position: absolute; z-index: 1; background: var(--card); }
.fx-logo i { font-style: normal; font-weight: 700; font-size: .95rem; color: var(--fx-label); }
.fx-id h1 { font-family: var(--body); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.fx-id p { margin: 4px 0 0; color: var(--fx-label); font-size: .95rem; }
.fx-copy { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: copy; }
.fx-more { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 1.3rem; cursor: pointer; flex: none; }
.fx-upd { color: var(--fx-label); margin: 14px 0 0; font-size: .92rem; }
.fx-tabs { display: flex; gap: 26px; margin-top: 18px; border-bottom: 1px solid var(--line); }
.fx-tabs button { background: none; border: 0; padding: 10px 0 12px; font-size: 1.02rem; color: var(--fx-label); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fx-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--fx-blue); }
.fx-body { padding: 4px 20px 40px; }
.fx-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fx-sec:last-child { border-bottom: 0; }
.fx-sec h2 { font-family: var(--body); font-size: 1.3rem; font-weight: 700; margin: 10px 0 12px; }
.fx-sec h2:empty { display: none; }
.fx-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: 14px; align-items: center; cursor: pointer; }
.fx-link span { font-size: 1.5rem; line-height: 1; }
.fx-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; }
.fx-l { color: var(--fx-label); font-size: 1.04rem; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.fx-l small { font-size: .8rem; }
.fx-v { color: var(--ink); font-size: 1.04rem; text-align: right; white-space: nowrap; }
.fx-row.sub .fx-l, .fx-row.sub .fx-v { font-style: italic; color: var(--fx-label); }
.fx-row.sub .fx-l { padding-left: 22px; }
.fx-q { width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid var(--fx-label); background: none; color: var(--fx-label); font-size: .72rem; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; flex: none; }
.fx-q[aria-expanded="true"] { background: var(--fx-blue); border-color: var(--fx-blue); color: #fff; }
.fx-help { margin: -2px 0 8px; padding: 10px 12px; background: var(--fx-head); border-radius: 10px; font-size: .88rem; color: var(--ink-2); }
.fx-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 30px; padding: 0 14px; border-radius: 99px; color: #fff; font-weight: 600; font-style: normal; font-size: .98rem; }
.fx-g5 { background: #2E7D32; } .fx-g4 { background: #86B04E; } .fx-g3 { background: #CBD646; } .fx-g2 { background: #F0A04B; } .fx-g1 { background: #E0544B; }
.fx-teal { background: #4A9C82; } .fx-na { background: var(--line); color: var(--fx-label); }
.fx-price { display: flex; flex-direction: column; gap: 6px; }
.fx-price > b { font-family: var(--body); font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
.fx-price .gain { color: #3E9A7E; }
.fx-chart { position: relative; height: 260px; margin: 12px -20px 0; }
.fx-range { display: flex; justify-content: space-between; gap: 4px; margin-top: 10px; }
.fx-range button { flex: 1; background: none; border: 0; padding: 8px 0; border-radius: 10px; font-size: 1rem; color: var(--ink); cursor: pointer; }
.fx-range button[aria-pressed="true"] { background: color-mix(in srgb, var(--fx-blue) 12%, transparent); }
.fx-text { color: var(--fx-label); font-size: .95rem; margin: 12px 0 0; }
.fx-note { color: var(--fx-label); font-size: .85rem; margin: 12px 0 0; }
.fx-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--line); margin-right: 10px; vertical-align: middle; overflow: hidden; }
.fx-bar i { display: block; height: 100%; background: #4A9C82; }
.fx .fgrid { font-size: .92rem; }
@media (max-width: 820px) {
  .fx { margin: -20px -14px 0; }
  .fx-tabs { gap: 22px; margin-left: -20px; margin-right: -20px; padding: 0 20px; max-width: none; }
}
@media (min-width: 821px) { .fx { border-radius: 0 0 20px 20px; overflow: clip; } }

/* matrice des scores par action */
.smx { display: flex; flex-direction: column; }
.smx-r { display: grid; grid-template-columns: minmax(64px, 1.4fr) repeat(7, minmax(0, 1fr)); gap: 5px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.smx-r:last-child { border-bottom: 0; }
.smx-r[data-open] { cursor: pointer; }
.smx-h { position: sticky; top: env(safe-area-inset-top, 0px); background: var(--card); z-index: 2; padding: 4px 0 8px; }
.smx-h button { background: none; border: 0; padding: 4px 0; font-size: .74rem; color: var(--muted); cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smx-h button:first-child { text-align: left; }
.smx-h button[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.smx-n { display: flex; flex-direction: column; min-width: 0; }
.smx-n b { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smx-n small { color: var(--muted); font-size: .72rem; }
.sc { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 8px; color: #fff; font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.sc.p3 { color: #2A2400; }
.sc-na { background: var(--line); color: var(--muted); font-weight: 400; }
.smx-r > .sc:last-child { outline: 2px solid var(--ink); outline-offset: -2px; }

/* rangées d'onglets : défilement horizontal uniquement, jamais vertical */
.scroll { overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.fx-tabs { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; background: var(--fx-head); overflow-x: auto; overflow-y: hidden; }
.fx-tabs button { flex: none; }
.fx-head { overflow: visible; }
.fx-tabs, .fx-tabs button { touch-action: pan-x; }
.fx-tabs { margin: 0 !important; padding: 18px 20px 0 !important; max-width: none; }
.fx-head { padding-bottom: 0; }

/* pas de zoom involontaire : iOS zoome sur les champs sous 16 px et au double-tap */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; }
button, a, .li, [data-open] { touch-action: manipulation; }

/* explorer */
.bigsearch { position: relative; }
.bigsearch input { width: 100%; padding: 14px 16px 14px 44px; border-radius: 14px; background: var(--card); }
.bigsearch svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 12px; font-size: .9rem; cursor: pointer; }
.star { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--fx-label); padding: 4px; }
.star[aria-pressed="true"] { color: #F2B84B; }
.headbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; text-decoration: none; color: var(--ink); flex: none; }
.headbtn svg { width: 20px; height: 20px; }
.head-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* impact d'un ajout */
.verdict { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; margin: 6px 0 4px; }
.verdict b { font-size: 1.05rem; }
.verdict.good { background: color-mix(in srgb, #2E7D32 12%, transparent); }
.verdict.mid { background: color-mix(in srgb, #CBD646 20%, transparent); }
.verdict.bad { background: color-mix(in srgb, #E0544B 12%, transparent); }
.proscons { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 10px; }
.proscons li { display: flex; gap: 10px; align-items: flex-start; font-size: .96rem; color: var(--ink-2); }
.proscons li::before { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; margin-top: 1px; }
.proscons.pro li::before { content: "+"; background: #2E7D32; }
.proscons.con li::before { content: "−"; background: #E0544B; }
.amount { display: flex; gap: 10px; align-items: center; }
.amount input[type=range] { flex: 1; accent-color: var(--fx-blue); padding: 0; border: 0; background: none; }
.amount input[type=number] { width: 110px; text-align: right; }
.delta { font-size: .85rem; margin-left: 6px; }

/* valorisation */
.vchart { position: relative; height: 320px; margin: 4px -20px 0; }
.vlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; font-size: .78rem; color: var(--fx-label); }
.vlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.vverdict { text-align: center; font-size: 1.15rem; line-height: 1.8; margin: 18px 0 10px; }
.vpill { display: inline-block; padding: 2px 14px; border-radius: 99px; font-weight: 700; }
.vpill.v-bad { background: #F5C6C6; color: #7A1D1D; } .vpill.v-good { background: #BFE8D0; color: #0E5A34; } .vpill.v-mid { background: #F6E2AE; color: #5C4300; }
.vkpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.vkpis > div { background: var(--fx-head); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.vkpis span { color: var(--fx-label); font-size: .82rem; } .vkpis b { font-size: 1.15rem; } .vkpis small { color: var(--fx-label); font-size: .75rem; }
.v-buy { color: #0E7A4A; }
.vzone { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: .92rem; }
.vzone.v-good { background: #DDF3E6; color: #0E5A34; } .vzone.v-mid { background: #FBF1D3; color: #5C4300; } .vzone.v-bad { background: #FBE3E3; color: #7A1D1D; }
.vparams { display: block; margin: 16px auto 0; background: var(--fx-blue); color: #fff; border: 0; border-radius: 99px; padding: 12px 26px; font-weight: 600; font-size: 1rem; cursor: pointer; }
.vpanel { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--fx-head); }
.vpanel input[type=range] { width: 100%; padding: 0; border: 0; background: none; accent-color: var(--fx-blue); }
.chip[aria-pressed="true"] { background: var(--fx-blue, #2F5BEA); border-color: transparent; color: #fff; }
.chip[disabled] { opacity: .4; }
.vhead { display: flex; justify-content: space-between; color: var(--fx-label); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.vrow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.vrow > div { display: flex; flex-direction: column; }
.vrow > div:last-child { text-align: right; white-space: nowrap; }
.vrow b { font-weight: 500; } .vrow small { color: var(--fx-label); font-size: .78rem; }
.vrow.off { opacity: .45; }
.goalbar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.goalbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), #1F7A55); border-radius: 99px; }
.nx .li-main span { -webkit-line-clamp: 3; }
.nx-pro { color: #1F7A55 !important; } .nx-con { color: #B03A2E !important; }
#bench { margin-top: 10px; }
.warnbox { background: #FBE9D0; color: #6B4300; border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; font-size: .92rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warnbox { background: #3A2E17; color: #F3D9A8; } }
.heat { display: grid; grid-template-columns: 26px repeat(12, minmax(0, 1fr)); gap: 3px; font-size: .7rem; align-items: center; }
.heat b { color: var(--muted); font-weight: 500; text-align: center; }
.heat i { font-style: normal; height: 26px; border-radius: 5px; background: var(--brass); display: grid; place-items: center; color: #1B1406; font-weight: 600; font-variant-numeric: tabular-nums; font-size: .66rem; }
