/* ESQUARE · Kingdom Finance Desk
   Système visuel : thème sombre par défaut (terminal professionnel), thème clair au choix. */
:root {
  --bg: #090d12; --bg2: #0d131a; --panel: #111922; --panel2: #16202b; --panel3: #1c2835;
  --line: #1f2b38; --line2: #2a3949; --ink: #e7edf3; --ink2: #b9c4cf; --muted: #7d8b99; --faint: #4e5d6c;
  --brand: #d6a94a; --brand-ink: #1a1306; --brand-soft: rgba(214,169,74,.12);
  --accent: #3b8bff; --accent-soft: rgba(59,139,255,.14);
  --up: #22b07d; --down: #f0565a; --wait: #8a97a5; --warn: #e8a33d;
  --up-soft: rgba(34,176,125,.14); --down-soft: rgba(240,86,90,.14); --warn-soft: rgba(232,163,61,.14);
  --shadow: 0 1px 0 rgba(255,255,255,.02), 0 8px 24px rgba(0,0,0,.25);
  --r: 10px; --r-sm: 7px;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --f-brand: "Bricolage Grotesque", var(--f-body);
  --side: 216px; --top: 56px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5; --bg2: #e7ebf0; --panel: #ffffff; --panel2: #f5f7fa; --panel3: #ebeff4;
  --line: #e1e6ec; --line2: #cfd7e0; --ink: #0f1924; --ink2: #3a4856; --muted: #66727f; --faint: #a3adb8;
  --brand: #a8781c; --brand-ink: #ffffff; --brand-soft: rgba(168,120,28,.10);
  --accent: #1f6fe5; --accent-soft: rgba(31,111,229,.10);
  --up: #0f9466; --down: #d63b3f; --wait: #6b7785; --warn: #b8730f;
  --up-soft: rgba(15,148,102,.10); --down-soft: rgba(214,59,63,.09); --warn-soft: rgba(184,115,15,.10);
  --shadow: 0 1px 2px rgba(15,25,36,.05), 0 6px 18px rgba(15,25,36,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.up, .ok { color: var(--up); } .down, .bad { color: var(--down); } .warn { color: var(--warn); }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ========== Structure ========== */
.app { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: var(--top) 1fr; min-height: 100vh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { display: flex; align-items: center; gap: 10px; width: calc(var(--side) - 32px); flex: none; text-decoration: none; color: var(--ink); }
.logo .mark-img { background: none; border-radius: 7px; object-fit: contain; }
.logo .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 800 15px var(--f-brand); }
.logo b { font: 800 17px var(--f-brand); letter-spacing: .06em; }
.logo small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: -2px; }
.search { position: relative; flex: 0 1 280px; }
.search input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px 7px 32px; outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; z-index: 30; }
.search .results button { display: flex; width: 100%; gap: 10px; padding: 8px 10px; background: none; border: 0; text-align: left; cursor: pointer; }
.search .results button:hover, .search .results button.sel { background: var(--panel2); }
.top .spacer { flex: 1; }
.top-stat { display: flex; flex-direction: column; line-height: 1.15; }
.top-stat .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.top-stat .v { font: 600 14px var(--f-mono); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; white-space: nowrap; cursor: pointer; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--wait); }
.status.live i { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); animation: pulse 2s infinite; }
.status.stale i { background: var(--down); } .status.demo i { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.clock { font: 12px var(--f-mono); color: var(--muted); white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink2); }
.icon-btn:hover { color: var(--ink); border-color: var(--line2); }

.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow: auto; }
.side .grp { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; position: relative; }
.nav:hover { background: var(--panel); color: var(--ink); }
.nav.on { background: var(--panel2); color: var(--ink); }
.nav.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav svg { flex: none; opacity: .85; }
.nav .badge { margin-left: auto; font: 600 11px var(--f-mono); background: var(--brand-soft); color: var(--brand); padding: 1px 7px; border-radius: 999px; }
.side .foot { margin-top: auto; padding: 12px 10px 4px; font-size: 11px; color: var(--faint); }

.main { padding: 18px 20px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; font: 700 22px var(--f-brand); letter-spacing: -.01em; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

/* ========== Composants ========== */
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .full { grid-column: 1 / -1; }
.g-main { grid-template-columns: minmax(0, 1fr) 360px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.panel.flush .panel-head { padding: 12px 16px 0; }
.panel h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink2); text-transform: uppercase; }
.panel h3 { margin: 0 0 6px; font-size: 14px; }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; display: flex; justify-content: space-between; gap: 6px; }
.kpi .v { font: 600 22px var(--f-mono); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .bar { height: 4px; border-radius: 4px; background: var(--panel3); margin-top: 8px; overflow: hidden; }
.kpi .bar span { display: block; height: 100%; border-radius: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.ghost { background: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 500; }
.seg button.on { background: var(--panel3); color: var(--ink); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink2); white-space: nowrap; }
.chip.up { color: var(--up); background: var(--up-soft); border-color: transparent; }
.chip.down { color: var(--down); background: var(--down-soft); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip.brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.chip.blue { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.pill { display: inline-block; font: 700 11px var(--f-body); letter-spacing: .06em; padding: 3px 8px; border-radius: 5px; }
.pill.buy { background: var(--up); color: #fff; } .pill.sell { background: var(--down); color: #fff; }
.pill.wait { background: var(--panel3); color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
th.sort { cursor: pointer; } th.sort:hover { color: var(--ink); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.num, td.r { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--panel2); }
tr.dim td { opacity: .45; }
td.r, th.r { text-align: right; } td.c, th.c { text-align: center; }
.tw { overflow: auto; }
.sym { display: flex; align-items: center; gap: 9px; }
.sym .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font: 700 10px var(--f-mono); background: var(--panel3); color: var(--ink2); flex: none; }
.sym b { display: block; font-size: 13px; } .sym small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.empty { text-align: center; color: var(--muted); padding: 26px 12px; }
.empty b { display: block; color: var(--ink2); margin-bottom: 4px; }
.note { font-size: 12.5px; color: var(--muted); }
.callout { border: 1px solid var(--line2); border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.callout.danger { border-left-color: var(--down); background: var(--down-soft); }
.callout.info { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.good { border-left-color: var(--up); background: var(--up-soft); }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; }

dl.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; text-align: right; font-family: var(--f-mono); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.f input, .f select, .f textarea, select.in, input.in { background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--ink); min-width: 0; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--accent); outline: none; }
textarea { min-height: 70px; resize: vertical; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

/* ========== Opportunités ========== */
.opps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.opp { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--panel2); cursor: pointer; position: relative; overflow: hidden; }
.opp:hover { border-color: var(--line2); }
.opp::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.opp.buy::before { background: var(--up); } .opp.sell::before { background: var(--down); }
.opp .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opp .t { font: 700 16px var(--f-mono); }
.opp .plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 8px; }
.opp .plan div { background: var(--panel); border-radius: 6px; padding: 5px 7px; }
.opp .plan .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.opp .plan .v { font: 600 12.5px var(--f-mono); }
.conf { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.conf .meter { flex: 1; height: 5px; background: var(--panel3); border-radius: 5px; overflow: hidden; }
.conf .meter span { display: block; height: 100%; background: var(--brand); }

/* ========== Carte des marchés ========== */
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.heat .cell { border-radius: 7px; padding: 8px 9px; cursor: pointer; min-height: 58px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid transparent; }
.heat .cell:hover { border-color: var(--line2); }
.heat .cell b { font: 600 12px var(--f-mono); }
.heat .cell span { font: 600 13px var(--f-mono); }
.heat .cell.demo { opacity: .4; }

.strength .item { display: grid; grid-template-columns: 38px 1fr 64px; align-items: center; gap: 8px; margin: 5px 0; font-size: 12.5px; }
.strength .track { height: 8px; position: relative; background: var(--panel3); border-radius: 4px; }
.strength .track::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line2); }
.strength .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }

.sessions { position: relative; height: 92px; margin-top: 4px; }
.sessions .lane { position: absolute; left: 70px; right: 0; height: 14px; border-radius: 4px; }
.sessions .name { position: absolute; left: 0; font-size: 11.5px; color: var(--muted); width: 66px; }
.sessions .sblk { position: absolute; top: 0; bottom: 0; border-radius: 4px; border: 0; padding: 0; background: var(--panel3); }
.sessions .sblk.open { background: var(--brand); opacity: .85; }
.sessions .now { position: absolute; top: -4px; bottom: 14px; width: 2px; background: var(--accent); }
.sessions .ticks { position: absolute; left: 70px; right: 0; bottom: 0; display: flex; justify-content: space-between; font: 10px var(--f-mono); color: var(--faint); }

/* ========== Graphique ========== */
.chart-wrap { height: 520px; position: relative; }
.chart-wrap.sm { height: 240px; } .chart-wrap.xs { height: 170px; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chart-legend { position: absolute; left: 12px; top: 8px; z-index: 3; font: 12px var(--f-mono); color: var(--ink2); pointer-events: none; display: flex; gap: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--brand); }
.reasons { list-style: none; padding: 0; margin: 0; }
.reasons li { display: flex; gap: 9px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.reasons li:last-child { border-bottom: 0; }
.reasons .pt { font: 700 12px var(--f-mono); min-width: 26px; text-align: center; border-radius: 5px; padding: 1px 4px; }
.pt.p { background: var(--up-soft); color: var(--up); } .pt.n { background: var(--down-soft); color: var(--down); } .pt.z { background: var(--panel3); color: var(--muted); }
.signal-box { border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.signal-box.buy { background: var(--up-soft); } .signal-box.sell { background: var(--down-soft); } .signal-box.wait { background: var(--panel2); }
.signal-box .big { font: 800 26px var(--f-brand); letter-spacing: .02em; }
.signal-box.buy .big { color: var(--up); } .signal-box.sell .big { color: var(--down); } .signal-box.wait .big { color: var(--wait); }

/* ========== Laboratoire ========== */
.matrix td.cellv { text-align: center; padding: 6px; }
.vchip { display: inline-flex; flex-direction: column; align-items: center; min-width: 74px; padding: 5px 6px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; line-height: 1.2; }
.vchip:hover { border-color: var(--line2); }
.vchip b { font: 700 11px var(--f-body); letter-spacing: .03em; }
.vchip small { font: 11px var(--f-mono); opacity: .9; }
.vchip.proven { background: var(--up-soft); color: var(--up); }
.vchip.promising { background: var(--warn-soft); color: var(--warn); }
.vchip.rejected { background: var(--panel2); color: var(--muted); }
.vchip.sel { border-color: var(--brand); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 8px; padding: 5px 0; font-size: 13px; }
.checks li::before { content: "✕"; color: var(--down); font-weight: 700; width: 14px; flex: none; }
.checks li.ok::before { content: "✓"; color: var(--up); }
.months { display: grid; grid-template-columns: 44px repeat(12, minmax(0, 1fr)) 56px; gap: 3px; font: 11px var(--f-mono); }
.months div { padding: 5px 2px; text-align: center; border-radius: 4px; }
.months .h { color: var(--muted); background: none; }
.bars-v { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars-v .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars-v .b i { display: block; width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars-v .b small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.progress { height: 6px; background: var(--panel3); border-radius: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.summary-text { font-size: 14px; line-height: 1.55; }
.summary-text b { color: var(--ink); }

/* ========== Notifications ========== */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel3); border: 1px solid var(--line2); color: var(--ink); padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); z-index: 50; font-size: 13px; }
.alerts { margin-bottom: 14px; display: grid; gap: 8px; }
.alerts:empty { display: none; }
.alert { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-radius: 9px; padding: 10px 14px; font-size: 13px; border: 1px solid transparent; }
.alert.danger { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert b { font-weight: 600; }

.spark { display: block; }
.steps { margin: 0; padding-left: 20px; } .steps li { margin: 5px 0; }
code { font: 12.5px var(--f-mono); background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.stars button { background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--faint); padding: 0 1px; }
.stars button.on { color: var(--brand); }

/* ========== Écrans plus petits ========== */
@media (max-width: 1280px) { .g6, .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) {
  :root { --side: 64px; }
  .side .grp, .nav span, .nav .badge, .side .foot, .logo span { display: none; }
  .logo { width: auto; } .nav { justify-content: center; } .nav.on::before { left: -10px; }
  .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .top-stat.hide-md, .clock { display: none; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; grid-template-rows: var(--top) 1fr auto; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: 60px; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); z-index: 25; justify-content: space-around; overflow-x: auto; }
  .nav { padding: 8px; width: auto; } .nav.on::before { display: none; }
  .main { padding: 14px 16px 90px; }
  .g2, .g3 { grid-template-columns: 1fr; } .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .span2, .span3 { grid-column: auto; }
  .kpi { padding: 10px 11px; } .kpi .v { font-size: 17px; } .kpi .s { font-size: 11px; }
  .top { gap: 8px; } .search { flex: 1; } .top-stat { display: none; }
  .chart-wrap { height: 380px; }
  .months { grid-template-columns: 36px repeat(12, minmax(0, 1fr)) 44px; font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.star { background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 15px; padding: 2px; }
.star:hover { color: var(--ink2); } .star.on { color: var(--brand); }
.steps code { word-break: break-all; }

/* ========== Rapports : mise en page papier et impression ========== */
.paper { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 30px; max-width: 1100px; }
.paper h3 { font: 600 14px var(--f-body); margin: 20px 0 8px; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.paper ul { margin: 0; padding-left: 20px; } .paper li { margin: 4px 0; }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--brand); padding-bottom: 12px; margin-bottom: 16px; }
.paper-head h2 { margin: 4px 0 2px; font: 800 24px var(--f-brand); }
.paper-brand { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.paper-head .mark { width: 40px; height: 40px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font: 800 18px var(--f-brand); }
/* ========== Assistant Claude ========== */
.ai-msgs { max-height: 62vh; overflow-y: auto; display: grid; gap: 10px; align-content: start; }
.ai-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-msg.me { justify-self: end; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.ai-msg.bot { justify-self: start; background: var(--panel2); border: 1px solid var(--line); }
.ai-msg.err { background: var(--down-soft); }
.ai-msg p { margin: 0 0 8px; } .ai-msg p:last-child { margin-bottom: 0; }
.ai-msg h3 { font: 600 14px var(--f-body); margin: 12px 0 6px; color: var(--ink); }
.ai-msg ol { margin: 4px 0 8px; padding-left: 22px; } .ai-msg li { margin: 3px 0; }
.ai-msg .tw { margin: 8px 0; }
.ai-msg a { color: var(--accent); }
h3.sub { font: 600 13px var(--f-body); color: var(--ink2); margin: 0 0 10px; }
.qr { background: #fff; padding: 10px; border-radius: 8px; display: inline-block; line-height: 0; }
@media (max-width: 700px) { .ai-msg { max-width: 100%; } }

/* ========== Salle de marché ========== */
.room { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.room-side { display: grid; gap: 14px; min-width: 0; }
.room-clock { text-align: right; } .room-clock b { display: block; font: 700 30px var(--f-mono); letter-spacing: .02em; color: var(--ink); } .room-clock small { font: 12px var(--f-mono); color: var(--muted); }
.room-state { margin: -4px 0 12px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 4px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.board tbody tr { cursor: pointer; } .board tr.sel td { background: var(--brand-soft); }
.board td.px { font-weight: 600; font-size: 14px; border-radius: 4px; }
.board th, .board td { padding-left: 7px; padding-right: 7px; white-space: nowrap; }
.fl-up { animation: flUp .9s ease-out; } .fl-dn { animation: flDn .9s ease-out; }
@keyframes flUp { from { background: color-mix(in srgb, var(--up) 45%, transparent); color: var(--up); } to { background: transparent; } }
@keyframes flDn { from { background: color-mix(in srgb, var(--down) 45%, transparent); color: var(--down); } to { background: transparent; } }
.rng { position: relative; height: 6px; min-width: 70px; border-radius: 3px; background: linear-gradient(90deg, var(--down-soft), var(--up-soft)); }
.rng span { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.tape { max-height: 330px; overflow-y: auto; } .tape td { padding-top: 3px; padding-bottom: 3px; font-size: 12px; }
.prec { display: inline-flex; align-items: center; gap: 8px; } .prec-bar { width: 70px; height: 6px; border-radius: 3px; background: var(--panel3); overflow: hidden; } .prec-bar i { display: block; height: 100%; }
@media (max-width: 1100px) { .room { grid-template-columns: 1fr; } }
.probbox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); margin-top: 4px; }
.probbox .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.probbox .pv { font: 700 22px var(--f-mono); line-height: 1.2; }
.pv.up, .lpv.up { color: var(--up); } .pv.warn, .lpv.warn { color: var(--warn); } .pv.down, .lpv.down { color: var(--down); }
.lpv { transition: color .3s; font-weight: 600; }


/* ========== Thème terminal de marché (inspiré des terminaux Bloomberg et des salles de marché) ==========
   Psychologie des couleurs : fond noir neutre qui repose les yeux, bleu pour les titres et l'attention, gris bleuté pour l'information,
   vert et rouge réservés aux gains et aux pertes (jamais décoratifs), pas de couleur criarde qui pousse à agir.
   Données denses, chiffres en police à chasse fixe alignés, angles nets. */
:root:not([data-theme="light"]) {
  /* Bleu marine terminal (18 octobre, choix d'Enock) : fond marine au lieu du noir pur, bleu des accents plus calme, vert et rouge classiques */
  --bg: #0b1220; --bg2: #0e1626; --panel: #121b2b; --panel2: #172235; --panel3: #1d2a40;
  --line: #1f2c40; --line2: #2b3b54; --ink: #e6ebf2; --ink2: #c3ccd8; --muted: #8d99ab; --faint: #58667c;
  --brand: #5b9cff; --brand-ink: #ffffff; --brand-soft: rgba(91,156,255,.14);
  --accent: #8fb3e6; --accent-soft: rgba(143,179,230,.12);
  --up: #26c281; --down: #ff5c5c; --wait: #8d99ab; --warn: #ffb020;
  --up-soft: rgba(38,194,129,.14); --down-soft: rgba(255,92,92,.14); --warn-soft: rgba(255,176,32,.13);
  --shadow: none; --r: 4px; --r-sm: 3px;
}
:root:not([data-theme="light"]) .top { background: var(--bg2); border-bottom: 1px solid var(--line2); }
:root:not([data-theme="light"]) .logo .mark { border-radius: 3px; }
:root:not([data-theme="light"]) .logo b { color: var(--brand); letter-spacing: .14em; }
.panel h2, .ticket h2 { font: 600 11px var(--f-mono); letter-spacing: .12em; color: var(--brand); }
:root[data-theme="light"] .panel h2 { color: var(--ink2); }
.page-head h1 { font: 700 20px var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
:root:not([data-theme="light"]) .page-head h1 { color: var(--brand); }
:root:not([data-theme="light"]) .panel-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
:root:not([data-theme="light"]) .panel.flush .panel-head { padding-bottom: 8px; }
:root:not([data-theme="light"]) th { color: var(--accent); font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; background: var(--panel); }
:root:not([data-theme="light"]) td { padding-top: 6px; padding-bottom: 6px; }
:root:not([data-theme="light"]) tr:hover td { background: rgba(255,255,255,.015); }
:root:not([data-theme="light"]) .kpi .k { color: var(--accent); font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; }
:root:not([data-theme="light"]) .kpi { border-left: 2px solid var(--line2); }
:root:not([data-theme="light"]) .nav.on { background: var(--brand-soft); color: var(--brand); }
:root:not([data-theme="light"]) .nav { border-radius: 3px; font-size: 13px; }
:root:not([data-theme="light"]) .side .grp { color: var(--accent); font-family: var(--f-mono); }
:root:not([data-theme="light"]) .btn { border-radius: 3px; text-transform: uppercase; font: 600 11.5px var(--f-mono); letter-spacing: .06em; }
:root:not([data-theme="light"]) .btn.sm { font-size: 10.5px; }
:root:not([data-theme="light"]) .chip, :root:not([data-theme="light"]) .seg, :root:not([data-theme="light"]) .seg button { border-radius: 3px; }
:root:not([data-theme="light"]) input, :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) textarea { border-radius: 3px; }

/* Journal en onglets (16 octobre) : seuls les blocs de l'onglet choisi sont montrés */
[data-jtab="resume"] [data-jt]:not([data-jt="resume"]), [data-jtab="stats"] [data-jt]:not([data-jt="stats"]), [data-jtab="analyse"] [data-jt]:not([data-jt="analyse"]), [data-jtab="moteur"] [data-jt]:not([data-jt="moteur"]) { display: none; }
.tab-hide { display: none !important; }
.opp-sig.focus { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Poste de décision (accueil, 15 octobre) : signaux à jouer au centre, robot, état et annonce à droite */
.desk-mainc { min-width: 0; }
.desk { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.desk-side { display: grid; gap: 14px; }
.desk-side .panel { padding: 12px 14px; }
@media (max-width: 1000px) { .desk { grid-template-columns: minmax(0, 1fr); } }

/* Bandeau défilant des prix (comme sous l'écran d'un terminal) */
.ticker { grid-column: 1 / -1; height: 26px; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: var(--top); z-index: 19; white-space: nowrap; font: 600 12px var(--f-mono); display: flex; align-items: center; }
:root[data-theme="light"] .ticker { background: var(--bg2); }
.ticker .tk-run { display: inline-flex; gap: 26px; padding-left: 100%; animation: tkmove 90s linear infinite; }
.ticker:hover .tk-run { animation-play-state: paused; }
.ticker .tk { display: inline-flex; gap: 7px; } .ticker .tk b { color: var(--brand); } .ticker .tk i { font-style: normal; }
@keyframes tkmove { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.app.has-ticker { grid-template-rows: var(--top) 26px 1fr; }
.app.has-ticker .side { top: calc(var(--top) + 26px); height: calc(100vh - var(--top) - 26px); }

/* Couche smart money concepts posée sur le graphique */
.chart-wrap { position: relative; }
.smc-layer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }

/* Plan de trade */
.plan-x { margin-top: 10px; }
.plan-x .px-h { font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 10px 0 4px; }
.plan-x table td { padding: 5px 6px; }
.plan-c { display: grid; gap: 4px; margin: 8px 0; font-size: 12px; }
.plan-c > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.plan-c .k { font: 600 10px var(--f-mono); letter-spacing: .1em; color: var(--accent); width: 52px; }
.plan-c b { font-weight: 600; } .plan-c b.dim { opacity: .6; font-weight: 500; } .plan-c small { font-size: 10.5px; }

/* Calculatrice et ticket d'ordre */
.form.calc { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ticket { border-color: var(--brand); }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tk-grid > div { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.tk-grid span { display: block; font: 600 10px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.tk-grid b { font: 700 16px var(--f-mono); }

@media print {
  :root, :root[data-theme] { --bg: #fff; --bg2: #fff; --panel: #fff; --panel2: #f4f5f7; --panel3: #e9ecef; --line: #d8dde3; --line2: #c8ced6; --ink: #111; --ink2: #333; --muted: #555; --faint: #888; }
  body { background: #fff; }
  .top, .side, .alerts, .no-print, .toast, .btn { display: none !important; }
  .app { display: block; } .main { padding: 0; }
  .paper { border: 0; padding: 0; max-width: none; }
  .kpi, .panel { break-inside: avoid; }
  table { font-size: 11px; } th { position: static; }
}

/* ========== Actualités ========== */
.news { display: flex; flex-direction: column; }
.news-it { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.news-it:hover { background: var(--bg-2, rgba(255,255,255,.03)); }
.news-it.imp3 { border-left-color: var(--down); }
.news-it.imp2 { border-left-color: var(--warn); }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.news-meta b { color: var(--brand, #3d8bff); }
.news-t { font-size: 14px; line-height: 1.35; }
.sbar { position: relative; height: 8px; background: var(--line); border-radius: 4px; }
.sbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.sbar i.pos { left: 50%; background: var(--up); }
.sbar i.neg { right: 50%; background: var(--down); }
.src-tag { font-size: 10.5px; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); }
.lat-ok { color: var(--up); } .lat-mid { color: var(--warn); } .lat-bad { color: var(--down); }
.gl { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 6px; font-size: 11.5px; }
.gl > b { margin-right: 4px; font-size: 12.5px; }

/* ========== Signaux ========== */
.sig-card { margin-bottom: 12px; border-left: 3px solid var(--line); }
.sig-card.clsA { border-left-color: var(--up); }
.sig-card.clsB { border-left-color: var(--warn); }
.sig-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.sig-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sig-sym { font-size: 17px; }
.sig-prob { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.sig-prob b { font-size: 16px; }
.sig-adv { margin: 8px 0; font-size: 13.5px; }
.sig-adv.up { color: var(--up); } .sig-adv.warn { color: var(--warn); } .sig-adv.down { color: var(--down); }
.sig-an, .sig-ai { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.an-sec { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.an-sec h3 { margin: 4px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand, #3d8bff); }
.an-sec p { margin: 4px 0; line-height: 1.5; font-size: 13.5px; }
.an-list { margin: 4px 0 4px 18px; padding: 0; line-height: 1.55; font-size: 13.5px; }
.an-list li.up { color: var(--up); } .an-list li.down { color: var(--down); }
.ai-text { line-height: 1.55; font-size: 13.5px; }
.chip .x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }
.scen { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 10px 0; }
.scen.best { border-color: var(--up); }
.scen-h { margin-bottom: 4px; }
.an-fc h3 { margin: 4px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand, #3d8bff); }

/* ========== Ticket d'ordre ========== */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-start; justify-content: center; z-index: 1000; overflow: auto; padding: 40px 16px; }
.modal { background: var(--bg, #0b0b0b); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; width: min(720px, 100%); }

/* ========== Téléphone : menu repliable, contenu sur toute la largeur ==========
   Placé en fin de fichier pour l'emporter sur les règles du bandeau des prix. */
.menu-btn { display: none; flex: none; }
.nav-backdrop { display: none; }
@media (max-width: 720px) {
  .app, .app.has-ticker { grid-template-columns: minmax(0, 1fr); }
  .app.has-ticker { grid-template-rows: var(--top) 26px 1fr; }
  .app:not(.has-ticker) { grid-template-rows: var(--top) 1fr; }
  .menu-btn { display: grid; }
  .app .side, .app.has-ticker .side {
    position: fixed; top: var(--top); left: 0; right: auto; bottom: 0; width: min(280px, 82vw); height: auto;
    flex-direction: column; justify-content: flex-start; padding: 12px 10px; overflow-y: auto;
    border-right: 1px solid var(--line); border-top: 0; transform: translateX(-105%); transition: transform .2s ease; z-index: 40;
  }
  .app.nav-open .side { transform: none; }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .55); z-index: 35; }
  .side .grp { display: block; } .nav span { display: inline; } .nav .badge { display: inline-flex; } .side .foot { display: block; }
  .nav { justify-content: flex-start; width: 100%; padding: 10px 12px; }
  .main { grid-column: 1; padding: 12px 12px 40px; }
  .logo span { display: none; }
  .top { padding: 0 10px; gap: 8px; }
  .search input { font-size: 16px; }   /* évite le zoom automatique d'iPhone */
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head h1 { font-size: 17px; }
  .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg { flex-wrap: wrap; }
  .row.between { flex-wrap: wrap; gap: 8px; }
  .modal-bg { padding: 10px 8px; }
  .form { grid-template-columns: minmax(0, 1fr) !important; }
  .room-board, .room-side { min-width: 0; }
  input.in, select.in { max-width: 100%; }
  .room, .g2, .g3, .g-main { grid-template-columns: minmax(0, 1fr); }
  .grid > *, .room > *, .panel { min-width: 0; }
  .row { flex-wrap: wrap; }
  html, body { overflow-x: clip; }   /* dernier filet : jamais de défilement de côté de toute la page */
}


/* ========== 6 sections : sous-onglets en haut, onglets en bas sur téléphone ==========
   Placé en fin de fichier pour l'emporter sur les règles précédentes. */
.subnav { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -4px 0 16px; }
.subnav:empty { display: none; }
.subnav a { padding: 9px 13px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); }
.nav.on { color: var(--brand); }
.tabbar { display: none; }
@media (max-width: 720px) {
  .app .side, .app.has-ticker .side { display: none !important; }
  .menu-btn, .nav-backdrop { display: none !important; }
  .main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .subnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subnav a { padding: 9px 11px; font-size: 13.5px; }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg2); border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 10px; padding: 6px 0; text-decoration: none; }
  .tabbar a.on { color: var(--brand); }
}


/* ========== Opportunités (moteur continu) ========== */
.opp-market { margin-bottom: 12px; }
.opp-sig { border-top: 1px solid var(--line); }
.opp-sig:first-of-type { border-top: 0; }
.opp-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; background: none; border: 0; color: inherit; text-align: left; padding: 9px 0; cursor: pointer; font: inherit; }
.opp-head:hover { color: var(--brand); }
/* Carte allégée (15 octobre) : les étiquettes secondaires n'apparaissent qu'en ouvrant la carte */
.opp-more { display: contents; }
.opp-sig:not(.is-open) .opp-more { display: none; }
/* Carte dépliée (16 octobre) : points forts, puis informations, puis avertissements ; l'heure du signal en dernier */
.opp-sig.is-open .opp-more > .chip.up { order: 2; }
.opp-sig.is-open .opp-more > .chip:not(.up):not(.warn):not(.down), .opp-sig.is-open .opp-more > .faint { order: 3; }
.opp-sig.is-open .opp-more > .chip.warn, .opp-sig.is-open .opp-more > .chip.down { order: 4; }
.opp-sig.is-open .opp-head > span.faint:last-of-type { order: 5; }
.opp-sig.is-open .opp-warnc { display: none; }
.opp-body { padding: 0 0 12px; }
/* Opportunités compact, style terminal financier (choix d'Enock du 12 octobre) : plus d'informations par écran */
.opp-compact .panel { padding: 10px 12px; }
.opp-compact .opp-market { margin-bottom: 8px; }
.opp-compact .panel-head { margin-bottom: 4px; }
.opp-compact .opp-head { padding: 5px 0; gap: 6px; font-size: 13px; }
.opp-compact .opp-body { padding: 0 0 8px; }
.opp-compact td, .opp-compact th { padding: 4px 8px; font-size: 12.5px; }
.opp-compact .num { font-variant-numeric: tabular-nums; }
.opp-compact .chip { padding: 1px 7px; font-size: 11.5px; }
.opp-compact .checks li { margin: 2px 0; font-size: 12.5px; }
tr.sc-neg td { opacity: .78; }
@media (max-width: 720px) { .tabbar { grid-template-columns: repeat(6, 1fr) !important; } }

/* Apprentissage (12 octobre) : leçons animées, quiz, guide et visite guidée */
.learn-list { margin: 0; padding-left: 22px; } .learn-list li { margin: 5px 0; } .learn-list li.done a { color: var(--up); }
.learn-scene { margin-bottom: 10px; } .learn-svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.learn-svg .a, .learn-scene svg .a { opacity: 0; animation: lrnIn .6s ease forwards; }
@keyframes lrnIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.learn-say { font-size: 15.5px; line-height: 1.6; } .learn-text { font-size: 15px; line-height: 1.6; }
.learn-bar { height: 4px; background: var(--line); border-radius: 4px; margin-top: 12px; overflow: hidden; } .learn-bar i { display: block; height: 100%; background: var(--brand); }
.learn-q { padding: 10px 0; border-bottom: 1px solid var(--line); } .learn-opt { display: block; margin: 4px 0; cursor: pointer; }
.learn-why { margin-top: 6px; padding: 8px 10px; border-radius: 6px; } .learn-why.ok { background: rgba(47,191,113,.12); } .learn-why.ko { background: rgba(229,83,75,.12); }
.learn-guide { display: grid; grid-template-columns: 240px 1fr; gap: 12px; } .learn-guide nav a { display: block; padding: 6px 8px; border-radius: 6px; } .learn-guide nav a.on { background: var(--brand-soft); color: var(--brand); }
.learn-guide article { line-height: 1.6; } @media (max-width: 800px) { .learn-guide { grid-template-columns: 1fr; } }
.tour { position: fixed; inset: 0; z-index: 2000; pointer-events: none; } .tour-dim { position: fixed; inset: 0; background: rgba(0,0,0,.55); }
.tour-hole { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); border: 2px solid var(--brand); transition: all .25s; }
.tour-bubble { position: fixed; width: 340px; max-width: 92vw; background: var(--panel, #1b1f27); border: 1px solid var(--brand); border-radius: 10px; padding: 12px 14px; pointer-events: auto; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.tour-bubble p { margin: 6px 0 10px; line-height: 1.5; }
.learn-timer { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.learn-day { display: inline-flex; gap: 8px; align-items: center; } .learn-day .learn-bar { width: 120px; margin: 0; }

/* Téléphone : regarder seulement (réponses 151 et 152) */
.remote [data-tk], .remote #mt5Assoc, .remote #tkCheck, .remote #tkSend { display: none !important; }
.remote [data-section="compte"], .remote [data-section="rapports"], .remote [data-section="apprendre"], .remote [data-section="reglages"] { display: none !important; }
.remote [data-closepos], .remote [data-trail] { display: none !important; }

/* Signal passé volontairement (réponse 271) */
.opp-sig.passed > .opp-head, .opp-sig.passed > .faint { opacity: .45; }
/* Téléphone (réponse 270) : une ligne par signal, chips essentiels seulement, mini graphique caché */
@media (max-width: 700px) {
  .opp-head .chip:not(.k):not(.pill), .opp-head > .faint { display: none; }
  .opp-head { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .opp-mini { display: none; }
  .opp-body .tw { overflow-x: auto; }
}

/* Positions (13 octobre) : boutons toujours à la même place, barre stop -> objectifs */
.pos-btns { display: inline-flex; gap: 4px; flex-wrap: nowrap; }
.pos-btns .btn { white-space: nowrap; }
.pos-btns .btn:disabled { opacity: .38; cursor: not-allowed; }
.pos-bar { position: relative; height: 8px; background: var(--line); border-radius: 4px; margin: 26px 6px 30px; }
.pos-bar i { position: absolute; top: -5px; width: 2px; height: 18px; background: var(--faint); transform: translateX(-1px); font-style: normal; }
.pos-bar i span { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.pos-bar .pos-stop { background: var(--down); }
.pos-bar .pos-entry { background: var(--accent); }
.pos-bar .pos-tgt { background: var(--up); }
.pos-bar .pos-cur { position: absolute; top: -6px; width: 14px; height: 20px; border-radius: 4px; transform: translateX(-7px); background: var(--brand); box-shadow: 0 0 0 2px var(--panel); transition: left .25s ease; }
.pos-bar .pos-cur.up { background: var(--up); } .pos-bar .pos-cur.down { background: var(--down); }

/* Historique de la gestion (écran Gestion) */
.pos-hist { margin-top: 10px; } .pos-hist summary, .gs-closed summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.gs-tl { list-style: none; margin: 6px 0 4px; padding: 0 0 0 4px; border-left: 2px solid var(--line); }
.gs-tl li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0 3px 10px; font-size: 13px; position: relative; }
.gs-tl .gs-t { color: var(--muted); min-width: 108px; font-size: 12px; } .gs-tl .gs-i { width: 18px; text-align: center; }
.gs-tl .gs-stop span:last-child, .gs-tl .gs-protection span:last-child { color: var(--accent); }
.gs-tl .gs-objectif, .gs-tl .gs-sortie-finale { font-weight: 600; }
.gs-closed { border-top: 1px solid var(--line); padding: 6px 0; } .gs-closed summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Barre du haut lisible (13 octobre) : chaque élément garde sa largeur, les montants tiennent sur une ligne, détail dessous */
.top { gap: 10px; }
.top > * { flex: none; }
.top .search { flex: 1 1 200px; min-width: 120px; max-width: 280px; }
.top .spacer { flex: 1 1 0; min-width: 0; }
#acctSel { min-width: 150px; max-width: 220px; text-overflow: ellipsis; }
.top-stat { padding: 0 12px; border-left: 1px solid var(--line); white-space: nowrap; justify-content: center; min-height: 40px; }
.top-stat + .top-stat { padding-left: 12px; }
.top-stat .k { font-size: 10px; }
.top-stat .v { font: 700 15px var(--f-mono); line-height: 1.2; }
.top-stat .sub { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); line-height: 1.2; }
.top-stat .sub .bar { display: inline-block; width: 44px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.top-stat .sub .bar i { display: block; height: 4px; background: var(--up); border-radius: 2px; }
.top .status { flex: none; }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; white-space: nowrap; font-size: 12px; }
.clock b { font: 600 13px var(--f-mono); color: var(--ink); }
.clock .sess { font-size: 10.5px; color: var(--muted); }
#latWarn { white-space: nowrap; flex: none; }
@media (max-width: 1500px) { .top { gap: 8px; } .top .status .bk, #latWarn .lw { display: none; } .logo small { display: none; } .top .logo { width: auto; padding-right: 6px; } .clock .sess { display: none; } #acctSel { min-width: 120px; width: 140px; } .top-stat { padding: 0 10px; } .top .status .chip { font-size: 10.5px !important; padding: 1px 5px !important; } }
@media (max-width: 1280px) { .clock .sess { display: none; } #acctSel { min-width: 120px; max-width: 150px; } }
@media (max-width: 1280px) { .top .logo span, .top .status .st-txt { display: none; } }
@media (max-width: 1100px) { .clock { display: none; } }
@media (min-width: 900px) and (max-width: 1100px) { #topEquity.top-stat { display: flex; } }   /* capital toujours visible quand la place suffit */
@media (max-width: 720px) { #acctSel, #mt5Assoc, .top .status .st-txt, .top .status .rb { display: none !important; } .top .search { min-width: 0; max-width: none; flex: 1 1 auto; } .top .status { padding: 6px 8px; } }   /* téléphone : recherche, point d'état, retard et thème */

/* Poignées du stop et des objectifs (écran Gestion) : à faire glisser */
.pos-bar i[data-drag] { cursor: ew-resize; touch-action: none; z-index: 2; }
.pos-bar i[data-drag]::before { content: ""; position: absolute; top: -10px; bottom: -10px; left: -10px; right: -10px; }
.pos-bar i[data-drag]::after { content: ""; position: absolute; top: -8px; left: -5px; width: 12px; height: 10px; border-radius: 3px; background: inherit; box-shadow: 0 0 0 2px var(--panel); }
.pos-bar i[data-drag]:hover::after, .pos-bar i[data-drag]:active::after { transform: scale(1.25); }
.pos-bar .pos-tgt.done { opacity: .55; }
.pos-bar .pos-stop span { color: var(--down); }

/* Menu plus court (18 octobre) : « Plus » ouvre les onglets moins utilisés */
.subnav-more { position: relative; }
.subnav-more > summary { list-style: none; cursor: pointer; padding: 9px 13px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav-more > summary::-webkit-details-marker { display: none; }
.subnav-more.on > summary { color: var(--brand); border-bottom-color: var(--brand); }
.subnav-pop { position: absolute; z-index: 30; top: 100%; left: 0; min-width: 190px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; flex-direction: column; }
.subnav-pop a { border-bottom: 0 !important; padding: 8px 10px; border-radius: 6px; }
.subnav-pop a:hover { background: var(--panel2); }
/* Poste de décision compact (18 octobre) : les 5 chiffres du compte sur une ligne fine */
.kpi-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi-strip .kpi { padding: 7px 10px; }
.kpi-strip .kpi .v { font-size: 17px; margin-top: 2px; }
.kpi-strip .kpi .s { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-strip .kpi .bar { margin-top: 5px; height: 3px; }
@media (max-width: 900px) { .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Opportunités : contexte replié (18 octobre) */
.opp-ctxbox > summary { cursor: pointer; list-style: none; padding: 8px 12px; color: var(--muted); }
.opp-ctxbox > summary::-webkit-details-marker { display: none; }
.opp-ctxbox[open] > summary { color: var(--ink); }
/* Plan du jour : libellés lisibles (18 octobre) */
.desk-plan td:first-child { width: 34%; color: var(--muted); }
.desk-plan td.r { text-align: left; }
.desk-plan table { table-layout: fixed; width: 100%; }
.desk-plan td { white-space: normal; overflow-wrap: anywhere; }

/* Mode simple (18 octobre, choix d'Enock) : l'essentiel seulement */
.simple .nav-full { display: none !important; }
.simple #oppQuick, .simple #oppTabs, .simple #oppSort, .simple #oppCsv, .simple #oppCtxBox, .simple #oppRobot { display: none !important; }
.simple label:has(#oppFmode), .simple label:has(#oppFauto), .simple label:has(#oppAutoDemo), .simple label:has(#oppShowHold) { display: none !important; }
.simple .opp-more, .simple .x-fb, .simple .x-kb, .simple .x-modes, .simple .x-past, .simple .x-ctx, .simple .x-why { display: none !important; }
.simple [data-share], .simple [data-ai], .simple [data-hidem], .simple [data-hides], .simple [data-pass] { display: none !important; }

/* Plein écran et hauteur des graphiques (24 octobre) */
.chart-wrap.h-g { height: 760px; } .chart-wrap.h-tg { height: 1000px; }
.panel.ch-full, .panel:fullscreen { position: fixed; inset: 0; z-index: 2000; margin: 0; border-radius: 0; background: var(--bg); overflow: auto; display: flex; flex-direction: column; }
.panel.ch-full .chart-wrap, .panel:fullscreen .chart-wrap { flex: 1; height: auto !important; min-height: 400px; }
.panel.ch-full .chart-tools, .panel:fullscreen .chart-tools { padding: 6px 12px; }
body.ch-full-on { overflow: hidden; }
/* Fiche multi-unités à imprimer (24 octobre) : seule la fiche est imprimée */
@media print { body.print-fiche * { visibility: hidden; } body.print-fiche #rmFiche, body.print-fiche #rmFiche * { visibility: visible; } body.print-fiche #rmFiche { position: absolute; left: 0; top: 0; width: 100%; } body.print-fiche #rmPrint { display: none; } }
/* Outils des graphiques et visionneuse (26 octobre : zoomer, dézoomer, plein écran partout) */
.gr-outils { position: absolute; top: 6px; right: 70px; z-index: 6; display: flex; gap: 4px; opacity: .55; transition: opacity .15s; }
.gr-outils:hover, .chart-wrap:hover .gr-outils, .ch-full .gr-outils { opacity: 1; }
.gr-outils button, .visio-barre button { background: var(--panel, #111a29); color: var(--ink, #e6edf6); border: 1px solid var(--line); border-radius: 6px; min-width: 28px; height: 26px; cursor: pointer; font-size: 13px; }
.gr-outils button:hover, .visio-barre button:hover { border-color: var(--accent); }
svg[role="img"]:not(.spark), img[src^="/api/snapshot"], [data-zoom] { cursor: zoom-in; }
.visio { position: fixed; inset: 0; z-index: 3000; background: rgba(5, 9, 16, .94); display: flex; flex-direction: column; }
.visio-barre { display: flex; gap: 6px; justify-content: flex-end; padding: 10px 14px; }
.visio-zone { flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.visio-zone:active { cursor: grabbing; }
.visio-contenu { width: min(1400px, 96vw); transform-origin: center center; }
.visio-contenu svg, .visio-contenu img { display: block; width: 100%; height: auto; background: var(--bg, #0b1220); border-radius: 8px; }

/* ========== Thème « Terminal » (29 octobre, idée de l'affichage du Terminal Bloomberg, choix d'Enock) ==========
   Fond noir, ambre pour les titres et les commandes, chiffres en police fixe, tableaux denses, angles droits. Hérite des réglages du
   thème sombre (toutes les règles :root:not([data-theme="light"]) s'appliquent). Bouton de thème ou Réglages, Apparence. */
:root[data-theme="terminal"] {
  --bg: #000000; --bg2: #050505; --panel: #0a0a0a; --panel2: #121212; --panel3: #1a1a1a;
  --line: #262626; --line2: #333333; --ink: #f2f2f2; --ink2: #cfcfcf; --muted: #9a9a9a; --faint: #666666;
  --brand: #ffa028; --brand-ink: #000000; --brand-soft: rgba(255,160,40,.14);
  --accent: #ffa028; --accent-soft: rgba(255,160,40,.14);
  --up: #3ddc84; --down: #ff4d4d; --wait: #9a9a9a; --warn: #ffd23f;
  --up-soft: rgba(61,220,132,.12); --down-soft: rgba(255,77,77,.12); --warn-soft: rgba(255,210,63,.12);
  --shadow: none; --r: 2px; --r-sm: 2px;
  --f-body: "IBM Plex Sans Condensed", "IBM Plex Sans", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="terminal"] body { font-size: 13px; }
:root[data-theme="terminal"] .panel { border: 1px solid var(--line2); box-shadow: none; padding: 10px 12px; }
:root[data-theme="terminal"] .panel h2, :root[data-theme="terminal"] .panel-head h2 { color: var(--brand); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 600; }
:root[data-theme="terminal"] .page-head h1 { color: var(--brand); text-transform: uppercase; letter-spacing: .08em; font-size: 18px; }
:root[data-theme="terminal"] table { font-family: var(--f-mono); font-size: 12px; }
:root[data-theme="terminal"] th { color: var(--brand); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; border-bottom: 1px solid var(--line2); }
:root[data-theme="terminal"] td, :root[data-theme="terminal"] th { padding: 3px 8px; }
:root[data-theme="terminal"] tr:nth-child(even) td { background: #070707; }
:root[data-theme="terminal"] .num, :root[data-theme="terminal"] .kpi .v { font-family: var(--f-mono); }
:root[data-theme="terminal"] .chip { border-radius: 2px; font-family: var(--f-mono); font-size: 11px; }
:root[data-theme="terminal"] .btn { border-radius: 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
:root[data-theme="terminal"] .btn.pri { background: var(--brand); color: #000; border-color: var(--brand); }
:root[data-theme="terminal"] .top { background: #000; border-bottom: 2px solid var(--brand); }
:root[data-theme="terminal"] #search { background: #000; border: 1px solid var(--brand); color: var(--brand); font-family: var(--f-mono); text-transform: uppercase; }
:root[data-theme="terminal"] #search::placeholder { color: rgba(255,160,40,.55); text-transform: none; }
:root[data-theme="terminal"] .side { background: #000; border-right: 1px solid var(--line2); }
:root[data-theme="terminal"] .callout { border-radius: 2px; }

/* 5 novembre : Opportunités en lignes. Une opportunité fermée tient sur une ligne, en colonnes ; tout le détail à l'ouverture */
.opp-legende, .opp-sig:not(.is-open) > .opp-head { display: grid; grid-template-columns: 78px minmax(150px, 1fr) 44px 74px 74px 200px 108px 112px 92px; gap: 8px; align-items: center; }
.opp-legende { font-size: 11px; color: var(--faint); padding: 2px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.opp-sig:not(.is-open) > .opp-head > :not(.opp-key) { display: none; }
.opp-sig:not(.is-open) > .opp-head { padding: 6px 4px; border-radius: 4px; }
.opp-sig:not(.is-open) > .opp-head:hover { background: var(--panel2); color: inherit; }
.opp-sig:not(.is-open) > .callout, .opp-sig:not(.is-open) > .x-why { display: none; }
.opp-sig:not(.is-open) .opp-key.chip { justify-self: start; }
.opp-key.c-sens { order: 1; } .opp-key.c-nom { order: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .opp-key.c-tf { order: 3; } .opp-key.c-note { order: 4; } .opp-key.c-o1 { order: 5; } .opp-key.c-gain { order: 6; } .opp-key.c-entree { order: 7; } .opp-key.c-compte { order: 8; } .opp-key.c-age { order: 9; font-size: 12px; white-space: nowrap; }
.opp-sig.is-open .c-entree, .opp-sig.is-open .c-compte { display: none; }
.opp-mention { font-size: 11px; font-weight: 500; color: var(--warn, var(--brand)); margin-left: 4px; }
.opp-tech { width: 100%; font-size: 12px; } .opp-tech summary { cursor: pointer; }
@media (max-width: 860px) { .opp-legende { display: none; } .opp-sig:not(.is-open) > .opp-head { display: flex; flex-wrap: wrap; } }

/* Carte ouverte : le sens, le marché et les chiffres clés d'abord, les pastilles de détail ensuite */
.opp-sig.is-open .opp-key.c-sens { order: -9; } .opp-sig.is-open .opp-key.c-nom { order: -8; } .opp-sig.is-open .opp-key.c-tf { order: -7; } .opp-sig.is-open .opp-key.c-note { order: -6; } .opp-sig.is-open .opp-key.c-o1 { order: -5; } .opp-sig.is-open .opp-key.c-gain { order: -4; } .opp-sig.is-open .opp-key.c-age { order: -3; }
.opp-sig.is-open > .opp-head { border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.opp-sig.is-open .opp-key.c-nom { font-size: 15px; overflow: visible; }

/* 15 novembre (demande d'Enock) : petit tableau du marché posé sur le graphique (js/views/chart.js, tableauMaj) */
.ch-tab { position: absolute; left: 8px; top: 30px; z-index: 6; width: 268px; max-height: calc(100% - 60px); overflow: auto; background: color-mix(in srgb, var(--panel) 93%, transparent); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 8px 8px; font-size: 11.5px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ch-tab-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.ch-tab-head .btn { padding: 0 6px; min-height: 0; line-height: 18px; }
.ch-tab-sec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 5px; }
.ch-tab-t { font-weight: 600; color: var(--ink2); margin-bottom: 4px; display: flex; justify-content: space-between; }
.ch-tab-tf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ch-tab-tf .tfc { text-align: center; border-radius: 4px; padding: 2px 0; font-weight: 700; line-height: 1.25; font-size: 11px; }
.ch-tab-tf .tfc.up { background: rgba(38,194,129,.22); color: var(--up); }
.ch-tab-tf .tfc.down { background: rgba(255,82,82,.22); color: var(--down); }
.ch-tab-tf .tfc.flat { background: var(--panel3); color: var(--muted); }
.ch-tab-tf .tfc.cur { outline: 1.5px solid var(--brand); }
.ch-tab-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-bottom: 3px; }
.ch-tab-bar span.up { background: var(--up); } .ch-tab-bar span.down { background: var(--down); }
.ch-tab-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.ch-tab-kv > span { color: var(--muted); } .ch-tab-kv > b { text-align: right; font-weight: 600; }
.ch-tab-calc { display: flex; gap: 6px; margin-bottom: 4px; }
.ch-tab-calc label { display: flex; align-items: center; gap: 3px; color: var(--muted); }
.ch-tab-calc .in { width: 58px; padding: 2px 4px; font-size: 11.5px; }
@media (max-width: 700px) { .ch-tab { left: 4px; top: 26px; width: 220px; } }

/* 15 novembre (demande d'Enock) : onglet Graphiques au modèle de TradingView (js/views/terminal.js) */
.tm { display: grid; grid-template-columns: 46px minmax(0, 1fr) 330px; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100vh - 118px); min-height: 600px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tm:fullscreen, .tm.ch-full { height: 100vh; border-radius: 0; }
.tm-top { grid-column: 1 / 4; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.tm-sym { min-width: 120px; font-weight: 700; }
.tm-prix { display: flex; align-items: baseline; gap: 8px; margin-right: 6px; } .tm-prix b { font-size: 17px; } .tm-prix span { font-size: 12px; }
.tm-top .seg button { padding: 3px 8px; font-size: 12px; }
.tm-menu { position: relative; }
.tm-pop { position: absolute; top: 110%; left: 0; z-index: 30; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 12.5px; }
.tm-pop label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tm-tools { grid-row: 2 / 4; grid-column: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-right: 1px solid var(--line); background: var(--panel2); overflow-y: auto; }
.tm-tools button { width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink2); cursor: pointer; }
.tm-tools button:hover { background: var(--panel3); color: var(--ink); }
.tm-tools button.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.tm-sep { width: 24px; height: 1px; background: var(--line2); margin: 5px 0; }
.tm-centre { grid-column: 2; grid-row: 2; position: relative; min-height: 0; }
.tm-chart { position: absolute; inset: 0; }
.tm-cv { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 4; }
.tm-leg { position: absolute; left: 10px; top: 6px; z-index: 5; display: flex; gap: 10px; flex-wrap: wrap; font: 12px var(--f-mono); color: var(--ink2); pointer-events: none; }
.tm-tab { top: 30px; left: 8px; }
.tm-aide { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 6; font-size: 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 3px 10px; pointer-events: none; }
.tm-aide:empty { display: none; }
.ch-tab-tf .tfc small { display: block; font-size: 9px; font-weight: 600; opacity: .85; }
.tm-side { grid-column: 3; grid-row: 2 / 4; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.tm-onglets { margin: 8px; } .tm-onglets button { flex: 1; }
.tm-side-corps { overflow-y: auto; padding: 0 10px 12px; flex: 1; font-size: 12.5px; }
.tm-bs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; margin-bottom: 10px; }
.tm-bs button { border: 0; border-radius: 8px; padding: 10px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font-weight: 700; letter-spacing: .04em; transition: filter .15s, transform .05s; }
.tm-bs button:active { transform: scale(.98); } .tm-bs button:hover { filter: brightness(1.12); }
.tm-bs button b { font-size: 16px; font-weight: 700; } .tm-bs button span { font-size: 11px; }
.tm-sell { background: #d64545; } .tm-buy { background: #1f8f5f; }
.tm-bs button.on { outline: 2px solid #fff; outline-offset: -4px; }
.tm-spr { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; padding: 0 4px; }
.tm-type, .tm-mode { width: 100%; margin-bottom: 6px; } .tm-type button, .tm-mode button { flex: 1; font-size: 12px; padding: 4px 4px; }
.tm-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.tm-champs label:first-child { grid-column: 1 / 3; }
.tm-side .f { font-size: 11.5px; } .tm-side .in { width: 100%; padding: 4px 6px; }
.tm-vite { display: flex; gap: 3px; flex-wrap: wrap; margin: 4px 0 6px; } .tm-vite .btn { padding: 1px 6px; font-size: 11px; }
.tm-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.tm-t { font-weight: 700; color: var(--ink2); margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tm-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 6px 0; } .tm-kv > span { color: var(--muted); } .tm-kv > b { text-align: right; font-weight: 600; }
.tm-go { width: 100%; margin-top: 10px; padding: 9px; font-size: 13px; }
.tm-tbl { width: 100%; border-collapse: collapse; font-size: 12px; } .tm-tbl th, .tm-tbl td { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: left; } .tm-tbl .r { text-align: right; }
.tm-liste tr { cursor: pointer; } .tm-liste tr:hover td { background: var(--panel2); } .tm-liste tr.on td { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tm-bas { grid-column: 2; grid-row: 3; max-height: 150px; overflow: auto; border-top: 1px solid var(--line); padding: 6px 10px; background: var(--panel2); }
@media (max-width: 1000px) {
  .tm { grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto 70vh auto auto; height: auto; }
  .tm-side { grid-column: 1 / 3; grid-row: 4; border-left: 0; border-top: 1px solid var(--line); }
  .tm-tools { grid-row: 2 / 4; } .tm-bas { grid-column: 2; }
}
.tm-pop[hidden] { display: none; }
.tm-param { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); } .tm-param .in { width: 64px; padding: 2px 4px; }
/* 15 novembre : écran Richesse (js/views/richesse.js) */
.ric-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ric-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.ric-kpis > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ric-kpis span { font-size: 11.5px; color: var(--muted); } .ric-kpis b { font-size: 16px; }
.ric-barre { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 10px; }
.ric-principes li { margin: 6px 0; }
.ric-form .row { flex-wrap: nowrap; }

/* 15 novembre (passe d'expérience utilisateur) : onglet Graphiques plus lisible */
.tm-top { gap: 6px; }
.tm-typesel { width: auto; padding: 3px 6px; font-size: 12px; }
.tm-recents { display: flex; gap: 3px; } .tm-recents button { border: 1px solid var(--line2); background: var(--panel); color: var(--ink2); border-radius: 5px; padding: 2px 6px; font: 600 11px var(--f-mono); cursor: pointer; } .tm-recents button:hover { color: var(--ink); border-color: var(--accent); }
.tm-presets { grid-column: 1 / 3; display: flex; align-items: center; gap: 4px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); } .tm-presets span { color: var(--muted); margin-right: 2px; }
.tm-pop-droite { left: auto; right: 0; width: 330px; display: block; } .tm-pop-droite[hidden] { display: none; }
.tm-pop kbd { font: 600 11px var(--f-mono); background: var(--panel3); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.tm-tab { width: 252px; font-size: 11px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(3px); }
.tm-tab .ch-tab-t { display: flex; justify-content: space-between; align-items: baseline; }
.ch-tab-plus { width: 100%; margin-top: 6px; border: 0; background: transparent; color: var(--accent); font-size: 11px; cursor: pointer; text-align: left; padding: 2px 0; }
.ch-tab-kv[hidden] { display: none; }
.tm-go:disabled { opacity: .45; cursor: not-allowed; }
.tm-tools button:focus-visible, .tm-top button:focus-visible, .tm-bs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tm-top { position: relative; z-index: 20; }
.tm-menu > .tm-pop { left: auto; right: 0; }

/* 15 novembre : onglet Graphiques en grand (toute la fenêtre, sans le menu) et en plein écran */
body.tm-grand .side, body.tm-grand .sidebar, body.tm-grand aside.nav, body.tm-grand header.top, body.tm-grand .topbar, body.tm-grand .subnav { display: none !important; }
body.tm-grand .tm { position: fixed; inset: 0; z-index: 900; height: 100vh; min-height: 0; border-radius: 0; border: 0; }
body.tm-grand { overflow: hidden; }
.tm:fullscreen { width: 100vw; height: 100vh; min-height: 0; border: 0; border-radius: 0; }
.tm:fullscreen .tm-side, body.tm-grand .tm-side { width: 330px; }

/* 15 novembre : panneau de droite repliable, boutons d'ordre sur le graphique */
.tm.sans-panneau { grid-template-columns: 46px minmax(0, 1fr) 0; }
.tm.sans-panneau .tm-side { display: none; }
.tm-1clic { position: absolute; top: 28px; right: 72px; z-index: 7; display: flex; align-items: stretch; gap: 0; border-radius: 7px; overflow: hidden; box-shadow: 0 3px 12px rgba(0,0,0,.35); }
.tm-1clic button { border: 0; cursor: pointer; color: #fff; padding: 3px 10px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 86px; }
.tm-1clic button span { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; opacity: .9; } .tm-1clic button b { font: 700 13px var(--f-mono); }
.tm-1clic .tm-1s { background: #d64545; } .tm-1clic .tm-1b { background: #1f8f5f; } .tm-1clic button:hover { filter: brightness(1.15); }
.tm-1clic .in { width: 62px; border-radius: 0; border: 0; text-align: center; font: 600 12px var(--f-mono); padding: 0 4px; background: var(--panel2); }
@media (max-width: 700px) { .tm-1clic { top: auto; bottom: 34px; right: 8px; } }

/* 15 novembre : éclair de la capture du graphique */
.tm-chart.tm-flash::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.18); z-index: 9; pointer-events: none; }
