/* Habillage « Autopips » : chargé APRÈS components.css et app.css.
   Noir profond, verre, accent vert citron, titres Inter très gras, mouvements. */

/* ------------------------------------------------------------------ fond vivant */
html {
  background: var(--bg);
}
body {
  background: transparent;
  font-feature-settings: "tnum" 1, "calt" 1;
  letter-spacing: -0.005em;
}
body::before {
  /* aurore : deux halos qui dérivent lentement */
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -3;
  background:
    radial-gradient(38% 30% at 22% 12%, rgba(140, 230, 60, 0.34), transparent 70%),
    radial-gradient(34% 28% at 82% 4%, rgba(75, 227, 168, 0.26), transparent 70%),
    radial-gradient(46% 34% at 60% 96%, rgba(212, 255, 58, 0.14), transparent 70%),
    linear-gradient(180deg, #07080a 0%, #121519 55%, #07080a 100%);
  animation: aurora 26s ease-in-out infinite alternate;
  will-change: transform;
}
body::after {
  /* grille fine, estompée vers le bas */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(150, 156, 146, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 156, 146, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 78%);
  pointer-events: none;
}
@keyframes aurora {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-1%, 3%, 0) scale(1.03);
  }
}
canvas.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

/* ------------------------------------------------------------------ typographie */
.h1,
.h2,
.big,
.card-title,
.brand,
.state-tag,
.power .label,
.pin-title {
  font-family: var(--font-display);
}
.h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.h2 {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  line-height: 1.25;
}
.big {
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.55rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.big.pos,
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.big.neg {
  color: var(--coral);
}
.pos {
  color: var(--green);
}
.neg {
  color: var(--coral);
}
.eyebrow,
.label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
a {
  color: var(--gold-2);
}

/* ------------------------------------------------------------------ en-tête et logo */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-5);
  padding: calc(var(--s-3) + var(--safe-t)) var(--s-4) var(--s-3);
  background: linear-gradient(180deg, rgba(7, 8, 10, 0.92) 0%, rgba(7, 8, 10, 0.6) 70%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand {
  gap: 12px;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  color: var(--text-2);
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
/* logo AUTOPIPS : un « A » dont le centre est un point (le pip) + « AUTOPIPS » en capitales, le « I » en accent */
.logo-ap {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.42rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo-ap svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  overflow: visible;
}
.logo-ap svg path {
  stroke: var(--gold);
  filter: drop-shadow(0 0 6px rgba(212, 255, 58, 0.45));
}
.logo-ap svg circle {
  fill: var(--text);
  animation: pip 3.4s var(--ease) infinite;
  transform-origin: 32px 39px;
}
.logo-ap b {
  font-weight: 800;
}
.logo-ap .i {
  color: var(--gold);
  text-shadow: 0 0 0.5em rgba(212, 255, 58, 0.45);
}
@keyframes pip {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.25);
  }
}
.center .logo-ap {
  font-size: 2.6rem;
  margin: 0 auto var(--s-2);
  animation: logo-in 900ms var(--ease) both;
}
@keyframes logo-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    filter: blur(8px);
  }
}

/* ------------------------------------------------------------------ cartes de verre */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.62) 0%, rgba(14, 16, 19, 0.66) 60%, rgba(12, 14, 17, 0.72) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  overflow: hidden;
}
.card::before {
  /* liseré lumineux en haut à gauche */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(212, 255, 58, 0.55), rgba(140, 230, 60, 0.18) 28%, transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}
