/* AUTOPIPS — design A « Néon, le tableau de bord » (retenu par Louka le 27/11/2026).
   Chargé EN DERNIER : remplace l'habillage hérité (verre, aurore, barre en pilule, gros bouton rond) par un
   tableau de bord sobre : noir profond, cartes pleines, vert citron pour l'accent et les gains, corail pour les pertes.
   Maquette de référence : design/autopips/directions.html (section A). */

:root {
  --ap-bg: #07080a;
  --ap-sf: #111316;
  --ap-sf2: #181b1f;
  --ap-ln: rgba(255, 255, 255, 0.07);
  --ap-ln2: rgba(255, 255, 255, 0.12);
  --ap-mu: #868c84;
  --ap-ac: #d4ff3a;
  --ap-ink: #0b0d04;
  --ap-gain: #c6ff3a;
  --ap-loss: #ff5d4a;
  --ap-glow: rgba(212, 255, 58, 0.18);
}

/* ------------------------------------------------------------------ fond : noir, un seul halo fixe en haut à droite */
html,
body {
  background: var(--ap-bg);
}
body::before {
  animation: none;
  inset: 0;
  background: radial-gradient(80% 32% at 92% -4%, var(--ap-glow), transparent 70%), var(--ap-bg);
}
body::after,
canvas.fx {
  display: none;
}

/* ------------------------------------------------------------------ titres : Inter très gras, serré */
.h1,
.h2,
.brand-title,
.grp-t {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.045em;
}
.label,
.eyebrow {
  font-family: var(--font);
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
  font-size: 0.74rem;
  color: var(--ap-mu);
}

/* ------------------------------------------------------------------ cartes pleines */
.card,
.card.flat {
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln);
  border-radius: 22px;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card::before,
.card.flat::before {
  display: none;
}
.card.tap:hover {
  border-color: var(--ap-ln2);
  box-shadow: none;
}
.card.flat {
  background: var(--ap-sf2);
}

/* ------------------------------------------------------------------ boutons */
.btn {
  border-radius: 16px;
  background: var(--ap-sf2);
  border: 1px solid var(--ap-ln);
}
.btn:hover {
  border-color: var(--ap-ln2);
}
.btn.primary {
  background: var(--ap-ac);
  color: var(--ap-ink);
  box-shadow: 0 10px 28px rgba(212, 255, 58, 0.22);
  font-weight: 800;
}
.btn.primary::after {
  display: none;
}
.btn.danger {
  background: rgba(255, 93, 74, 0.12);
  border-color: transparent;
  color: var(--ap-loss);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}

/* ------------------------------------------------------------------ choix segmentés : gris, l'option choisie en carte */
.segmented {
  background: var(--ap-sf2);
  border-radius: 13px;
  padding: 3px;
  box-shadow: none;
  border: 0;
}
.segmented button {
  border-radius: 10px;
  color: var(--ap-mu);
  font-weight: 700;
}
.segmented button[aria-pressed="true"] {
  background: var(--ap-sf);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--ap-ln2), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------------ interrupteurs */
.switch:checked {
  background: var(--ap-ac);
}
.switch:checked::after {
  background: var(--ap-ink);
}

/* ------------------------------------------------------------------ bandeaux */
.banner {
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln);
  border-radius: 18px;
}
.banner.warn {
  border-color: rgba(255, 196, 87, 0.35);
}
.banner.err {
  border-color: rgba(255, 93, 74, 0.45);
}

/* ------------------------------------------------------------------ barre d'onglets : pleine largeur, collée en bas */
.tabbar {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  margin: 0;
  padding: 8px 8px calc(8px + var(--safe-b));
  border: 0;
  border-top: 1px solid var(--ap-ln);
  border-radius: 0;
  background: rgba(7, 8, 10, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: none;
}
.tabbar nav {
  gap: 0;
  max-width: var(--max);
}
.tabbar a,
.tabbar a[aria-current="page"] {
  flex: 1 1 0;
  flex-direction: column;
  gap: 4px;
  min-height: 52px;
  border-radius: 12px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ap-mu);
}
.tabbar a[aria-current="page"] {
  color: #fff;
}
.tabbar a svg,
.tabbar a[aria-current="page"] svg {
  width: 22px;
  height: 22px;
  color: inherit;
  filter: none;
  transform: none;
}
.tabbar a[aria-current="page"] svg {
  color: var(--ap-ac);
}
.tabbar a[aria-current="page"]::after {
  display: block;
  content: "";
  position: static;
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--ap-ac);
  box-shadow: none;
  animation: none;
}

