/* N3V Journal — direction artistique sobre et élégante : noirs profonds, bordures fines, accent cacao.
   Un seul thème sombre, quel que soit le réglage de l'appareil. */
:root {
  color-scheme: dark;
  --bg:          #050505;   /* fond de page */
  --side:        #0a0a0a;   /* barre latérale */
  --card:        #0d0d0d;   /* cartes */
  --inner:       #060606;   /* blocs dans les cartes */
  --raise:       #151515;   /* survol */
  --line:        #1c1c1c;   /* bordures */
  --line-soft:   #141414;
  --text:        #f3f1ee;
  --text-2:      #a6a29c;
  --muted:       #6e6a65;
  --accent:      #8b6b57;   /* cacao */
  --accent-hi:   #a88470;
  --accent-soft: rgba(139, 107, 87, 0.14);
  --accent-ink:  #f6efe8;
  --good:        #8fb07c;   /* sauge */
  --good-soft:   rgba(143, 176, 124, 0.12);
  --bad:         #d9776a;   /* brique */
  --bad-soft:    rgba(217, 119, 106, 0.12);
  --warn:        #d6ad62;
  --radius:      14px;

  /* noms utilisés par le reste du code */
  --surface-page: var(--bg); --surface-card: var(--card); --surface-card-2: var(--raise); --surface-sunk: var(--inner);
  --text-primary: var(--text); --text-secondary: var(--text-2); --text-muted: var(--muted);
  --gridline: var(--line-soft); --border: var(--line);
  --critical: var(--bad); --warning: var(--warn); --accent-fill: var(--accent-soft);
  --chart-line: var(--accent-hi); --chart-fill-top: rgba(139, 107, 87, 0.28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45;
  font-feature-settings: "tnum" 1; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; margin: 20px 0 12px; color: var(--text); }
.mono, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.meta-row { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Mise en page ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--line-soft);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
}
.main { padding: 0 32px 60px; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft); margin-bottom: 26px;
}
.hello { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.topbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.topbar-right select { width: auto; min-width: 220px; }
.page-title { font-size: 26px; margin-bottom: 18px; }
#dashboard { display: flex; flex-direction: column; gap: 22px; }
.section { display: flex; flex-direction: column; gap: 22px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 22px; }
.split-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; align-items: start; }

/* ---------- Logo ---------- */
.lockup { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; flex: none; }
.logo { width: 100%; height: 100%; display: block; }
.logo-bg { fill: var(--accent); }
.candle line { stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; }
.candle rect { fill: var(--accent-ink); }
.candle { transform-box: fill-box; transform-origin: 50% 100%; }
.wordmark { display: flex; align-items: baseline; gap: 6px; font-size: 20px; letter-spacing: -0.03em; line-height: 1; }
.wordmark b { font-weight: 700; }
.wordmark span { font-weight: 400; color: var(--text-2); }
.lockup-lg { padding: 0 0 6px; }
.lockup-lg .brand-mark { width: 44px; height: 44px; border-radius: 12px; }
.lockup-lg .wordmark { font-size: 26px; }

/* ---------- Interrupteur Prop firm / Backtest ---------- */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--inner); border: 1px solid var(--line); border-radius: 11px; }
.mode-btn { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 6px; border-radius: 8px; border: none; background: none; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--raise); color: var(--text); box-shadow: inset 0 0 0 1px #262626; }
.mode-btn.active[data-mode="backtest"] { background: var(--accent-soft); color: var(--accent-hi); box-shadow: inset 0 0 0 1px rgba(139,107,87,.45); }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 6px 11px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-hi); border: 1px solid rgba(139,107,87,.45); }
.mode-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-hi); }

/* Boutons « + » bien visibles pour ajouter un compte */
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.add-btn {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  padding: 16px 18px; border-radius: 12px; border: 1.5px dashed rgba(139,107,87,.6); background: var(--accent-soft);
  transition: background .15s, border-color .15s, transform .12s;
}
.add-btn:hover { border-color: var(--accent-hi); background: rgba(139,107,87,.22); transform: translateY(-1px); }
.add-btn.on { border-style: solid; border-color: var(--accent-hi); }
.add-plus { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 22px; font-weight: 500; line-height: 1; }
.add-btn strong { display: block; font-size: 14px; font-weight: 600; }
.add-btn small { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.acc-group { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 18px 0 2px; }
.acc-card.add-card { border: 1.5px dashed rgba(139,107,87,.55); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 140px; color: var(--accent-hi); font-weight: 600; }
.acc-card.add-card .add-plus { width: 40px; height: 40px; }
#account-form { margin-top: 8px; padding-top: 4px; border-top: 1px solid var(--line-soft); }

/* ---------- Navigation ---------- */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 10px; border: none; background: none; cursor: pointer;
  color: var(--text-2); font: inherit; font-size: 14.5px; font-weight: 500; text-decoration: none; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--raise); color: var(--text); }