.card.flat {
  background: rgba(18, 21, 25, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card.flat::before {
  display: none;
}
.card.tap {
  transition: transform var(--t-fast) var(--ease), border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.card.tap:hover {
  border-color: rgba(212, 255, 58, 0.4);
  box-shadow: var(--shadow-1), 0 0 0 1px rgba(212, 255, 58, 0.12), 0 18px 50px rgba(140, 230, 60, 0.22);
}

/* ------------------------------------------------------------------ boutons */
.btn {
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: rgba(24, 28, 33, 0.7);
  font-weight: 650;
  letter-spacing: 0.005em;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease), background var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}
.btn:hover {
  border-color: rgba(212, 255, 58, 0.5);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  position: relative;
  border: 0;
  color: var(--gold-ink);
  background: var(--grad);
  background-size: 180% 100%;
  box-shadow: 0 10px 34px rgba(212, 255, 58, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  font-weight: 750;
  overflow: hidden;
}
.btn.primary::after {
  /* reflet qui traverse le bouton */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 4.2s var(--ease) infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%,
  55% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}
.btn.danger {
  border-color: rgba(255, 93, 74, 0.5);
  color: var(--coral);
  background: rgba(255, 93, 74, 0.1);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}

/* ------------------------------------------------------------------ pastilles */
.badge {
  border-radius: var(--r-full);
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge.info {
  color: #e6f0c8;
  background: rgba(140, 230, 60, 0.2);
  border: 1px solid rgba(140, 230, 60, 0.45);
}
.badge.ok {
  color: var(--green);
  border: 1px solid rgba(198, 255, 58, 0.35);
}
.badge.warn {
  border: 1px solid rgba(255, 196, 87, 0.35);
}
.badge.err {
  border: 1px solid rgba(255, 93, 74, 0.4);
}
.dot.pos {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(198, 255, 58, 0.14), 0 0 14px rgba(198, 255, 58, 0.8);
  animation: beacon 2.4s ease-in-out infinite;
}
.dot.neg {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 93, 74, 0.16), 0 0 14px rgba(255, 93, 74, 0.8);
}
@keyframes beacon {
  50% {
    box-shadow: 0 0 0 7px rgba(198, 255, 58, 0.04), 0 0 20px rgba(198, 255, 58, 0.9);
  }
}
.side.buy {
  color: var(--cyan);
  background: rgba(212, 255, 58, 0.12);
  border: 1px solid rgba(212, 255, 58, 0.35);
}
.side.sell {
  color: var(--coral);
  background: rgba(255, 93, 74, 0.12);
  border: 1px solid rgba(255, 93, 74, 0.35);
}

/* ------------------------------------------------------------------ réacteur (bouton ON / OFF) */
.power {
  width: 132px;
  height: 132px;
  flex: none;
  margin: 0;
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 50% 30%, #20261a 0%, #121519 62%, #090a0c 100%);
  color: var(--muted-2);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9), 0 18px 40px rgba(0, 0, 0, 0.6);
  isolation: isolate;
}
.power::before {
  /* anneau d'énergie qui tourne */
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(150, 156, 146, 0.5) 78%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 9s linear infinite;
  z-index: -1;
}
.power svg {
  width: 40px;
  height: 40px;
  transform: translateY(-8px);
  transition: filter var(--t-slow) var(--ease);
}
.power .label {
  bottom: 26px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}
.power[aria-pressed="true"] {
  color: var(--cyan);
  border-color: rgba(212, 255, 58, 0.55);
  background: radial-gradient(circle at 50% 30%, #3f5a12 0%, #151b0c 55%, #090a0c 100%);
  box-shadow: inset 0 0 34px rgba(212, 255, 58, 0.28), var(--glow-cyan);
}
.power[aria-pressed="true"]::before {
  background: conic-gradient(from 0deg, transparent 0 40%, #8ce63c 62%, #d4ff3a 86%, #ffffff 97%, transparent 100%);
  animation-duration: 2.8s;
  filter: drop-shadow(0 0 8px rgba(212, 255, 58, 0.9));
}
.power[aria-pressed="true"]::after {
  inset: -14px;
  border: 1px solid rgba(212, 255, 58, 0.5);
}
.power[aria-pressed="true"] .label {
  color: var(--text);
}
.power[aria-pressed="true"] svg {
  filter: drop-shadow(0 0 10px rgba(212, 255, 58, 0.95));
}
.state-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--muted-2);
}
.state-tag.on {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------------ sélecteurs */
.segmented {
  border-radius: var(--r-full);
  background: rgba(12, 14, 17, 0.7);
  border: 1px solid var(--line);
  padding: 4px;
}
.segmented button {
  border-radius: var(--r-full);
  font-weight: 650;
  transition: color var(--t-med) var(--ease), background var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.segmented button[aria-pressed="true"] {
  color: var(--gold-ink);
  background: var(--grad);
  box-shadow: 0 6px 20px rgba(212, 255, 58, 0.3);
}
.chip {
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: rgba(24, 28, 33, 0.6);
}
.chip[aria-pressed="true"] {
  color: var(--gold-ink);
  background: var(--grad);
  border-color: transparent;
}
.input {
  border-radius: 16px;
  background: rgba(7, 8, 10, 0.6);
  border: 1px solid var(--line-2);
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(212, 255, 58, 0.14), 0 0 30px rgba(212, 255, 58, 0.18);
  outline: none;
}
.switch {
  background: rgba(12, 14, 17, 0.8);
}
.switch::after {
  background: var(--muted);
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.switch:checked {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(212, 255, 58, 0.45);
}
.switch:checked::after {
  background: #fff;
  box-shadow: 0 2px 8px rgba(11, 13, 4, 0.5);
}

/* ------------------------------------------------------------------ bandeaux */
.banner {
  border-radius: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.banner.err {
  border-color: rgba(255, 93, 74, 0.45);
  background: linear-gradient(120deg, rgba(255, 93, 74, 0.18), rgba(75, 227, 168, 0.08));
}
.banner.warn {
  border-color: rgba(255, 196, 87, 0.4);
}

/* ------------------------------------------------------------------ barre d'onglets flottante */
.tabbar {
  left: 12px;
  right: 12px;
  bottom: calc(10px + var(--safe-b));
  padding: 6px;
  max-width: calc(var(--max) - 8px);
  margin-inline: auto;
  border-radius: 26px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(26, 30, 35, 0.78), rgba(12, 14, 17, 0.86));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.tabbar a {
  position: relative;
  min-height: 54px;
  border-radius: 20px;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  transition: color var(--t-med) var(--ease), transform var(--t-fast) var(--ease);
}
.tabbar a:active {
  transform: scale(0.94);
}
.tabbar a svg {
  width: 22px;
  height: 22px;
  transition: transform var(--t-med) var(--ease), filter var(--t-med) var(--ease);
}
.tabbar a[aria-current="page"] {
  color: var(--text);
  background: linear-gradient(180deg, rgba(140, 230, 60, 0.3), rgba(212, 255, 58, 0.06));
  box-shadow: 0 0 0 1px rgba(212, 255, 58, 0.28) inset;
}
.tabbar a[aria-current="page"] svg {
  color: var(--cyan);
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 0 8px rgba(212, 255, 58, 0.9));
}
.tabbar a[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(212, 255, 58, 0.9);
  animation: tab-in 320ms var(--ease);
}
@keyframes tab-in {
  from {
    width: 0;
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ feuilles, toasts, chargement */
.sheet {
  background: linear-gradient(180deg, rgba(26, 30, 35, 0.96), rgba(10, 11, 13, 0.98));
  border: 1px solid var(--line-2);
  border-radius: 28px 28px 0 0;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.8), 0 -1px 0 rgba(212, 255, 58, 0.35);
}
.sheet .grab {
  background: var(--grad);
  opacity: 0.7;
}
.toast {
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: rgba(18, 21, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2);
}
.toast.ok {
  border-color: rgba(198, 255, 58, 0.5);
}
.toast.err {
  border-color: rgba(255, 93, 74, 0.55);
}
.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, rgba(24, 28, 33, 0.6) 20%, rgba(140, 230, 60, 0.32) 45%, rgba(212, 255, 58, 0.2) 55%, rgba(24, 28, 33, 0.6) 80%);
  background-size: 240% 100%;
}
.spinner {
  border-color: rgba(150, 156, 146, 0.25);
  border-top-color: var(--cyan);
}

/* ------------------------------------------------------------------ entrée des écrans : les blocs montent l'un après l'autre */
.view {
  animation: none;
}
.view > *,
.view .cols > .stack > * {
  animation: rise 560ms var(--ease) both;
}
.view > *:nth-child(2),
.view .cols > .stack > *:nth-child(2) {
  animation-delay: 60ms;
}
.view > *:nth-child(3),
.view .cols > .stack > *:nth-child(3) {
  animation-delay: 120ms;
}
.view > *:nth-child(4),
.view .cols > .stack > *:nth-child(4) {
  animation-delay: 180ms;
}
.view > *:nth-child(5),
.view .cols > .stack > *:nth-child(5) {
  animation-delay: 240ms;
}
.view > *:nth-child(n + 6),
.view .cols > .stack > *:nth-child(n + 6) {
  animation-delay: 300ms;
}
.view .cols > .stack + .stack > * {
  animation-delay: 220ms;
}
.view.still > *,
.view.still .cols > .stack > * {
  animation: none; /* simple rafraîchissement des chiffres : rien ne bouge */
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985);
    filter: blur(6px);
  }
}
.topbar {
  animation: none !important;
}

/* ------------------------------------------------------------------ cartes de trade : jauge SL — entrée — TP */
.trade {
  align-items: flex-start;
}
.trade .sym {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.trade .pl {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gauge {
  position: relative;
  display: block;
  height: 5px;
  margin: 14px 2px 4px;
  border-radius: 5px;
  background: linear-gradient(
    90deg,
    rgba(255, 93, 74, 0.55) 0%,
    rgba(150, 156, 146, 0.22) var(--en, 50%),
    rgba(212, 255, 58, 0.6) 100%
  );
}
.gauge .en {
  position: absolute;
  left: var(--en, 50%);
  top: -4px;
  width: 2px;
  height: 13px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--muted);
}
.gauge .px {
  position: absolute;
  left: var(--px, 50%);
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 93, 74, 0.25), 0 0 14px rgba(255, 93, 74, 0.9);
  transition: left 900ms var(--ease);
}
.gauge.win .px {
  box-shadow: 0 0 0 3px rgba(212, 255, 58, 0.25), 0 0 16px rgba(212, 255, 58, 0.95);
}

/* ------------------------------------------------------------------ accueil : bloc principal */
.hero-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5);
  min-height: 176px;
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(140, 230, 60, 0.28), transparent 60%),
    linear-gradient(160deg, rgba(30, 35, 41, 0.7), rgba(12, 14, 17, 0.78));
}
.hero-row.on {
  border-color: rgba(212, 255, 58, 0.32);
  box-shadow: var(--shadow-1), 0 0 60px rgba(140, 230, 60, 0.22);
}
.hero-row .h2 {
  font-size: 1.12rem;
  margin: 6px 0 6px;
}
.stat .big {
  margin-top: 10px;
  font-size: clamp(1rem, 5.4vw, 1.5rem);
  white-space: nowrap;
}
.stat {
  min-height: 112px;
}
.spark {
  position: absolute;
  right: -10px;
  bottom: -14px;
  width: 120px;
  height: 60px;
  opacity: 0.5;
  pointer-events: none;
}