/* ------------------------------------------------------------------ feuilles (détails) */
.sheet {
  background: #0d0f12;
  border-top: 1px solid var(--ap-ln2);
}

/* ================================================================== ACCUEIL A */
.ap-home {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 8px;
}
.ap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}
.ap-head .logo-ap {
  font-size: 1.22rem;
}
.ap-head-r {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--ap-sf2);
  color: #c9cdc3;
}
.ap-chip.g {
  background: rgba(198, 255, 58, 0.1);
  color: var(--ap-gain);
}
.ap-chip.l {
  background: rgba(255, 93, 74, 0.12);
  color: var(--ap-loss);
}
.ap-chip.w {
  background: rgba(255, 196, 87, 0.13);
  color: #ffc457;
}
.ap-chip .d {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* glissière marche / pause */
.ap-slide {
  position: relative;
  height: 68px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  padding: 0 16px 0 104px;
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln2);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.ap-slide.on {
  background: linear-gradient(90deg, rgba(212, 255, 58, 0.06), rgba(212, 255, 58, 0.2));
  border-color: rgba(212, 255, 58, 0.38);
  padding: 0 104px 0 18px;
}
.ap-slide .t b {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ap-slide .t span {
  display: block;
  font-size: 0.74rem;
  color: var(--ap-mu);
  margin-top: 2px;
}
.ap-slide.on .t span {
  color: #b9c78a;
}
.ap-slide .power {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 54px;
  height: 52px;
  min-height: 0;
  border-radius: 16px;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--ap-sf2);
  color: var(--ap-mu);
  box-shadow: inset 0 0 0 1px var(--ap-ln2);
  transition: left 260ms var(--ease), background 200ms var(--ease);
  cursor: grab;
  padding: 0;
}
.ap-slide .power::before,
.ap-slide .power::after {
  display: none;
}
.ap-slide .power svg {
  width: 24px;
  height: 24px;
}
.ap-slide .power .label {
  display: none;
}
.ap-slide.on .power {
  left: calc(100% - 61px);
  background: var(--ap-ac);
  color: var(--ap-ink);
  box-shadow: 0 8px 24px rgba(212, 255, 58, 0.4);
}
.ap-slide.dragging .power {
  transition: none;
  cursor: grabbing;
}
.ap-slide .chev {
  position: absolute;
  font-weight: 800;
  letter-spacing: -3px;
  color: rgba(212, 255, 58, 0.45);
  pointer-events: none;
}
.ap-slide.on .chev {
  right: 70px;
}
.ap-slide:not(.on) .chev {
  left: 70px;
  color: var(--ap-mu);
}
.ap-slide .t {
  min-width: 0;
}
.ap-slide .t span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* gain du jour */
.ap-big {
  font-size: 2.7rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ap-big.pos {
  color: var(--ap-gain);
}
.ap-big.neg {
  color: var(--ap-loss);
}
.ap-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ap-lbl {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ap-mu);
}

/* courbe */
.ap-curve {
  padding: 12px 12px 10px;
}
.ap-curve .hchart {
  height: 120px;
  margin: 0 0 8px;
}
.ap-curve .hchart-t {
  font-size: 0.78rem;
}

/* trois chiffres */
.ap-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ap-mini > div {
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln);
  border-radius: 16px;
  padding: 10px;
  min-width: 0;
}
.ap-mini b {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.ap-mini small {
  display: block;
  font-size: 0.68rem;
  color: var(--ap-mu);
  margin-top: 2px;
  white-space: nowrap;
}
.ap-mini .meter {
  height: 4px;
  border-radius: 4px;
  background: var(--ap-sf2);
  margin-top: 6px;
  overflow: hidden;
}
.ap-mini .meter i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 4px;
  background: var(--ap-gain);
}
.ap-mini .meter.warn i {
  background: #ffc457;
}
.ap-mini .meter.full i {
  background: var(--ap-loss);
}