.nav-item.active { color: var(--text); background: linear-gradient(90deg, var(--accent-soft), transparent 85%); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-sep { height: 1px; background: var(--line-soft); margin: 18px 4px; }
.btn.block { width: 100%; justify-content: center; margin-top: 18px; padding: 12px 16px; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 9px 15px; border-radius: 10px; transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: var(--raise); border-color: #262626; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--raise); color: var(--text); }
.btn.small { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn .ico { width: 16px; height: 16px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
}
.icon-btn:hover { background: var(--raise); color: var(--text); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--inner);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }
label.check input { width: auto; accent-color: var(--accent); }
label.strong { color: var(--text); }
.err { color: var(--bad); font-size: 13px; margin: 10px 0 0; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.card > h2 { margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-tools input { width: 260px; max-width: 100%; }
.empty { text-align: center; padding: 48px 20px; }
.empty h2 { margin-bottom: 10px; }
.empty p { color: var(--text-2); max-width: 460px; margin: 0 auto 20px; }

/* Pastilles */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  padding: 4px 10px; border-radius: 7px; background: var(--raise); color: var(--text-2);
}
.pill.running { background: var(--accent-soft); color: var(--accent-hi); }
.pill.passed { background: var(--good-soft); color: var(--good); }
.pill.breached { background: var(--bad-soft); color: var(--bad); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 6px; }
.delta.pos { background: var(--good-soft); }
.delta.neg { background: var(--bad-soft); }
.delta.zero { background: var(--raise); color: var(--text-2); }

/* ---------- Indicateurs du haut ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.kpi-label .ico { width: 15px; height: 15px; color: var(--muted); }
.kpi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-val { font-size: 27px; font-weight: 500; letter-spacing: -0.03em; }

/* ---------- Détails / Aujourd'hui ---------- */
.rows { display: flex; flex-direction: column; }
.rows .r { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; font-size: 13.5px; }
.rows .r:nth-child(odd) { background: var(--inner); }
.rows .r span:first-child { color: var(--text-2); }
.rows .r strong { font-weight: 500; }
.rows .r.link { cursor: pointer; }
.rows .r.link:hover { background: var(--raise); }
.today { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.today .box { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px; text-align: center; }
.today .box.wide { grid-column: span 2; }
.today .box span { display: block; font-size: 12.5px; color: var(--text-2); }
.today .box strong { display: block; font-size: 26px; font-weight: 500; margin-top: 6px; letter-spacing: -0.02em; }

/* ---------- Objectifs ---------- */
.obj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.obj { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px; }
.obj-title { font-size: 14.5px; font-weight: 500; margin-bottom: 16px; }
.obj-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin: 8px 0 14px; }
.obj-meta strong { color: var(--text); font-weight: 600; }
.obj .rows .r { padding: 7px 0; background: none; }
.bar { height: 7px; border-radius: 999px; background: #1e1e1e; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transform-origin: left center; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.good > span { background: var(--good); }
.bar.warning > span { background: var(--warn); }
.bar.critical > span { background: var(--bad); }
.bar-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.alert-line { display: flex; align-items: center; gap: 10px; background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px; }

/* Cartes de compte (vue « tous les comptes ») */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.acc-card {
  position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px;
  transition: border-color .2s, transform .18s cubic-bezier(.2,.8,.2,1);
}
.acc-card:hover { border-color: #2a2a2a; transform: translateY(-2px); }
.acc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.acc-name { font-weight: 500; font-size: 15px; }
.acc-firm { font-size: 12px; color: var(--muted); margin-top: 3px; }
.acc-bal { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; }
.acc-change { font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.acc-progress { margin-top: 14px; }

/* Retraits */
.payout-box { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; align-items: end; background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px; }
.payout-box .big { font-size: 21px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; }
.payout-list { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.payout-list .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.field-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }

/* ---------- Tuiles de statistiques ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; align-items: center; gap: 16px; background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px; min-width: 0; }
.tile .ico { width: 30px; height: 30px; stroke-width: 1.3; color: var(--accent-hi); }
.tile-val { font-size: 21px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-label { font-size: 13px; color: var(--text-2); margin-top: 1px; }

/* ---------- Analyse en barres ---------- */
.bars-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.bars-panel { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 18px 20px; }
.bars-panel h4 { margin: 0 0 12px; font-size: 14px; font-weight: 500; }
.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.hbar:first-of-type { border-top: none; }
.hbar .lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 4px; border-radius: 4px; background: #1a1a1a; position: relative; overflow: hidden; }
.hbar .track span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; background: var(--good); transform-origin: left center; }
.hbar .track span.neg { background: var(--bad); }
.hbar .val { text-align: right; white-space: nowrap; font-weight: 500; }
.hbar .val small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.chips-line { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.mini { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 14px; font-size: 12px; color: var(--text-2); }
.mini strong { display: block; color: var(--text); font-size: 16px; font-weight: 500; margin-top: 2px; }

/* Erreurs */
.review-grid { display: flex; flex-direction: column; gap: 16px; }
.review-stat { font-size: 22px; font-weight: 500; }
.review-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mistake-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 9px 0; border-top: 1px solid var(--line-soft); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
thead th { background: var(--inner); }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text); padding: 13px 14px; white-space: nowrap; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
tbody tr:nth-child(even) td { background: #090909; }
td.num, th.num { text-align: right; }
td.notes { white-space: normal; min-width: 160px; max-width: 300px; color: var(--text-2); font-size: 12.5px; }
td.actions { text-align: right; }
tr:last-child td { border-bottom: none; }
.side-buy, .side-sell { font-weight: 600; font-size: 12px; }
.side-buy { color: var(--good); }
.side-sell { color: var(--bad); }
.table-empty { color: var(--muted); text-align: center; padding: 30px; }
.thumb { width: 60px; height: 38px; border-radius: 7px; object-fit: cover; display: block; background: var(--raise); border: 1px solid var(--line); }
.thumb.none { display: grid; place-items: center; color: var(--muted); }
#trades tbody tr { cursor: pointer; }
#trades tbody tr:hover td { background: var(--raise); }
.r-pill { font-size: 12px; font-weight: 600; white-space: nowrap; }
.r-pill.tp { color: var(--good); }
.r-pill.sl { color: var(--bad); }
.r-pill.be { color: var(--text-2); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-hi); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; border: none; font: inherit; }

/* ---------- Calendrier ---------- */
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-title { font-size: 17px; font-weight: 500; min-width: 150px; text-align: center; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)) minmax(110px, 1fr); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; min-width: 760px; }
.cal-dow { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; background: var(--inner); border-bottom: 1px solid var(--line-soft); }
.cal-dow.week { text-align: center; }
.cal-cell { min-height: 86px; padding: 10px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #080808; display: flex; flex-direction: column; justify-content: space-between; }
.cal-cell.out { background: #060606; color: #3a3a3a; }
.cal-cell.has { cursor: pointer; }
.cal-cell.pos { background: linear-gradient(180deg, rgba(143,176,124,.05), rgba(143,176,124,.13)); }
.cal-cell.neg { background: linear-gradient(180deg, rgba(217,119,106,.05), rgba(217,119,106,.14)); }
.cal-cell.has:hover { filter: brightness(1.25); }
.cal-day { font-size: 12.5px; font-weight: 600; }
.cal-cell.today .cal-day { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--text); color: var(--bg); }
.cal-val { font-size: 13px; font-weight: 600; }
.cal-n { font-size: 11px; color: var(--text-2); }
.cal-week { border-bottom: 1px solid var(--line-soft); background: var(--inner); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11.5px; text-align: center; gap: 2px; }
.cal-week b { font-size: 13px; }

/* ---------- Courbe ---------- */
.equity-svg { width: 100%; height: 260px; display: block; }
.equity-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.equity-caption strong { color: var(--text); font-weight: 500; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.legend span { color: var(--text-2); }

/* ---------- Fenêtres ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--text);
  padding: 26px; width: min(660px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
dialog h2 { font-size: 21px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid .span2 { grid-column: span 2; }
.span4 { grid-column: 1 / -1; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.acc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.acc-row .info { font-size: 14px; }
.acc-row .info small { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
#account-list { margin-top: 14px; }

/* Fiche trade */
dialog.wide { width: min(960px, calc(100vw - 24px)); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
.spacer { flex: 1; }
.res-out { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.res-out:empty { display: none; }
.slots { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.slot { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.slot-title { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 16px; margin-bottom: 12px; }
.slot-num { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-hi); display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; }
.slot-box {
  position: relative; height: 180px; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1.5px dashed #2a2a2a; background: var(--inner);
  display: grid; place-items: center; text-align: center; color: var(--text-2); font-size: 13px; line-height: 1.55;
  transition: border-color .15s, background .15s;
}
.slot-box:hover { border-color: var(--accent); }
.slot-box .ph-icon { width: 38px; height: 38px; border-radius: 10px; margin: 0 auto 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-size: 20px; }
.slot.active .slot-box { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 3px var(--accent-soft); }
.slot.drag .slot-box { border-color: var(--accent); background: var(--accent-soft); }
.slot-box.filled { height: auto; border-style: solid; border-color: var(--line); background: #000; cursor: zoom-in; }
.slot.active .slot-box.filled { border-color: var(--accent); }
.slot-box img { width: 100%; max-height: 520px; object-fit: contain; display: block; }
.slot-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.slot-tools button { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(0,0,0,.75); color: #fff; font: inherit; font-size: 12px; font-weight: 500; padding: 6px 11px; cursor: pointer; }
.slot-badge { position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 500; background: rgba(0,0,0,.75); color: #fff; padding: 3px 9px; border-radius: 6px; }
.trade-extra { margin-top: 22px; grid-template-columns: 1fr 1.4fr; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); background: var(--inner); color: var(--text-2); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.chip.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.wl-badge { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; vertical-align: middle; }
.wl-badge.tp { background: var(--good-soft); color: var(--good); }
.wl-badge.sl { background: var(--bad-soft); color: var(--bad); }
.wl-badge.be { background: var(--raise); color: var(--text-2); }
label:has(> .wl-badge) { display: block; }
label:has(> .wl-badge) input { margin-top: 6px; }
#lightbox { padding: 0; width: auto; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); background: #000; border: none; border-radius: 12px; cursor: zoom-out; }
#lightbox img { display: block; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 32px 30px; display: flex; flex-direction: column; gap: 16px; }
.login-card .muted { margin: -6px 0 4px; font-size: 14px; }

/* ---------- Animations ---------- */
@keyframes rise   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); opacity: 0; } 60% { opacity: 1; } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pop    { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade   { from { opacity: 0; } }
@keyframes badge-pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

.first-load .candle, .login .candle { animation: grow-y .6s cubic-bezier(.2,.8,.2,1) both; }
.first-load .c2, .login .c2 { animation-delay: .12s; }
.first-load .c3, .login .c3 { animation-delay: .24s; }
.first-load .sidebar .nav-item { animation: rise .45s ease both; }
.first-load .sidebar .nav-item:nth-child(2) { animation-delay: .04s; }
.first-load .sidebar .nav-item:nth-child(3) { animation-delay: .08s; }
.first-load .sidebar .nav-item:nth-child(4) { animation-delay: .12s; }
.first-load .sidebar .nav-item:nth-child(5) { animation-delay: .16s; }
.first-load .sidebar .nav-item:nth-child(6) { animation-delay: .20s; }
.first-load .kpi, .first-load .section > .card, .first-load .split > *, .first-load .split-2 > *, .first-load .tile, .first-load .obj, .first-load .acc-card {
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.first-load .kpis > :nth-child(2) { animation-delay: .06s; }
.first-load .kpis > :nth-child(3) { animation-delay: .12s; }
.first-load .kpis > :nth-child(4) { animation-delay: .18s; }
.first-load .split > * { animation-delay: .22s; }
.first-load .tile:nth-child(4n+2) { animation-delay: .05s; }
.first-load .tile:nth-child(4n+3) { animation-delay: .10s; }
.first-load .tile:nth-child(4n+4) { animation-delay: .15s; }
.first-load .bar > span, .first-load .hbar .track span { animation: grow-x .9s cubic-bezier(.2,.8,.2,1) .35s both; }
.first-load .equity-svg { animation: reveal 1.4s cubic-bezier(.4,0,.2,1) .4s both; }
dialog[open] { animation: pop .24s cubic-bezier(.2,.8,.2,1); }
dialog[open]::backdrop { animation: fade .24s ease; }
.login-card { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.wl-badge.bump { animation: badge-pop .32s cubic-bezier(.2,.8,.2,1); }
.slot-box img { animation: fade .3s ease; }
.tile, .kpi, .obj { transition: border-color .2s; }
.tile:hover, .kpi:hover, .obj:hover { border-color: #262626; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Écrans plus petits ---------- */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .side-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px;
    overflow-x: auto; padding: 10px 16px; border-right: none; border-bottom: 1px solid var(--line-soft);
  }
  .sidebar .lockup { padding: 0 8px 0 0; }
  .mode-switch { margin: 0; flex: none; }
  .mode-btn { padding: 7px 9px; white-space: nowrap; }
  .sidebar .wordmark { display: none; }
  .sidebar .nav { flex-direction: row; gap: 2px; }
  .sidebar .nav-item { padding: 9px 11px; white-space: nowrap; }
  .sidebar .nav-item span { display: none; }
  .sidebar .nav-item.active::before { left: 8px; right: 8px; top: auto; bottom: 2px; width: auto; height: 2px; }
  .nav-sep { display: none; }
  .btn.block { width: auto; margin: 0; padding: 9px 12px; white-space: nowrap; }
  .main { padding: 0 16px 50px; }
  .topbar { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .tiles, .kpis, .add-row { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 22px; }
  .kpi { padding: 14px 16px; }
  .kpi-val { font-size: 21px; }
  .card { padding: 18px 16px; }
  .grid, .grid.g4, .trade-extra { grid-template-columns: 1fr; }
  .grid .span2 { grid-column: auto; }
  .topbar-right, .topbar-right select { width: 100%; }
  dialog { padding: 20px; }
}

/* Cellules réservées à l'affichage téléphone */
td.m-only { display: none; }

/* ---------- Revue de la semaine ---------- */
.rev-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.rev-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.rev-row:hover { border-color: #2a2a2a; }
.rev-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.rev-meta .muted { font-size: 12px; text-transform: none; }
.rev-shots { display: flex; gap: 8px; }
.rev-shot { width: 120px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; display: block; background: var(--raise); }
.rev-shot.none { display: grid; place-items: center; color: #3a3a3a; font-weight: 600; cursor: default; border-style: dashed; }
.rev-notes { margin-top: 6px; }
.rev-notes textarea { resize: vertical; }
.rev-save { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; }

.total-row td { border-top: 1px solid var(--line); font-weight: 500; }

/* ---------- Téléphone : tout s'empile proprement ---------- */
@media (max-width: 900px) {
  .topbar-right { width: 100%; }
  .topbar-right select { flex: 1 1 160px; min-width: 0; }
}
@media (max-width: 700px) {
  html { scroll-padding-top: 70px; }
  .card { border-radius: 12px; }
  h1.page-title { margin-bottom: 12px; }
  .card-head { align-items: flex-start; }
  .head-tools, .head-tools input { width: 100%; }

  /* Historique : chaque trade devient une petite carte */
  #trades thead { display: none; }
  #trades, #trades tbody { display: block; }
  #trades tbody tr { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--inner); }
  #trades tbody tr td { display: none; padding: 0; border: none; background: none !important; white-space: nowrap; }
  #trades tbody tr td.m-thumb { display: block; grid-row: span 3; }
  #trades tbody tr td.m-main { display: block; font-size: 14px; }
  #trades tbody tr td.m-res { display: block; text-align: right; }
  #trades tbody tr td.m-sub { display: block; grid-column: 2 / 4; font-size: 12px; color: var(--text-2); white-space: normal; }
  #trades tbody tr td.m-actions { display: block; grid-column: 2 / 4; text-align: right; }
  #trades tbody tr:nth-child(even) td { background: none; }

  /* Calendrier compact */
  .cal-wrap { overflow-x: visible; }
  .cal { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-dow.week, .cal-week { display: none; }
  .cal-dow { padding: 8px 4px; text-align: center; font-size: 10.5px; }
  .cal-cell { min-height: 58px; padding: 6px 4px; align-items: center; text-align: center; }
  .cal-val { font-size: 10.5px; }
  .cal-n { display: none; }
  .cal-head .cal-nav { width: 100%; justify-content: space-between; }
  .cal-title { min-width: 0; font-size: 15px; }

  /* Revue */
  .rev-row { grid-template-columns: minmax(0, 1fr); }
  .rev-shots { overflow-x: auto; }
  .rev-shot { width: 104px; height: 64px; flex: none; }

  /* Fenêtres en plein écran */
  dialog, dialog.wide { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: none; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .dlg-actions { position: sticky; bottom: -18px; background: var(--card); padding: 12px 0; margin-top: 12px; border-top: 1px solid var(--line-soft); }
  .slot-box { height: 140px; }
  .hbar { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .obj-grid, .bars-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fiche trade : choix des comptes (copie de trades) ---------- */
.acc-pick { margin-top: 20px; padding: 16px; background: var(--inner); border: 1px solid var(--line-soft); border-radius: 12px; }
.acc-pick-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#acc-pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 130px 120px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--card); opacity: .62; transition: opacity .15s, border-color .15s; }
.pick-row.on { opacity: 1; border-color: rgba(139,107,87,.55); }
.pick-name { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.pick-name input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pick-name small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.pick-field { font-size: 11px; gap: 4px; }
.pick-field input { padding: 7px 9px; font-size: 13px; }
.pick-out { text-align: right; font-weight: 600; font-size: 14px; }
.pick-out small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.acc-pick .res-out { margin-top: 10px; text-align: right; }
@media (max-width: 700px) {
  .pick-row { grid-template-columns: 1fr 1fr; }
  .pick-name { grid-column: 1 / -1; }
  .pick-out { grid-column: 1 / -1; text-align: left; }
}
/* ---------- Plusieurs captures par étape ---------- */
.slot-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.slot-box.filled { height: auto; display: block; padding: 0; border: none; background: transparent; cursor: default; box-shadow: none !important; }
.slot.active .slot-box.filled .gal { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gal-item { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); display: flex; flex-direction: column; }
.gal-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; display: block; cursor: zoom-in; background: #000; animation: fade .3s ease; }
.tf-badge { position: absolute; top: 8px; left: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 3px 9px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.tf-badge.empty { background: rgba(0,0,0,.7); color: var(--muted); font-weight: 600; }
.gal-item .slot-badge { top: 8px; right: 8px; left: auto; bottom: auto; }
.gal-tools { display: flex; gap: 6px; padding: 8px; background: var(--card); border-top: 1px solid var(--line-soft); }
.gal-tools .tf-input { padding: 6px 9px; font-size: 12.5px; }
.gal-tools button { flex: none; width: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--inner); color: var(--bad); cursor: pointer; font: inherit; }
.gal-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 170px; border-radius: 12px; border: 1.5px dashed rgba(139,107,87,.55); background: var(--accent-soft); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gal-add span { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 20px; }
.gal-add small { font-size: 11.5px; color: var(--text-2); font-weight: 400; }
.gal-add:hover { border-color: var(--accent-hi); }

/* Visionneuse */
#lightbox { overflow: hidden; }
#lightbox img { max-height: calc(100vh - 90px); margin: 0 auto; }
.lb-bar { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 14px; background: #0b0b0b; color: var(--text); font-size: 13.5px; cursor: default; }
.lb-bar .icon-btn { background: #151515; }

/* Revue : captures par étape */
.rev-row { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); align-items: start; }
.rev-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rev-phase-name { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rev-phase-imgs { display: flex; gap: 6px; overflow-x: auto; }
.rev-fig { position: relative; margin: 0; flex: none; }
.rev-fig .tf-badge { top: 4px; left: 4px; font-size: 10px; padding: 1px 6px; }
.rev-shot { width: 112px; height: 70px; }
@media (max-width: 700px) {
  .gal { grid-template-columns: minmax(0, 1fr); }
  .rev-row { grid-template-columns: minmax(0, 1fr); }
  .rev-shots { grid-template-columns: minmax(0, 1fr); }
}
/* Filtre de période : mois et dates libres */
.period-custom { display: inline-flex; align-items: center; gap: 6px; }
.period-custom input { width: auto; padding: 8px 10px; }
#period-month { width: auto; }
@media (max-width: 900px) {
  .period-custom { flex: 1 1 100%; }
  .period-custom input { flex: 1; min-width: 0; }
}
/* ---------- Pages : petite arrivée en fondu ---------- */
.section.page-in { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- Historique : bascule Cartes / Tableau ---------- */
.seg-toggle { display: inline-flex; padding: 3px; gap: 3px; background: var(--inner); border: 1px solid var(--line); border-radius: 10px; }
.seg-toggle button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border: none; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; }
.seg-toggle button.on { background: var(--raise); color: var(--text); box-shadow: inset 0 0 0 1px #262626; }
.trade-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tcard { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: border-color .2s, transform .18s cubic-bezier(.2,.8,.2,1); }
.tcard:hover { border-color: #2a2a2a; transform: translateY(-2px); }
.tcard-img { position: relative; aspect-ratio: 16 / 10; background: #000; border-bottom: 1px solid var(--line-soft); }
.tcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard-none { height: 100%; display: grid; place-items: center; color: #3a3a3a; font-size: 12.5px; }
.tcard-count { position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.75); color: #fff; }
.tcard-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.tcard-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.tcard-meta { font-size: 12.5px; color: var(--text-2); }
.tcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; font-size: 13px; font-weight: 600; }
.tcard-foot .muted { font-weight: 400; font-size: 12px; }

/* ---------- Lien élève dans la fiche ---------- */
.share-box { margin-top: 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(139,107,87,.5); background: var(--accent-soft); display: flex; flex-direction: column; gap: 10px; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; min-width: 0; font-size: 13px; }

/* ---------- Page de présentation ---------- */
.present-body { min-height: 100vh; display: flex; flex-direction: column; }
.pres-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line-soft); background: var(--side); flex-wrap: wrap; }
.pres-title { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.pres-count { font-size: 13px; color: var(--text-2); }
.pres-stage { flex: 1; display: grid; place-items: center; padding: 20px 24px; min-height: 0; }
.pres-slide { width: 100%; max-width: 1400px; display: grid; place-items: center; animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
.pres-card { width: min(720px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.pres-card.center { align-items: center; text-align: center; }
.pres-pair { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; display: flex; align-items: center; gap: 14px; }
.pres-pair .side-buy, .pres-pair .side-sell { font-size: 16px; }
.pres-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pres-facts div { background: var(--inner); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.pres-facts span { display: block; font-size: 12px; color: var(--text-2); }
.pres-facts strong { display: block; font-size: 15px; font-weight: 500; margin-top: 3px; text-transform: none; }
.pres-hint { font-size: 12.5px; }
.pres-fig { margin: 0; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.pres-fig figcaption { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 500; }
.pres-fig img { width: 100%; max-height: calc(100vh - 230px); object-fit: contain; background: #000; border: 1px solid var(--line); border-radius: 12px; }
.tf-badge.static { position: static; display: inline-block; }
.pres-result { font-size: 15px; font-weight: 700; letter-spacing: .08em; padding: 6px 16px; border-radius: 8px; }
.pres-result.tp { background: var(--good-soft); color: var(--good); }
.pres-result.sl { background: var(--bad-soft); color: var(--bad); }
.pres-result.be { background: var(--raise); color: var(--text-2); }
.pres-r { font-size: 64px; font-weight: 600; letter-spacing: -0.04em; }
.pres-note { font-size: 17px; color: var(--text-2); max-width: 560px; line-height: 1.5; margin: 0; }
.pres-foot { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px; border-top: 1px solid var(--line-soft); background: var(--side); }
.pres-foot .icon-btn { width: 40px; height: 40px; }
.pres-foot .icon-btn:disabled { opacity: .35; cursor: default; }
.pres-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60vw; }
.pres-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: #2a2a2a; cursor: pointer; padding: 0; }
.pres-dot.on { background: var(--accent-hi); transform: scale(1.3); }
@media (max-width: 700px) {
  .pres-top { padding: 10px 14px; }
  .pres-top .wordmark { display: none; }
  .pres-stage { padding: 12px; }
  .pres-card { padding: 22px 18px; }
  .pres-pair { font-size: 26px; }
  .pres-r { font-size: 48px; }
  .pres-fig img { max-height: calc(100vh - 200px); }
}