/* frise TP1 — TP2 — TP3 */
.tpline {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 14px 4px 2px;
}
.tpline::before,
.tpline i {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  top: 6px;
  height: 3px;
  border-radius: 3px;
  background: rgba(150, 156, 146, 0.25);
}
.tpline i {
  right: auto;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(212, 255, 58, 0.8);
  transition: width 900ms var(--ease);
}
.tpline span {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--muted-2);
}
.tpline span::before {
  content: "";
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #121519;
  border: 2px solid rgba(150, 156, 146, 0.5);
}
.tpline span.hit {
  color: var(--text);
}
.tpline span.hit::before {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(212, 255, 58, 0.95);
}

/* ------------------------------------------------------------------ clavier du code */
.pin-key,
.pad button {
  font-family: var(--font-display);
}

.mention {
  color: rgba(150, 156, 146, 0.75);
  padding-inline: var(--s-2);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .btn.primary::after,
  .power::before,
  .logo-ap svg circle,
  .dot.pos {
    animation: none !important;
  }
  .view > *,
  .view .cols > .stack > * {
    animation: none !important;
  }
}

/* ==================================================================== ACCUEIL (refait de zéro le 11/11) */
.home {
  display: grid;
  gap: 22px;
}
.home > .mention {
  margin-top: 0;
}
.hbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}
.hbar-r {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pulse {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
}
.pulse i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(198, 255, 58, 0.9);
  animation: beacon 2.4s ease-in-out infinite;
}
.pulse.ko i {
  background: var(--coral);
  box-shadow: 0 0 12px rgba(255, 93, 74, 0.9);
  animation: none;
}