/* positions en direct */
.ap-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px -4px;
}
.ap-sec b {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ap-pos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ap-p {
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln);
  border-radius: 20px;
  padding: 12px 14px;
}
.ap-p-h {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ap-side {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  background: rgba(198, 255, 58, 0.1);
  color: var(--ap-gain);
}
.ap-side.sell {
  background: rgba(255, 93, 74, 0.12);
  color: var(--ap-loss);
}
.ap-p-n {
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ap-p-s {
  font-size: 0.72rem;
  color: var(--ap-mu);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-p .gauge {
  margin-top: 10px;
}
.ap-idle {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
}
.ap-idle i {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ap-mu);
}
.ap-idle.on i {
  background: var(--ap-ac);
  box-shadow: 0 0 0 0 rgba(212, 255, 58, 0.6);
  animation: ap-ping 2s infinite;
}
@keyframes ap-ping {
  70% {
    box-shadow: 0 0 0 10px rgba(212, 255, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 255, 58, 0);
  }
}

/* ================================================================== RÉGLAGES A */
.ap-set-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin: 4px 2px 2px;
}
.ap-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ap-sf2);
  border-radius: 16px;
  padding: 6px;
  margin-top: 10px;
}
.ap-stepper button {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--ap-ln);
  background: var(--ap-sf);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
}
.ap-stepper input {
  width: 100%;
  min-width: 0;
  text-align: center;
  background: transparent;
  border: 0;
  color: #fff;
  font: 800 1.7rem/1 var(--font);
  letter-spacing: -0.04em;
}
.ap-stepper input:focus {
  outline: none;
}
.ap-note {
  font-size: 0.76rem;
  color: var(--ap-mu);
  line-height: 1.45;
  margin-top: 8px;
}
.ap-note b {
  color: #d0d4ca;
}
.ap-lock {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(198, 255, 58, 0.08);
  font-size: 0.78rem;
  line-height: 1.45;
}
.ap-lock svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ap-gain);
}

/* ================================================================== mouvements réduits */
@media (prefers-reduced-motion: reduce) {
  .ap-slide .power,
  .ap-idle.on i {
    transition: none;
    animation: none;
  }
}
.ap-gap {
  margin-top: 8px;
}

/* entrée des écrans : fondu court et net (l'ancien effet flou faisait « IPA ») */
.view > *,
.view .cols > .stack > * {
  animation: ap-rise 260ms var(--ease) both;
  animation-delay: 0ms;
}
.view.still > *,
.view.still .cols > .stack > * {
  animation: none;
}
@keyframes ap-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
}

/* ================================================================== TRADES A */
.ap-trade {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ap-trade .ap-p-h > .grow {
  min-width: 0;
}
.ap-trade .ap-p-h b,
.ap-p-h b {
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ap-trade:active {
  transform: scale(0.99);
}
.ap-sum {
  padding: 14px 16px;
}
.ap-sum .ap-big {
  font-size: 2.2rem;
  margin-top: 4px;
}

/* le logo ne se tasse jamais (console sur téléphone : « Créateur · Console » passait dessus) */
.brand .logo-ap,
.ap-head .logo-ap {
  flex: none;
}
.brand {
  min-width: 0;
}

/* pavé du code : touches plates (pas de bulle lumineuse) */
.pinpad button {
  background: var(--ap-sf);
  border: 1px solid var(--ap-ln);
  box-shadow: none;
}
.pinpad button:active {
  background: var(--ap-sf2);
  border-color: rgba(212, 255, 58, 0.45);
}
.pinpad button.ghost {
  background: transparent;
  border-color: transparent;
}
