/* Charte Yasuke (3) : deux espaces bien distincts.
 *
 * Trading : sombre par défaut, dense, chiffres en Inter ; la marque est l'encre (texte), pas une couleur.
 * Investir : clair par défaut, bandeau vert pin, titres en Source Serif 4, plus d'air.
 * Règle des couleurs des données : bleu = gain / TP / hausse, orange = perte / SL / baisse, gris = neutre / expiré / hasard.
 */
:root {
  --bg: #f3f4f2; --card: #ffffff; --soft: #eceeea; --line: #dcdfda; --text: #14161a; --muted: #565c63; --faint: #8d939a;
  --brand: #1d2127; --brand-soft: #e6e8e4; --brand-text: #1d2127; --on-brand: #ffffff;
  --up: #2a6fd0; --up-soft: #e4eefa; --up-text: #1f5fb8;
  --dn: #e0612d; --dn-soft: #fcebe3; --dn-text: #b4461a;
  --neu: #8a8c88; --neu-soft: #eceeea;
  --grid: #e8eae6; --shadow: none; --shadow-pop: 0 12px 32px rgba(20,22,26,.16);
  --radius: 10px; --accent: #5b4ef0; --shell: var(--card); --on-shell: var(--text);
  --c-tp: var(--up); --c-sl: var(--dn); --c-exp: var(--neu); --c-grid: var(--grid); --c-axis: #c9ccc6; --c-wash: rgba(42,111,208,.10);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121417; --card: #181b1f; --soft: #1f2328; --line: #2a2f36; --text: #e6e8ea; --muted: #98a0a8; --faint: #646c75;
  --brand: #e6e8ea; --brand-soft: #262b31; --brand-text: #e6e8ea; --on-brand: #121417;
  --up: #4a92e6; --up-soft: #15243a; --up-text: #7db2f0;
  --dn: #e2672f; --dn-soft: #331d12; --dn-text: #f0956a;
  --neu: #7d838a; --neu-soft: #1f2328;
  --grid: #1f2328; --shadow-pop: 0 16px 40px rgba(0,0,0,.5);
  --c-axis: #353b43; --c-wash: rgba(74,146,230,.12); --accent: #9184ff;
  color-scheme: dark;
}
/* Espace Investir : papier blanc, vert pin, plus d'air */
:root[data-space="invest"] {
  --bg: #f7f7f4; --card: #ffffff; --soft: #eff1ec; --line: #dfe3dc; --text: #17201c; --muted: #56625b; --faint: #8b958f;
  --brand: #1f5f4b; --brand-soft: #e2ede7; --brand-text: #1a5240; --on-brand: #ffffff; --grid: #e9ece6;
  --radius: 8px; --accent: #1f5f4b; --shell: #1f5f4b; --on-shell: #ffffff;
}
:root[data-space="invest"][data-theme="dark"] {
  --bg: #0f1513; --card: #18201c; --soft: #212b26; --line: #2f3b35; --text: #eef3f0; --muted: #b0bdb6; --faint: #7d8a83;
  --brand: #5fc29b; --brand-soft: #16302a; --brand-text: #7fd6b3; --on-brand: #0d1a15; --grid: #232d28;
  --up: #5aa2f0; --up-soft: #15263c; --up-text: #8dc0f5; --dn: #ec7a45; --dn-soft: #3a2216; --dn-text: #f6a47d;
  --accent: #5fc29b; --shell: #14382d; --on-shell: #eaf5ef; --c-axis: #3a4741;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.mono, .num, td.num, th.num { font-family: "Inter", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
h2 { font-size: 18px; letter-spacing: -0.01em; margin: 32px 0 12px; font-weight: 600; }
h3 { font-size: 17px; letter-spacing: -0.01em; margin: 0; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.faint { color: var(--faint); font-size: 12px; }
.up { color: var(--up-text); } .dn { color: var(--dn-text); } .neu { color: var(--muted); }
/* anciens noms utilisés par certains rendus */
.good { color: var(--up-text); } .bad { color: var(--dn-text); } .warn { color: var(--dn-text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- en-tête */
.yk-top { position: sticky; top: 0; z-index: 40; background: var(--card); border-bottom: 1px solid var(--line); }
.yk-top-in { max-width: 1280px; margin: 0 auto; height: 64px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.yk-left { display: flex; align-items: center; gap: 40px; min-width: 0; flex: 1 1 auto; }
.yk-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.yk-brand svg { flex: none; }
.yk-brand b { display: block; font-size: 17px; letter-spacing: -0.02em; line-height: 1.1; }
.yk-brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .04em; font-weight: 500; }
.yk-tabs { display: flex; gap: 28px; height: 64px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.yk-tabs::-webkit-scrollbar { display: none; }
.yk-tab { display: flex; align-items: center; height: 64px; font-size: 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none !important; padding-top: 2px; }
.yk-tab:hover { color: var(--text); }
.yk-tab { white-space: nowrap; }
@media (max-width: 1240px) { .yk-tabs { gap: 20px; } }
@media (max-width: 1380px) { .yk-st-sub { display: none; } }
@media (max-width: 760px) { [data-stop] { padding: 6px 10px; font-size: 12px; } [data-est] .muted { display: none; }
  #open-tbl th, #open-tbl td, #open th, #open td { padding: 10px 6px; } }
@media (max-width: 1180px) { .yk-brand small { display: none; } }
@media (max-width: 1060px) { #btn-sections span, .yk-right .btn-lbl { display: none; } }
.yk-tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--brand); }
.yk-right { display: flex; align-items: center; gap: 8px; flex: none; }
/* En-tête trop étroit (mesuré par yasuke.js) : on retire d'abord les textes secondaires, jamais les onglets */
.yk-top.fit-1 .yk-st-sub { display: none; }
.yk-top.fit-2 #btn-sections span, .yk-top.fit-2 .yk-right .btn-lbl { display: none; }
.yk-top.fit-3 .yk-brand small { display: none; }
.yk-top.fit-3 .yk-left { gap: 20px; }
.yk-top.fit-3 .yk-tabs { gap: 16px; }
.yk-top.fit-4 .yk-status b { display: none; }
.yk-top.fit-4 .yk-status { padding: 6px 8px; }
.yk-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--neu-soft); color: var(--muted); font-size: 13px; white-space: nowrap; }
.yk-status b { font-weight: 600; }
.yk-status .dot { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, currentColor 22%, transparent); }
.yk-status .dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.yk-status.ok { background: var(--up-soft); } .yk-status.ok b, .yk-status.ok .dot { color: var(--up-text); }
.yk-status.late { background: var(--dn-soft); } .yk-status.late b, .yk-status.late .dot { color: var(--dn-text); }
.yk-status.ok .dot::after { animation: yk-pulse 2.4s ease-in-out infinite; }
@keyframes yk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.yk-status .yk-st-sub { color: var(--muted); }

/* ---------------------------------------------------------------- boutons et champs */
button, .btn { font: inherit; cursor: pointer; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none !important; white-space: nowrap; }
.btn:hover, button:hover { filter: brightness(1.06); }
button.secondary, .btn.secondary, .btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.secondary:hover, .btn-ghost:hover { background: var(--soft); filter: none; }
.btn-icon { width: 36px; height: 36px; padding: 0; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.btn-icon:hover { background: var(--soft); color: var(--text); filter: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
button svg, .btn svg { flex: none; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
input.invalid { border-color: var(--dn); background: var(--dn-soft); box-shadow: none; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23898781' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
details > summary { cursor: pointer; }

/* ---------------------------------------------------------------- mise en page */
.wrap { max-width: 1240px; margin: 0 auto; padding: 32px 20px 64px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 24px; }
.pagehead .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pagehead .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stack { display: grid; gap: 20px; }
.row2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tbl { overflow-x: auto; }

/* ---------------------------------------------------------------- pastilles, étiquettes, contrôles */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--neu-soft); color: var(--muted); white-space: nowrap; border: 0; }
.pill b { font-weight: 600; }
.pill.tp, .pill.up { background: var(--up-soft); color: var(--up-text); }
.pill.sl, .pill.dn { background: var(--dn-soft); color: var(--dn-text); }
.pill.expired, .pill.neu { background: var(--neu-soft); color: var(--muted); }
.pill.brand, .pill.open { background: var(--brand-soft); color: var(--brand-text); }
.pill.solid { background: var(--brand); color: var(--on-brand); font-size: 10px; padding: 1px 6px; font-weight: 600; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--soft); font-size: 11px; font-weight: 500; white-space: nowrap; }
.tag.more { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 10px; }
.seg button { background: transparent; border: 1px solid transparent; color: var(--muted); font-weight: 500; font-size: 13px; padding: 5px 12px; border-radius: 8px; }
.seg button:hover { color: var(--text); filter: none; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); font-weight: 600; border-color: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.legend i.line { width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; }
.legend i.tick { width: 2px; height: 12px; border-radius: 1px; background: var(--text); vertical-align: -2px; }

/* ---------------------------------------------------------------- chiffre vedette et tuiles */
.hero-row { display: grid; gap: 20px; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); margin-bottom: 20px; }
.hero-row > * { min-width: 0; }
.hero { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.hero .lab { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 14px; }
.hero .big { display: flex; align-items: baseline; gap: 10px; }
.hero .big b { font-size: 68px; line-height: 1; letter-spacing: -0.04em; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero .big span { font-size: 20px; color: var(--muted); font-weight: 500; }
.hero p { margin: 0; color: var(--muted); font-size: 15px; }
.cmp { display: grid; gap: 6px; }
.cmp .h { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 500; }
.cmp .track, .prog { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.cmp .track i, .prog i { display: block; height: 100%; border-radius: 999px; background: var(--up); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.cmp.neu .track i { background: var(--neu); }
.prog { height: 6px; } .prog i { background: var(--brand); }
.hero hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.hero .rel { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 20px; justify-content: space-between; }
.tile .th { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 13px; color: var(--muted); }
.tile svg.spark { width: 100%; height: 44px; display: block; overflow: visible; }
.stackbar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.stackbar i { display: block; height: 100%; }
.dots { display: none; }

/* ---------------------------------------------------------------- tableaux */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { background: var(--soft); color: var(--muted); font-weight: 500; font-size: 12px; border-bottom: 0; white-space: nowrap; }
thead th:first-child { border-radius: 8px 0 0 8px; } thead th:last-child { border-radius: 0 8px 8px 0; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-size: 13px; }
td.nowrap, .nowrap { white-space: nowrap; }
.dir { white-space: nowrap; } .dir b { font-weight: 600; margin-right: 5px; }
tr.fresh td { background: var(--brand-soft); }
tr.fresh td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
tr.fresh { transition: background-color 1.2s; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { width: auto; padding: 8px 34px 8px 12px; font-size: 13px; border-radius: 10px; }
.empty { color: var(--muted); font-size: 13px; padding: 16px 0; }
.cards-list { display: none; }

/* ---------------------------------------------------------------- sections repliables (liens vers les analyses) */
.links-list { padding: 0; overflow: hidden; }
.links-list a { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: var(--text); border-bottom: 1px solid var(--line); text-decoration: none !important; }
.links-list a:last-child { border-bottom: 0; }
.links-list a:hover { background: var(--soft); }
.links-list a b { font-weight: 600; font-size: 15px; white-space: nowrap; }
.links-list a span { color: var(--muted); font-size: 13px; min-width: 0; }
.links-list a svg { flex: none; color: var(--muted); }

/* ---------------------------------------------------------------- chargement */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--soft) 0%, var(--soft) 40%, color-mix(in srgb, var(--soft) 40%, var(--card)) 50%, var(--soft) 60%, var(--soft) 100%); background-size: 300% 100%; animation: yk-shimmer 1.4s linear infinite; }
@keyframes yk-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk.t { height: 14px; } .sk.big { height: 60px; width: 200px; border-radius: 10px; } .sk.bar { height: 10px; border-radius: 999px; }

/* ---------------------------------------------------------------- notifications */
.yk-toasts { position: fixed; top: 76px; right: 20px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.yk-toast { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: yk-in .3s cubic-bezier(.2,.7,.2,1); }
.yk-toast .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.yk-toast b { font-size: 14px; } .yk-toast .t { font-size: 13px; margin-top: 2px; } .yk-toast .m { font-size: 11px; color: var(--muted); margin-top: 2px; }
.yk-toast .acts { display: flex; gap: 12px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.yk-toast .acts button { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 500; font-size: 13px; }
.yk-toast.out { animation: yk-out .25s ease forwards; }
@keyframes yk-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes yk-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------- fenêtre (formulaire de trade) */
dialog.yk-modal { border: 1px solid var(--line); border-radius: 22px; padding: 0; background: var(--card); color: var(--text); box-shadow: var(--shadow-pop); width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
dialog.yk-modal::backdrop { background: rgba(15,15,18,.45); backdrop-filter: blur(2px); }
dialog.yk-modal[open] { animation: yk-in .25s cubic-bezier(.2,.7,.2,1); }
.modal-in { padding: 28px; display: grid; gap: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.x { width: 34px; height: 34px; border-radius: 50%; padding: 0; background: var(--soft); border: 0; color: var(--muted); }
.x:hover { color: var(--text); filter: none; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 16px; }
.side small { font-weight: 400; font-size: 12px; color: var(--muted); }
.side:hover { filter: none; background: var(--soft); }
.side[aria-pressed="true"].long { background: var(--up-soft); border: 1.5px solid var(--up); color: var(--up-text); }
.side[aria-pressed="true"].short { background: var(--dn-soft); border: 1.5px solid var(--dn); color: var(--dn-text); }
.side[aria-pressed="true"] small { color: inherit; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { font-size: 12px; font-weight: 500; margin-top: 6px; min-height: 18px; }
.lab-i { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--faint); border-radius: 50%; }
.info:hover { color: var(--text); filter: none; }
.bubble { position: absolute; left: -8px; bottom: calc(100% + 10px); z-index: 5; width: 250px; padding: 12px; border-radius: 10px; background: #18181b; color: #d4d3cf; font-size: 12px; line-height: 1.4; font-weight: 400; box-shadow: var(--shadow-pop); }
.bubble b { display: block; color: #fff; font-size: 13px; margin-bottom: 4px; }
.bubble::after { content: ""; position: absolute; left: 14px; top: 100%; border: 7px solid transparent; border-top-color: #18181b; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.presets button { padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--text); border: 0; font-size: 12px; font-weight: 500; }
.presets button[aria-pressed="true"] { background: var(--text); color: var(--card); }
.preview { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 16px; border-radius: 14px; background: var(--soft); }
.preview svg { width: 100%; height: 150px; display: block; }
.preview .rr { display: flex; align-items: baseline; gap: 8px; } .preview .rr b { font-size: 30px; letter-spacing: -0.03em; font-weight: 600; }
.preview .rr span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; }
.kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; }
.note-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; font-size: 13px; }
.note-box.warn { background: var(--dn-soft); color: var(--dn-text); }
.note-box.ok { background: var(--up-soft); color: var(--up-text); }
.note-box.err { background: var(--dn-soft); color: var(--dn-text); }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-foot .cmd { font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-foot code { background: var(--soft); color: var(--text); padding: 3px 8px; border-radius: 6px; font: 12px "Inter", system-ui, sans-serif; }
.modal-foot .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ghbox { border-top: 1px solid var(--line); padding-top: 14px; }
.ghbox summary { color: var(--muted); font-size: 13px; }
.ghgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 10px; align-items: end; }
.msg { font-size: 14px; white-space: pre-wrap; }
.msg:empty { display: none; }

/* ---------------------------------------------------------------- graphiques SVG (petits graphiques des analyses) */
.chart { min-width: 0; }
.chart h3 { margin: 0 0 2px; font-size: 16px; }
.chart .how { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.chart svg { display: block; width: 100%; height: auto; font: 12px "Inter", system-ui, sans-serif; }
.chart svg text { fill: var(--muted); }
.chart svg text.v { fill: var(--text); font-weight: 600; }
.chart svg text.mono { font-family: "Inter", system-ui, sans-serif; }
.chart .empty { padding: 18px 0; }
.mark { transition: opacity .1s; } .mark:hover { opacity: .75; }
.charts { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.wide { grid-column: 1 / -1; }
#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-pop); display: none; max-width: 260px; }
#tip b { font-size: 13px; } #tip .r { display: flex; gap: 10px; justify-content: space-between; } #tip .k { display: inline-block; width: 12px; height: 2px; vertical-align: 3px; margin-right: 6px; }

/* ---------------------------------------------------------------- pied de page */
.foot { margin-top: 36px; font-size: 12px; color: var(--faint); display: grid; gap: 4px; }
.foot a { color: var(--muted); }

/* ---------------------------------------------------------------- navigation du bas (téléphone) */
.yk-bnav { display: none; }
.yk-sub { display: none; }
@media (max-width: 860px) {
  .yk-tabs, .yk-st-sub, #btn-sections span, .yk-right .btn-lbl { display: none; }
  .yk-left { gap: 12px; }
  .yk-top-in { height: 58px; padding: 0 16px; }
  .yk-brand small { display: none; }
  .yk-right #btn-trade { display: none; }
  .yk-sub { display: flex; gap: 8px; padding: 8px 16px 0; overflow-x: auto; scrollbar-width: none; }
  .yk-sub a { flex: none; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none; }
  .yk-sub a.active { background: var(--text); color: var(--card); border-color: var(--text); }
  body { padding-bottom: 88px; }
  .yk-bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; justify-content: space-around; align-items: flex-end; padding: 8px 8px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .yk-bnav a, .yk-bnav button { display: grid; justify-items: center; gap: 3px; flex: 1 1 0; min-width: 0; max-width: 64px; font-size: 11px; font-weight: 500; color: var(--faint); background: none; border: 0; padding: 0; text-decoration: none !important; }
  .yk-bnav .active { color: var(--text); font-weight: 600; }
  .yk-bnav .plus span.pb { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; }
  .yk-toasts { top: 68px; right: 16px; }
}
@media (max-width: 760px) {
  .wrap { padding: 20px 16px 40px; }
  h1 { font-size: 24px; }
  .card { padding: 16px; border-radius: 16px; }
  .hero-row { grid-template-columns: 1fr; gap: 14px; }
  .hero { padding: 18px; gap: 12px; }
  .hero .big b { font-size: 52px; }
  .tiles { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .tiles::-webkit-scrollbar { display: none; }
  .tiles > .tile { flex: 0 0 158px; scroll-snap-align: start; padding: 14px; gap: 6px; }
  .tile .v { font-size: 22px; }
  .tile svg.spark { height: 28px; }
  .tile .th .pill { display: none; }
  .dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
  .dots i { width: 5px; height: 5px; border-radius: 3px; background: var(--faint); } .dots i.on { width: 16px; background: var(--text); }
  .row2 { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .preview { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr 1fr; gap: 8px; }
  .modal-in { padding: 20px; gap: 14px; }
  .table-trades { display: none; }
  .cards-list { display: grid; gap: 10px; }
  .tcard { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
  .tcard.fresh { border-color: var(--brand); background: var(--brand-soft); }
  .tcard .l1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .tcard .l1 b { font-size: 15px; }
  .tcard .l3 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
  .links-list a { flex-wrap: wrap; gap: 4px 12px; }
  .links-list a span { flex-basis: 100%; padding-left: 28px; }
}

/* ---------------------------------------------------------------- mouvements discrets */
html.theme-fade, html.theme-fade * { transition: background-color .25s ease, border-color .25s ease, color .25s ease, fill .25s ease !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- charte 3 : sobre, sans halo ni dégradé */
.card { border-radius: var(--radius); box-shadow: none; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { letter-spacing: -0.01em; scroll-margin-top: 140px; }
.tile .v, .hero .big b, td.num { font-feature-settings: "tnum" 1; }
::selection { background: color-mix(in srgb, var(--up) 35%, transparent); }
html { scrollbar-color: var(--line) var(--bg); }
thead th { background: transparent; border-bottom: 1px solid var(--line); }
thead th:first-child, thead th:last-child { border-radius: 0; }
.pill { border-radius: 6px; }
.btn, button { border-radius: 8px; }
input, select, textarea { border-radius: 8px; }
@media (hover: hover) { .card.tile:hover, .card.live-s:hover { border-color: var(--faint); } }

/* Investir : titres en serif, bandeau vert, plus d'air */
[data-space="invest"] h1, [data-space="invest"] h2, [data-space="invest"] h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; letter-spacing: -0.005em; }
[data-space="invest"] h1 { font-size: 34px; }
[data-space="invest"] h2 { font-size: 23px; margin: 44px 0 14px; }
[data-space="invest"] .card { padding: 28px; }
[data-space="invest"] .yk-top { background: var(--shell); border-bottom: 0; color: var(--on-shell); }
[data-space="invest"] .yk-top .yk-brand, [data-space="invest"] .yk-top .yk-tab.active { color: var(--on-shell); }
[data-space="invest"] .yk-top .yk-brand small, [data-space="invest"] .yk-top .yk-tab { color: color-mix(in srgb, var(--on-shell) 72%, transparent); }
[data-space="invest"] .yk-top .yk-tab.active { border-bottom-color: var(--on-shell); }
[data-space="invest"] .yk-top .btn-icon { background: transparent; border-color: color-mix(in srgb, var(--on-shell) 30%, transparent); color: var(--on-shell); }
[data-space="invest"] .yk-top .yk-space { background: color-mix(in srgb, var(--on-shell) 12%, transparent); border-color: transparent; }
[data-space="invest"] .yk-top .yk-space a { color: color-mix(in srgb, var(--on-shell) 75%, transparent); }
[data-space="invest"] .yk-top .yk-space a[aria-current] { background: var(--on-shell); color: var(--shell); box-shadow: none; }

/* sélecteur d'espace Trading / Investir */
.yk-space { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.yk-space a { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none !important; white-space: nowrap; }
.yk-space a[aria-current] { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.yk-sub-space { margin-left: auto; display: inline-flex !important; align-items: center; gap: 2px; color: var(--brand-text) !important; }
@media (max-width: 860px) { .yk-right .yk-space { display: none; } }

/* bandeau des prix en direct */
.yk-ticker { border-bottom: 1px solid var(--line); background: var(--card); min-height: 46px; overflow: hidden; }
.yk-ticker .tradingview-widget-copyright { display: none; }
.yk-ticker iframe { color-scheme: light; } /* sinon le navigateur peint le cadre en blanc en mode sombre */
@media (max-width: 860px) { .yk-ticker { margin-top: 8px; } }

/* stratégies en réel (tableau de bord) */
.live-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.live-s { padding: 18px; display: grid; gap: 10px; align-content: start; }
.live-s .t { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.live-s .t b { font-size: 15px; letter-spacing: -0.01em; }
.live-s .t small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.live-s .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.live-s .s { font-size: 12px; color: var(--muted); }
.live-s .pos { font-size: 12px; padding: 8px 10px; border-radius: 10px; background: var(--soft); display: flex; justify-content: space-between; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; margin-top: 6px; animation: yk-pulse 2.4s ease-in-out infinite; }
.live-dot.idle { background: var(--faint); animation: none; }
[data-space="invest"] .note-box.ok { background: var(--brand-soft); color: var(--brand-text); }