/* --- le chiffre du jour, pleine largeur, posé sur la courbe */
.hero {
  position: relative;
  margin: 4px calc(-1 * var(--s-4)) 0;
  padding: 6px var(--s-4) 0;
  display: grid;
  justify-items: center;
  text-align: center;
}
.hero-n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 13.5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.055em;
  margin: 12px 0 10px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 0 60px rgba(140, 230, 60, 0.55);
}
.hero-n.pos {
  background: linear-gradient(100deg, #a8f05a 0%, #d4ff3a 55%, #f0ffc4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(212, 255, 58, 0.45));
}
.hero-n.neg {
  color: var(--coral);
  text-shadow: 0 0 50px rgba(255, 93, 74, 0.5);
}
.hero-s {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.hchart {
  position: relative;
  width: 100%;
  height: 168px;
  margin-top: 6px;
}
.hchart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(212, 255, 58, 0.55));
}
.hc-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.9s 250ms var(--ease) forwards;
}
.home.still .hc-line {
  animation: none;
  stroke-dashoffset: 0;
}
.hc-area {
  opacity: 0;
  animation: fade 1.2s 900ms ease forwards;
}
.home.still .hc-area {
  animation: none;
  opacity: 1;
}
.hc-zero {
  stroke: rgba(150, 156, 146, 0.28);
  stroke-dasharray: 3 6;
  vector-effect: non-scaling-stroke;
}
.hc-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(212, 255, 58, 0.25), 0 0 22px 4px rgba(212, 255, 58, 0.95);
  animation: dot 2s ease-in-out infinite;
}
.hchart.idle svg {
  opacity: 0.55;
}
.hchart.idle .hc-line {
  animation: draw 2.6s 200ms var(--ease) forwards, drift 7s 3s ease-in-out infinite alternate;
}
.hchart-t {
  position: absolute;
  inset: auto 0 14px;
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted-2);
}
.hero-f {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: -6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(18, 21, 25, 0.6), rgba(18, 21, 25, 0.2));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-f > div {
  display: grid;
  gap: 4px;
  padding: 14px 8px;
}
.hero-f > div + div {
  border-left: 1px solid var(--line);
}
.hero-f b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
@keyframes dot {
  50% {
    box-shadow: 0 0 0 9px rgba(212, 255, 58, 0.08), 0 0 30px 8px rgba(212, 255, 58, 1);
  }
}
@keyframes drift {
  to {
    transform: translateY(-10px);
  }
}

