/* Layout : barre d'onglets fixe (Journal / Sessions / Recherche), contenu en colonne unique 1120px,
   KPI en bandeau, courbe + split session côte à côte, attribution repliable, registre en cartes dépliables.
   Tiroir latéral pour les formulaires, visionneuse plein écran pour les fichiers. Dark-first. */
:root {
  --bg: #0d1117; --panel: #141a23; --panel-2: #1a222e; --line: #243041;
  --fg: #e6ebf2; --muted: #8b97a8; --dim: #5b6778; --accent: #e3a43a;
  --win: #3fbf7f; --loss: #e5534b; --be: #8b97a8;
  --asian: #d46fa8; --london: #e3a43a; --ny: #4f9fe8;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --topbar-h: 56px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f4f1; --panel: #ffffff; --panel-2: #eef0ec; --line: #d9ddd6;
    --fg: #141a23; --muted: #5a6574; --dim: #8a93a0; --accent: #a8680c;
    --win: #1f8a55; --loss: #c2372f; --be: #6b7685; --asian: #a8467e; --london: #a8680c; --ny: #2c6fb3; color-scheme: light;
  }
}
html, body { margin: 0; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
img { max-width: 100%; }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; padding-block: 22px 64px; display: grid; gap: 22px; }
@media (max-width: 560px) { .wrap { padding-inline: 16px; } }
td, .kpi-v, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.pos { color: var(--win); } .neg { color: var(--loss); } .flat { color: var(--be); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Login ---------- */
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 6vw, 52px); line-height: .95; margin: 6px 0 0; text-transform: uppercase; }
.sub { color: var(--muted); margin: 8px 0 0; max-width: 62ch; }
.login-card { max-width: 440px; margin: 10vh auto 0; display: grid; gap: 14px; width: 100%; }
.login-form { display: grid; gap: 12px; margin-top: 8px; }
.msg { font-size: 13px; color: var(--muted); margin: 0; }
.msg.err { color: var(--loss); }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding-inline: 20px; height: var(--topbar-h); display: flex; align-items: center; gap: 18px; }
@media (max-width: 560px) { .topbar-in { padding-inline: 16px; gap: 10px; } }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, transparent 45%, var(--accent) 45% 60%, transparent 60%), var(--panel-2); border: 1px solid var(--line); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; }
@media (max-width: 720px) { .brand-name { display: none; } }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.tab { color: var(--muted); text-decoration: none; font-weight: 500; padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.tab:hover { color: var(--fg); background: var(--panel); }
.tab[aria-current="page"] { color: var(--fg); background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }
.account { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sync { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { #status { display: none; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.live { background: var(--win); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--fg); font-weight: 700; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 42px; width: min(280px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.menu-who { font-family: var(--font-mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pwform { display: grid; gap: 6px; }
.pwform label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }

/* ---------- Commun ---------- */
h2 { font-family: var(--font-display); font-weight: 600; font-size: 21px; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.h2-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hint { font-size: 11.5px; color: var(--dim); font-family: var(--font-mono); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.kpi-l { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.copy { font-size: 13px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.lead { color: var(--muted); margin: 0; max-width: 70ch; }
.list { color: var(--muted); font-size: 13px; padding-left: 18px; margin: 0 0 12px; display: grid; gap: 6px; }
.notice { font-size: 13px; color: var(--muted); border-left: 2px solid var(--accent); padding: 10px 14px; background: var(--panel); border-radius: 0 8px 8px 0; }
.notice b { color: var(--fg); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.tabpane { display: grid; gap: 20px; min-width: 0; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-main { grid-template-columns: 1fr; } }

.btn { font: 600 13px var(--font-body); border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--loss); }
.btn.danger.armed { background: var(--loss); border-color: var(--loss); color: #fff; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); cursor: pointer; font-size: 16px; line-height: 1; }

.chip { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.s-Asian { color: var(--asian); border-color: color-mix(in srgb, var(--asian) 45%, transparent); }
.s-London { color: var(--london); border-color: color-mix(in srgb, var(--london) 45%, transparent); }
.s-NY { color: var(--ny); border-color: color-mix(in srgb, var(--ny) 45%, transparent); }
.chip.st-solide { color: var(--win); border-color: color-mix(in srgb, var(--win) 45%, transparent); }
.chip.st-rejeté { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }

.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
input, select, textarea { font: 14px var(--font-body); color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
textarea.tall { min-height: 160px; font-family: var(--font-mono); font-size: 12px; }

/* ---------- Journal ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: 500 13px var(--font-body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.kpi { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .kpi-l { margin: 0; }
.kpi-v { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.05; margin-top: 6px; }
.kpi-s { font-size: 12px; color: var(--dim); margin-top: 2px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } .kpi:nth-child(3n) { border-right: 0; } .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 480px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .kpi { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); } .kpi:nth-child(2n) { border-right: 0 !important; } .kpi-v { font-size: 28px; } }
.sample-warn { font-size: 13px; color: var(--muted); border-left: 2px solid var(--accent); padding: 8px 12px; background: var(--panel); border-radius: 0 8px 8px 0; margin-top: -8px; }

.chart { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-family: var(--font-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.lbl { white-space: normal; overflow-wrap: anywhere; min-width: 90px; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; white-space: nowrap; }
.bar { height: 4px; border-radius: 2px; background: var(--panel-2); margin-top: 5px; position: relative; overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--win); }
.res { font-family: var(--font-mono); font-weight: 500; }
.discipline { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.discipline div { display: grid; }
.discipline b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.discipline span { font-size: 11.5px; color: var(--dim); }

details.attrib > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
details.attrib > summary::-webkit-details-marker { display: none; }
details.attrib > summary h2::before { content: "▸ "; color: var(--dim); }
details.attrib[open] > summary h2::before { content: "▾ "; }
.attrib-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 22px; margin-top: 16px; }

.ledger { display: grid; gap: 10px; }
details.trade { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
details.trade > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 5px 104px 64px minmax(0,1fr) auto 86px; align-items: center; gap: 14px; padding: 12px 16px 12px 0; }
details.trade > summary::-webkit-details-marker { display: none; }
details.trade[open] > summary { border-bottom: 1px solid var(--line); }
.stripe { align-self: stretch; }
.t-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 1.35; }
.t-main { min-width: 0; }
.t-main b { font-weight: 600; }
.t-lv { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-clip { font-size: 12px; color: var(--dim); font-family: var(--font-mono); white-space: nowrap; }
.t-r { text-align: right; }
.t-r b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1; }
.t-r span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  details.trade > summary { grid-template-columns: 5px minmax(0,1fr) auto; row-gap: 4px; }
  .t-date { grid-column: 2; grid-row: 1; } .t-sess { grid-column: 3; grid-row: 1; justify-self: end; }
  .t-main { grid-column: 2; grid-row: 2; } .t-r { grid-column: 3; grid-row: 2; }
  .t-clip { grid-column: 2; grid-row: 3; } .stripe { grid-row: 1 / 4; }
}
.t-body { padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; }
@media (max-width: 800px) { .t-body { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 6px 16px; margin: 0; font-size: 13px; }
dl.kv dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); padding-top: 2px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.note { font-size: 13px; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; margin-top: 12px; white-space: pre-wrap; }
.note small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.t-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Galerie + fichiers */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery.solo { grid-template-columns: 1fr; }
.thumb { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); cursor: zoom-in; aspect-ratio: 16 / 10; padding: 0; display: block; width: 100%; }
.gallery.solo .thumb { aspect-ratio: auto; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.solo .thumb img { object-fit: contain; height: auto; }
.thumb .cap { position: absolute; left: 6px; bottom: 6px; font: 10.5px var(--font-mono); background: rgba(0,0,0,.65); color: #fff; padding: 1px 6px; border-radius: 4px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb.loading { display: grid; place-items: center; color: var(--dim); font-size: 12px; cursor: default; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--fg); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; max-width: 100%; }
.file:hover { border-color: var(--muted); }
.file .ext { font: 600 10px var(--font-mono); padding: 2px 5px; border-radius: 3px; background: var(--line); color: var(--fg); }
.file .ext.pdf { background: color-mix(in srgb, var(--loss) 30%, transparent); }
.file .ext.html { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.file .ext.xml { background: color-mix(in srgb, var(--ny) 30%, transparent); }
.file .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-link { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.empty-media { border: 1px dashed var(--line); border-radius: 8px; padding: 18px; color: var(--dim); font-size: 13px; text-align: center; }

.empty { border: 1px dashed var(--line); border-radius: 10px; padding: 26px 22px; display: grid; gap: 12px; background: var(--panel); }
.empty h3 { font-family: var(--font-display); font-size: 22px; text-transform: uppercase; margin: 0; }
.empty ol, .empty p { margin: 0; color: var(--muted); }
.empty ol { padding-left: 20px; display: grid; gap: 6px; }
.empty b { color: var(--fg); }

/* ---------- Sessions ---------- */
.plans { display: grid; gap: 12px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 12px; }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.plan-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-title b { font-family: var(--font-display); font-size: 22px; font-weight: 600; text-transform: uppercase; }
.plan-meta { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.plan-thesis { font-size: 13px; color: var(--fg); margin: 0; white-space: pre-wrap; }
.plan-trades { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-trades a { text-decoration: none; }

/* ---------- Recherche ---------- */
.gex-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.gex-row:last-child { border-bottom: 0; }
#gexList { margin-bottom: 12px; }

/* ---------- Tiroir ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; align-content: start; gap: 16px; }
@media (max-width: 560px) { .drawer-panel { padding-inline: 16px; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: -16px; background: var(--bg); padding-block: 4px; z-index: 1; }
.dform { display: grid; gap: 14px; }
.fsec { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.preview { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px 12px; }
@media (max-width: 620px) { .fgrid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.field.w2 { grid-column: span 2; }
.field.w4 { grid-column: 1 / -1; }
.dropzone { display: block; border: 1px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; background: var(--panel); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--fg); }
.dropzone input { display: block; margin: 0 auto 6px; width: auto; max-width: 100%; background: none; border: 0; padding: 0; font-size: 12px; }
.attach-edit { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-edit .file.removed { opacity: .45; text-decoration: line-through; }
.attach-edit .rm { border: 0; background: none; color: var(--loss); cursor: pointer; font-size: 14px; padding: 0 0 0 4px; }
.formfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; position: sticky; bottom: -24px; background: var(--bg); padding-block: 12px; border-top: 1px solid var(--line); }
.btns { display: flex; gap: 8px; }

/* ---------- Visionneuse ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(5,8,12,.94); display: grid; grid-template-rows: auto 1fr; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid #243041; }
.viewer-name { color: #e6ebf2; font-family: var(--font-mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.viewer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.viewer .icon-btn { background: #141a23; color: #e6ebf2; border-color: #243041; }
.viewer .btn { background: #141a23; color: #e6ebf2; border-color: #243041; }
.viewer-body { min-height: 0; display: grid; place-items: center; padding: 12px; overflow: auto; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.viewer-body .vmsg { color: #8b97a8; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Phase 1 : discipline, distribution, labo, backtest ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.kpi-l.sp { margin-top: 18px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.split-cell { padding: 12px 14px; background: var(--panel-2); min-width: 0; }
.split-cell + .split-cell { border-left: 1px solid var(--line); }
.split-v { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cost { font-size: 13px; color: var(--muted); margin-top: 10px; }
.warn-line { margin-top: 8px; }
.warn-line b { color: var(--fg); }
.chip.tag-err { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 40%, transparent); }
.chart.short { height: 160px; }
.streaks { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.streaks div { display: grid; min-width: 0; }
.streaks b { font-family: var(--font-display); font-size: 21px; font-weight: 600; white-space: nowrap; }
.streaks span { font-size: 11.5px; color: var(--dim); }
.lab-grid > div { min-width: 0; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 860px) { .lab-grid { grid-template-columns: minmax(0, 1fr); } }
#scatter { height: 240px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg.win { background: var(--win); } .lg.loss { background: var(--loss); } .lg.be { background: var(--be); }
tr.hl td { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.small-copy { font-size: 12px; margin-top: 10px; line-height: 1.5; }
.small-copy b { color: var(--fg); font-weight: 600; }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagopt { display: inline-flex; cursor: pointer; }
.tagopt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tagopt span { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); background: var(--panel); }
.tagopt input:checked + span { color: var(--loss); border-color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, transparent); }
.tagopt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fsep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.chip.k-paper { color: var(--ny); border-color: color-mix(in srgb, var(--ny) 45%, transparent); }

.chip.k-replay { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 13px; }
.icon-btn.danger { color: var(--loss); }
.icon-btn.danger.armed { background: var(--loss); color: #fff; border-color: var(--loss); }
.bt-table td { vertical-align: middle; }
.bt-table td.r:last-child { white-space: nowrap; }
@media (max-width: 480px) { .streaks { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split-v { font-size: 26px; } }

/* ============================================================
   DESK — dossier interne d'un desk de trading.
   Encre marine, filets fins, chiffres mono tabulaires, titres de page en serif.
   Un seul élément fort : la frise des fenêtres de session (desk.js).
   ============================================================ */
:root {
  --bg: #0a0f1a; --panel: #0f1626; --panel-2: #141d31; --line: #1e2940; --line-2: #2c3a57;
  --fg: #e7ecf5; --muted: #8c97ad; --dim: #5d6880;
  --accent: #8fa4ff; --accent-bg: #18223d;
  --win: #3dd68c; --loss: #ff6363; --be: #8c97ad;
  --asian: #e27fbf; --london: #f2b450; --ny: #5fb0ff;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-display: "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --topbar-h: 54px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6fa; --panel: #fff; --panel-2: #eef1f7; --line: #dde2ec; --line-2: #c3cbdb;
    --fg: #0d1526; --muted: #566179; --dim: #8a93a8; --accent: #3549c9; --accent-bg: #e8ecfd;
    --win: #11804f; --loss: #c42d2d; --be: #6b7487; --asian: #a8467e; --london: #a8680c; --ny: #2463a8;
  }
}
body { background: var(--bg); font-size: 14px; line-height: 1.55; }
.wrap { gap: 20px; }
td, .kpi-v, .split-v, .t-r b, .res, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Barre du haut */
.topbar { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--line); }
.brand { gap: 10px; }
.brand-mark { width: 18px; height: 18px; border-radius: 3px; border: 0; box-shadow: none;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 4px 45% no-repeat,
              linear-gradient(var(--accent), var(--accent)) center bottom / 4px 75% no-repeat,
              linear-gradient(var(--accent), var(--accent)) right bottom / 4px 100% no-repeat; opacity: .9; }
.brand-name { font: 600 16px var(--font-serif); letter-spacing: 0; text-transform: none; }
.brand-sub { font-size: 12px; color: var(--dim); padding-left: 10px; border-left: 1px solid var(--line-2); }
@media (max-width: 720px) { .brand-sub { display: none; } }
.tabs { gap: 2px; }
.tab { font: 500 13.5px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--muted); border: 0; border-radius: 0; padding: 16px 12px 15px; background: none; box-shadow: none; }
.tab::before { content: none; }
.tab:hover { color: var(--fg); background: none; }
.tab[aria-current="page"], .tab.active { color: var(--fg); background: none; border: 0; box-shadow: inset 0 -2px 0 var(--accent); }
.sync { font-size: 11.5px; }
.menu > summary, .icon-btn { border-radius: 4px; }
.menu-pop { border-radius: 6px; }

/* Bandeau marché : horloges + frise */
.ribbon { border-bottom: 1px solid var(--line); background: var(--panel); }
.ribbon-in { max-width: 1120px; margin: 0 auto; padding: 10px 20px 8px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.clocks { display: flex; gap: 16px; }
.clk { display: grid; line-height: 1.2; }
.clk-l { font-size: 11px; color: var(--dim); }
.clk-t { font: 500 15px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.clk.home .clk-t { color: var(--fg); }
.track-wrap { min-width: 0; }
.track { position: relative; height: 18px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / 24)); border: 1px solid var(--line); border-radius: 2px; }
.seg { position: absolute; top: 2px; bottom: 2px; border-radius: 1px; background: color-mix(in srgb, currentColor 22%, transparent); border-left: 2px solid currentColor; overflow: hidden; }
.seg.s-Asian { color: var(--asian); } .seg.s-London { color: var(--london); } .seg.s-NY { color: var(--ny); }
.seg em { font: 500 10px var(--font-body); font-style: normal; position: absolute; left: 4px; top: 1px; color: var(--fg); opacity: .85; white-space: nowrap; }
.seg.live { background: color-mix(in srgb, currentColor 45%, transparent); }
.now { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--fg); box-shadow: 0 0 0 3px var(--panel); }
.ticks { position: relative; height: 14px; margin-top: 2px; }
.tick { position: absolute; transform: translateX(-50%); font: 10px var(--font-mono); color: var(--dim); }
.tick:first-child { transform: none; } .tick:last-child { transform: translateX(-100%); }
.ribbon.closed .seg { color: var(--dim); }
.sess-state { display: grid; line-height: 1.3; text-align: right; }
.sess-state b { font-weight: 600; font-size: 13px; }
.sess-state > span { font-size: 12px; color: var(--muted); }
.c-Asian { color: var(--asian); } .c-London { color: var(--london); } .c-NY { color: var(--ny); }
@media (max-width: 900px) {
  .ribbon-in { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .track-wrap { grid-column: 1 / -1; grid-row: 2; }
  .clk:nth-child(n+3) { display: none; }
}
@media (max-width: 560px) { .ribbon-in { padding-inline: 16px; } .seg em { display: none; } }

/* En-tête de page : titre serif + objet de la page */
.page-head { padding: 10px 0 2px; }
.ph-title { font: 600 clamp(28px, 4vw, 38px)/1.1 var(--font-serif); letter-spacing: -.01em; text-transform: none; margin: 0; }
.ph-sub { color: var(--muted); margin: 6px 0 0; max-width: 68ch; font-size: 14.5px; }
h1 { font-family: var(--font-serif); text-transform: none; letter-spacing: -.01em; }
.eyebrow { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 13px; }

/* Titres de section et libellés : casse normale */
h2 { font: 600 15px var(--font-body); letter-spacing: 0; text-transform: none; }
.hint { font: 12px var(--font-body); color: var(--dim); }
.kpi-l, .field label, dl.kv dt, .note small, .pwform label { font-family: var(--font-body); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.fsec { font: 600 13px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--fg); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
th { font: 500 10.5px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid var(--line-2); }
td { font-size: 13px; }
td.lbl { font-family: var(--font-body); }

/* Sections : filet haut, fond discret, pas de "carte" */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px 18px; }
.h2-row { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
details.attrib > summary { padding-bottom: 0; }
details.attrib[open] > summary { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
details.attrib > summary h2::before { color: var(--dim); }
details.trade, .plan, .empty { border-radius: 4px; background: var(--panel); }
.notice, .sample-warn { background: transparent; border: 0; border-left: 2px solid var(--accent); border-radius: 0; padding: 4px 0 4px 12px; font-size: 13px; color: var(--muted); }
.sample-warn:empty { display: none; }

/* Bandeau KPI façon tear sheet : une ligne réglée, chiffres alignés */
.kpis { gap: 0; border: 0; border-top: 2px solid var(--fg); border-bottom: 1px solid var(--line-2); border-radius: 0; background: transparent; overflow: visible; }
.kpi, .kpi:last-child { border: 0 !important; border-right: 1px solid var(--line) !important; background: transparent; padding: 12px 16px 14px; }
.kpi:first-child { padding-left: 0; }
.kpi:last-child { border-right: 0 !important; }
.kpi .kpi-l { color: var(--muted); }
.kpi-v { font-weight: 500; font-size: 28px; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; color: var(--fg); }
.kpi-v.pos { color: var(--win); } .kpi-v.neg { color: var(--loss); }
.kpi-s { font-size: 12px; color: var(--dim); }
@media (max-width: 900px) { .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line) !important; } .kpi:nth-child(3n) { border-right: 0 !important; } .kpi:nth-child(3n+1) { padding-left: 0; } }
@media (max-width: 480px) { .kpis .kpi:nth-child(n) { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; padding-left: 0; } .kpis .kpi:nth-child(odd) { border-right: 1px solid var(--line) !important; } .kpis .kpi:nth-child(even) { padding-left: 14px; } .kpi-v { font-size: 22px; } }

.split { gap: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.split-cell { background: var(--panel-2); border: 0; }
.split-cell + .split-cell { border-left: 1px solid var(--line); }
.split-v { font-weight: 500; font-size: 24px; letter-spacing: -.02em; }
.discipline b, .streaks b { font: 500 18px var(--font-mono); letter-spacing: -.01em; }
.t-r b { font-weight: 500; font-size: 19px; letter-spacing: -.02em; }
.plan-title b, .empty h3 { font: 600 17px var(--font-serif); letter-spacing: 0; text-transform: none; }

/* Boutons et filtres */
.btn { font: 500 13px var(--font-body); letter-spacing: 0; text-transform: none; border-radius: 4px; padding: 7px 13px; background: var(--panel); }
.btn:hover { border-color: var(--line-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0f1a; box-shadow: none; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.small { font-size: 12.5px; padding: 5px 10px; }
.filters { gap: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.filters button { font: 500 13px var(--font-body); letter-spacing: 0; text-transform: none; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 6px 14px; }
.filters button:last-child { border-right: 0; }
.filters button[aria-pressed="true"] { color: var(--fg); background: var(--accent-bg); box-shadow: inset 0 -2px 0 var(--accent); }
.fsep { margin: 0; background: var(--line-2); width: 2px; }
.tabpane > .toolbar:first-child, .tabpane > .page-head + .toolbar { border: 0; padding: 0; background: none; }
.tabpane > .toolbar:first-child::before { content: none; }
.chip { font-family: var(--font-body); font-size: 11.5px; letter-spacing: 0; text-transform: none; border-radius: 3px; }
.tagopt span { border-radius: 3px; font-size: 12.5px; }
.tagopt input:checked + span { border-radius: 3px; }

/* Graphiques et tableaux */
.chart text { font: 10px var(--font-mono); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
tr.hl td { background: var(--accent-bg); }
.bar { border-radius: 0; height: 3px; background: var(--line); }
.bar i { background: var(--accent); }
.note { border-radius: 4px; border-left: 2px solid var(--line-2); }
input, select, textarea { font: 14px var(--font-body); border-radius: 4px; background: var(--panel-2); }
input[type="number"], input[type="time"], input[type="date"] { font-family: var(--font-mono); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.thumb, .file, .dropzone, .empty-media { border-radius: 4px; }
.file .ext, .thumb .cap { border-radius: 2px; }
.drawer-panel, .drawer-head, .formfoot { background: var(--bg); }
details.trade > summary { padding-block: 11px; }
details.trade:hover { border-color: var(--line-2); }
.t-date, .t-clip { font-size: 11.5px; }

/* Pied de page méthodologie */
.desk-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 12px; display: grid; gap: 4px; }
.desk-foot p { margin: 0; font-size: 12px; color: var(--dim); max-width: 90ch; }

/* Connexion */
.login-card h1 { font-size: clamp(34px, 6vw, 46px); }

/* ============================================================
   PRO — desk institutionnel animé.
   Fond à halos, verre dépoli, lueur au curseur, courbes qui se dessinent,
   compteurs animés (fx.js), heatmaps et simulateur (analyse.js).
   ============================================================ */
:root { --accent-2: #5ce1e6; --glass: color-mix(in srgb, var(--panel) 78%, transparent); --ease: cubic-bezier(.2,.8,.2,1); }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); }
#app, .login { position: relative; z-index: 1; }

/* Barre du haut : verre + filet dégradé */
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(140%); border-bottom: 0; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .7; }
.brand-mark { animation: pulse-mark 3.2s ease-in-out infinite; }
@keyframes pulse-mark { 50% { filter: drop-shadow(0 0 6px var(--accent)); } }
.tab { position: relative; transition: color .2s; }
.tab[aria-current="page"] { box-shadow: none; }
.tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transition: transform .35s var(--ease); }
.tab[aria-current="page"]::after, .tab:hover::after { transform: scaleX(1); }
.tab:hover::after { opacity: .45; } .tab[aria-current="page"]::after { opacity: 1; }
.dot.live { animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--win) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.ribbon { background: var(--glass); backdrop-filter: blur(10px); }
.now { animation: now-blink 1.6s ease-in-out infinite; }
@keyframes now-blink { 50% { box-shadow: 0 0 0 3px var(--panel), 0 0 10px 2px var(--fg); } }
.seg.live { animation: seg-live 2.4s ease-in-out infinite; }
@keyframes seg-live { 50% { background: color-mix(in srgb, currentColor 65%, transparent); } }

/* Titres */
.ph-title { background: linear-gradient(100deg, var(--fg) 30%, color-mix(in srgb, var(--accent) 70%, var(--fg))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Panneaux : verre, lueur au curseur, apparition */
.panel, details.trade, .plan { position: relative; background: var(--glass); backdrop-filter: blur(8px); border-color: var(--line); border-radius: 10px;
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s; }
.panel::before, details.trade::before, .plan::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%); }
.panel:hover::before, details.trade:hover::before, .plan:hover::before { opacity: 1; }
.panel:hover, .plan:hover { border-color: var(--line-2); box-shadow: 0 10px 40px -18px color-mix(in srgb, var(--accent) 45%, transparent); }
.fx { opacity: 0; transform: translateY(14px); }
.fx.in { opacity: 1; transform: none; transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms), border-color .25s, box-shadow .25s; }
details.trade > summary { transition: background .2s; }
details.trade > summary:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
details.trade[open] { border-color: var(--line-2); }
details.trade[open] .t-body { animation: unfold .35s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }

/* KPI tear sheet */
.kpi { position: relative; transition: background .25s; }
.kpi:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.kpi-v.pos { text-shadow: 0 0 24px color-mix(in srgb, var(--win) 45%, transparent); }
.kpi-v.neg { text-shadow: 0 0 24px color-mix(in srgb, var(--loss) 45%, transparent); }
.kpis { position: relative; }
.kpis::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent); }

/* Bandeau de performance */
.perf-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.perf-strip:empty { display: none; }
.ps-cell { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--glass); backdrop-filter: blur(8px); min-width: 0; position: relative; overflow: hidden; }
.ps-cell::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--accent), var(--accent-2)); }
.ps-l { font-size: 11.5px; color: var(--muted); }
.ps-v { font: 500 22px var(--font-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-s { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .perf-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .perf-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ps-v { font-size: 19px; } }

/* Graphiques : tracé animé, points qui apparaissent */
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) forwards; }
.chart .glow { filter: drop-shadow(0 0 5px var(--accent)); }
.chart .area { opacity: 0; animation: fade .9s ease .5s forwards; }
.chart .pt { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .4s var(--ease) forwards; animation-delay: calc(300ms + var(--i) * 35ms); }
.chart .pt.last { animation: pop .4s var(--ease) forwards, beat 1.8s ease-in-out 1.6s infinite; }
.chart rect { transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.chart [data-tip] { cursor: crosshair; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes beat { 50% { transform: scale(1.6); } }
@keyframes grow { from { transform: scaleY(0); } }

/* Info-bulle */
.fx-tip { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; white-space: pre-line; max-width: 280px;
  font: 12px/1.45 var(--font-mono); color: var(--fg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; box-shadow: 0 12px 32px -10px rgba(0,0,0,.6); }

/* Boutons */
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; transition: transform .15s, box-shadow .25s; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px var(--accent); filter: none; }
.btn { transition: border-color .2s, background .2s, transform .15s; }
.btn:active { transform: scale(.97); }
.filters button { transition: background .2s, color .2s; }
.drawer:not([hidden]) .drawer-panel { animation: slide-in .35s var(--ease); }
.drawer:not([hidden]) .drawer-bg { backdrop-filter: blur(3px); animation: fade-in .3s ease; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
.viewer:not([hidden]) { animation: fade-in .25s ease; }

/* ---------- Analyse ---------- */
.chip.lown { color: var(--london); border-color: color-mix(in srgb, var(--london) 45%, transparent); font-size: 10.5px; padding: 0 5px; vertical-align: 1px; }
.hm { display: grid; gap: 4px; }
.hm-h { font: 11px var(--font-mono); color: var(--dim); text-align: center; padding-bottom: 2px; }
.hm-r { font-size: 12.5px; display: flex; align-items: center; }
.hm-c { display: grid; place-items: center; align-content: center; min-height: 52px; border-radius: 6px; cursor: crosshair;
  background: color-mix(in srgb, var(--c) calc(var(--a) * 100%), transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  transition: transform .2s var(--ease), box-shadow .2s; animation: pop .5s var(--ease) both; }
.hm-c:hover { transform: scale(1.06); box-shadow: 0 0 18px -2px var(--c); z-index: 1; }
.hm-c b { font: 500 12.5px var(--font-mono); color: var(--fg); }
.hm-c i { font: 10px var(--font-mono); font-style: normal; color: color-mix(in srgb, var(--fg) 70%, transparent); }
.hm-c.empty { background: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 6px); border: 1px solid var(--line); animation: none; cursor: default; }
@media (max-width: 480px) { .hm { gap: 3px; } .hm-c { min-height: 44px; } .hm-c b { font-size: 10.5px; } .hm-c i { display: none; } }
.dimpick { display: flex; align-items: center; gap: 8px; }
.dimpick select { width: auto; padding: 5px 8px; font-size: 13px; }
table.edge tbody tr { animation: fade-up .45s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.ebar { position: relative; height: 22px; min-width: 140px; border-radius: 4px; background: linear-gradient(90deg, transparent calc(50% - .5px), var(--line-2) calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)), var(--panel-2); cursor: crosshair; }
.ebar i { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; animation: bar-in .8s var(--ease) both; }
.ebar i.up { left: 50%; background: linear-gradient(90deg, color-mix(in srgb, var(--win) 40%, transparent), var(--win)); transform-origin: left; }
.ebar i.dn { right: 50%; background: linear-gradient(270deg, color-mix(in srgb, var(--loss) 40%, transparent), var(--loss)); transform-origin: right; }
.ebar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; text-shadow: 0 1px 2px var(--bg); }
@keyframes bar-in { from { transform: scaleX(0); } }
.sim-ctrl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-bottom: 14px; }
.sim-ctrl label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sim-ctrl b { color: var(--fg); font-family: var(--font-mono); font-weight: 500; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; padding: 0; border: 0; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); cursor: grab; }
.sim-out { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.sim-k { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); min-width: 0; }
.sim-k span { font-size: 11.5px; color: var(--muted); }
.sim-k b { font: 500 16px var(--font-mono); letter-spacing: -.02em; overflow-wrap: anywhere; }
.sim-k em { font-style: normal; font-size: 11px; color: var(--dim); }
#simChart { height: 180px; }
.lg.dash { background: none; border-top: 2px dashed var(--muted); border-radius: 0; height: 0; width: 14px; }
.lg.acc { background: var(--accent); }
@media (max-width: 620px) { .sim-ctrl, .sim-out { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .fx { opacity: 1; transform: none; }
  .chart .draw { stroke-dashoffset: 0; } .chart .area, .chart .pt { opacity: 1; }
}