/* --- le réacteur au centre */
.core {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 0 2px;
}
.core-ring {
  position: relative;
  width: 214px;
  height: 214px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}
.core-ring::before,
.core-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(150, 156, 146, 0.16);
}
.core-ring::before {
  inset: 0;
  border-style: dashed;
  animation: spin 60s linear infinite;
}
.core-ring::after {
  inset: 20px;
}
.core.on .core-ring::before {
  border-color: rgba(212, 255, 58, 0.3);
  animation-duration: 22s;
}
.core.on .core-ring::after {
  border-color: rgba(140, 230, 60, 0.45);
  box-shadow: 0 0 60px rgba(140, 230, 60, 0.35), inset 0 0 50px rgba(212, 255, 58, 0.12);
}
.core-ring::before,
.core-ring::after,
.orbit {
  pointer-events: none; /* décor : jamais devant le bouton */
}
.core .power {
  z-index: 2;
}
.orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: spin 7s linear infinite;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}
.orbit::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px 3px rgba(212, 255, 58, 0.95);
}
.orbit.o2 {
  inset: 20px;
  animation-duration: 4.6s;
  animation-direction: reverse;
}
.orbit.o2::before {
  background: var(--violet);
  box-shadow: 0 0 16px 3px rgba(75, 227, 168, 0.95);
}
.core.on .orbit {
  opacity: 1;
}
.core .power {
  width: 136px;
  height: 136px;
}
.core-t {
  margin: 6px 0 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
}
.core p {
  margin: 0;
  max-width: 30ch;
}

/* --- deux tuiles d'état */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 14px 13px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.5), rgba(12, 14, 17, 0.6));
  min-width: 0;
}
.tile .dot {
  position: absolute;
  top: 16px;
  right: 14px;
}
.tile b {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile .st-val {
  max-width: none;
  text-align: left;
  padding-right: 18px;
}
.hchart.idle {
  height: 104px;
}
.tile .xs {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile.ko {
  border-color: rgba(255, 93, 74, 0.45);
  background: linear-gradient(160deg, rgba(255, 93, 74, 0.14), rgba(12, 14, 17, 0.6));
}

/* --- blocs titrés */
.block {
  display: grid;
  gap: 12px;
}
.block-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lnk {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: var(--tap);
  min-width: var(--tap);
  justify-content: flex-end;
  padding: 0 0 0 12px;
  margin: -10px 0;
  border: 0;
  background: none;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.lnk svg {
  width: 16px;
  height: 16px;
  transform: rotate(-90deg);
}

/* --- positions en direct : cartes qui défilent */
.deck {
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--s-4));
  padding: 4px var(--s-4) 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar {
  display: none;
}
.pcard {
  flex: 0 0 78%;
  max-width: 300px;
  scroll-snap-align: center;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(212, 255, 58, 0.3);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(212, 255, 58, 0.2), transparent 60%),
    linear-gradient(160deg, rgba(30, 35, 41, 0.75), rgba(12, 14, 17, 0.8));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.pcard.down {
  border-color: rgba(255, 93, 74, 0.35);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 93, 74, 0.18), transparent 60%),
    linear-gradient(160deg, rgba(30, 35, 41, 0.75), rgba(12, 14, 17, 0.8));
}
.pcard-h {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pcard-h b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}
.pcard-n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.pcard-n.pos {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pcard-f {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

/* ==================================================================== JOURNAL : frise lumineuse */
.tl {
  position: relative;
  display: grid;
  gap: 10px;
  padding-left: 22px;
}
.tl::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), rgba(140, 230, 60, 0.5) 40%, rgba(75, 227, 168, 0.15));
}
.tl-i {
  position: relative;
  --c: var(--muted-2);
}
.tl-i.trade {
  --c: var(--cyan);
}
.tl-i.message,
.tl-i.signal {
  --c: #b9c2b0;
}
.tl-i.skip {
  --c: #ffc457;
}
.tl-i.error,
.tl-i.alert {
  --c: var(--coral);
}
.tl-d {
  position: absolute;
  left: -22px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--c);
  box-shadow: 0 0 12px var(--c);
}
.tl-b {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.5), rgba(12, 14, 17, 0.6));
  min-width: 0;
}
.tl-i.trade .tl-b {
  border-color: rgba(212, 255, 58, 0.28);
}
.tl-i.error .tl-b,
.tl-i.alert .tl-b {
  border-color: rgba(255, 93, 74, 0.4);
}
.tl-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tl-k {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c);
}
.tl-t {
  font-size: 0.72rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.tl-m {
  margin: 5px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.tl-c {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.tl-c span {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-2);
  background: rgba(150, 156, 146, 0.13);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tl-c .fast {
  color: var(--gold-ink);
  background: var(--grad);
  font-weight: 700;
}

/* ==================================================================== POSITIONS / HISTORIQUE : grand chiffre */
.sum {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 4px 0 8px;
}
.sum-n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 11vw, 3.2rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sum-n.pos {
  background: linear-gradient(100deg, #a8f05a, #d4ff3a 60%, #f0ffc4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(212, 255, 58, 0.4));
}
.sum-n.neg {
  color: var(--coral);
}
.sum-s {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.kpis {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.kpi {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 12px 6px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.5), rgba(12, 14, 17, 0.6));
}
.kpi > b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.kpi small,
.statgrid small {
  font-size: 0.66rem;
  color: var(--muted-2);
}
/* anneau de réussite */
.ring {
  --pct: 0%;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--cyan) 0, var(--accent-2) var(--pct), rgba(150, 156, 146, 0.18) var(--pct));
  filter: drop-shadow(0 0 10px rgba(212, 255, 58, 0.35));
}
.ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #121519;
}
.ring b {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
}
.ring small {
  font-size: 0.56rem;
  color: var(--muted);
  margin-left: 1px;
}
.ring.sm {
  width: 46px;
  height: 46px;
  margin: 0 auto 4px;
}
.chan-n {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}
.chan-p {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
.chan-p.pos {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.statgrid b {
  font-family: var(--font-display);
}
.lab {
  border-style: dashed;
}
.result-box:not(:empty) {
  border-radius: 14px;
  border: 1px solid rgba(212, 255, 58, 0.3);
  background: rgba(7, 8, 10, 0.7);
  padding: 12px;
}

/* ==================================================================== CODE : clavier en verre */
.pin-dots span {
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(150, 156, 146, 0.5);
  background: transparent;
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.pin-dots span.on {
  background: var(--cyan);
  border-color: var(--cyan);
  transform: scale(1.25);
  box-shadow: 0 0 16px rgba(212, 255, 58, 0.95);
}
.pinpad button {
  font-family: var(--font-display);
  font-weight: 600;
  border: 1px solid var(--line-2);
  background: radial-gradient(circle at 50% 20%, rgba(140, 230, 60, 0.28), rgba(12, 14, 17, 0.7) 70%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.pinpad button:active {
  transform: scale(0.9);
  border-color: var(--cyan);
  box-shadow: 0 0 26px rgba(212, 255, 58, 0.6), inset 0 0 20px rgba(212, 255, 58, 0.25);
}
.pinpad button.ghost {
  background: none;
  border-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ==================================================================== RÉGLAGES */
.setrow .nm,
.setting .txt b {
  font-weight: 650;
}
details.advanced > summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}
.card > .label:first-child,
.card.flat > .label:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--gold-2);
}
.card > .label:first-child::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(212, 255, 58, 0.8);
}

/* --- bouclier « perte du jour » */
.shield {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.42), rgba(12, 14, 17, 0.55));
}
.shield p {
  margin: 0;
}
.shield-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.shield-h b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}
.shield-h small {
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--muted-2);
}
.shield-bar {
  height: 8px;
  border-radius: 8px;
  background: rgba(150, 156, 146, 0.18);
  overflow: hidden;
}
.shield-bar i {
  display: block;
  height: 100%;
  width: max(var(--w, 0%), 3%);
  border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(212, 255, 58, 0.7);
  transition: width 900ms var(--ease);
}
.shield.warn .shield-bar i {
  background: linear-gradient(90deg, #ffc457, #ff8f5a);
  box-shadow: 0 0 14px rgba(255, 196, 87, 0.7);
}
.shield.full {
  border-color: rgba(255, 93, 74, 0.45);
}
.shield.full .shield-bar i {
  background: var(--coral);
  box-shadow: 0 0 14px rgba(255, 93, 74, 0.8);
}
.navrow {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.navrow .xs {
  display: block;
}
.navrow svg {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
  color: var(--gold-2);
}

/* --- radar d'attente quand aucune position n'est ouverte */
.radar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(30, 35, 41, 0.42), rgba(12, 14, 17, 0.55));
}
.radar-row p {
  margin: 0;
}
.radar-t {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px !important;
}
.radar {
  position: relative;
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(150, 156, 146, 0.3);
  background: radial-gradient(circle, rgba(140, 230, 60, 0.18), transparent 70%);
  overflow: hidden;
}
.radar i {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  border: 1px solid rgba(150, 156, 146, 0.2);
}
.radar i:nth-child(1) {
  width: 66%;
  height: 66%;
}
.radar i:nth-child(2) {
  width: 34%;
  height: 34%;
}
.radar i:nth-child(3) {
  width: 6px;
  height: 6px;
  border: 0;
  background: var(--muted-2);
}
.radar b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(212, 255, 58, 0.55), transparent 28%);
  opacity: 0;
}
.radar.on {
  border-color: rgba(212, 255, 58, 0.45);
  box-shadow: 0 0 30px rgba(212, 255, 58, 0.25);
}
.radar.on i:nth-child(3) {
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(212, 255, 58, 1);
}
.radar.on b {
  opacity: 1;
  animation: spin 2.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hc-line {
    animation: none !important;
    stroke-dashoffset: 0;
  }
  .hc-area {
    animation: none !important;
    opacity: 1;
  }
  .orbit,
  .core-ring::before,
  .radar.on b,
  .hc-dot,
  .pulse i {
    animation: none !important;
  }
}

/* icône Face ID de l'écran d'activation */
.lock .center > svg {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--s-3);
  color: var(--cyan);
  filter: drop-shadow(0 0 18px rgba(212, 255, 58, 0.7));
}
