/* =============================================================================
   VTEX — Écran CARTES, refonte intégrale (protocole LEGDAY, fond nuit).

   L'ancien écran est supprimé, pas rapiécé : ici, chaque règle est nouvelle et
   strictement portée par #view-cartes, de sorte qu'aucune des 172 règles
   héritées des anciennes tuiles de cartes ne puisse plus repeindre quoi que ce
   soit. Les seules classes partagées avec le reste de l'application sont les
   jetons (--c-*), la bascule .toggle et le bouton rond d'en-tête.

   Lecture du fichier : 1. socles d'icônes · 2. structure · 3. en-tête
   4. pile 3D · 5. tuiles d'action · 6. réglages · 7. plafonds · 8. modales
   9. animations · 10. desktop.
   ============================================================================= */

/* ------------------------------------------------ 1. Socles d'icônes LEGDAY -- */
/* Un socle = une pastille teintée qui porte une icône. Une seule famille de
   socles pour toute l'application : c'est le rythme visuel des tuiles. */
.vtx-ic { display: block; flex: 0 0 auto; }
.vtx-ic-empty { display: block; flex: 0 0 auto; }

.vtx-socle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  background: var(--c-s2, #24211f);
  color: var(--c-t1, #f5f7fc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.vtx-socle-sm { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; }
.vtx-socle-neutral  { background: rgba(140, 150, 200, .12); color: var(--c-t1, #f5f7fc); }
.vtx-socle-accent   { background: var(--c-signature-dim, rgba(142, 169, 255, .16)); color: var(--c-accent, #8ea9ff); }
.vtx-socle-gold     { background: var(--c-gold-dim, rgba(230, 179, 78, .15)); color: var(--c-gold, #e6b34e); }
.vtx-socle-positive { background: var(--c-positive-dim, rgba(95, 176, 62, .14)); color: var(--c-positive, #5FB03E); }
.vtx-socle-warm     { background: rgba(232, 88, 32, .15); color: var(--c-orange, #E85820); }
.vtx-socle-danger   { background: rgba(239, 90, 103, .14); color: var(--c-red, #ef5a67); }
/* Pastille pleine : exactement l'identité des tuiles de l'accueil et de l'écran
   profil (fond coloré, icône blanche). La couleur vient de la succession
   LEGDAY, donc une même famille de teintes sur tous les écrans. */
.vtx-socle-tint {
  background-color: var(--tx-bg, #5A6BD8);
  background-image: linear-gradient(158deg, rgba(255, 255, 255, .24), rgba(0, 0, 0, .18));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 18px -14px rgba(5, 7, 20, .95);
}

/* --------------------------------------------------------- 2. Structure ------ */
#view-cartes {
  background: var(--c-bg, #100E0D);
  color: var(--c-t1, #f5f7fc);
}
#view-cartes .ct-shell {
  max-width: 760px;
  margin: 0 auto;
  /* La bulle de discussion flotte au-dessus du contenu : le dernier bloc garde
     de quoi passer dessous sans jamais être masqué. */
  padding-bottom: 88px;
  overflow-x: clip;
}

/* ------------------------------------------------------------ 3. En-tête ----- */
#view-cartes .vx-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 4px;
}
#view-cartes .vx-page-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  color: var(--c-t1, #f5f7fc);
}

.ct-lead {
  margin: 14px 2px 0;
  font-size: 13.5px; line-height: 1.5;
  color: var(--c-t2, #a8afd0);
}
.ct-lead b { color: var(--c-t1, #f5f7fc); font-weight: 600; }

.ct-count {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 12px 2px 0;
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-t3, #6b7396);
}
.ct-count i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-positive, #5FB03E);
  box-shadow: 0 0 0 4px rgba(95, 176, 62, .14);
}

/* --------------------------------------------- 4. Les cartes --------
   La face de carte est celle du Dashboard, copiée au caractère près dans
   carte-dashboard.css : mêmes assets (puce, sans contact, VISA, pastilles
   Mastercard), mêmes dégradés navy et teal, même géométrie en unités de
   conteneur. Ici, seule la scène qui les porte. */
.ct-stage { position: relative; margin: 20px 0 6px; }
#cartes3d-host { display: grid; }
.ct-stage-fallback { display: grid; gap: 18px; padding: 20px; border-radius: 22px;
  background: var(--c-s1, #141830); color: var(--c-t3, #8d6b96); font-size: 13px; }
.ct-stage-fallback[hidden] { display: none !important; }


/* ------------------------------------------------------- 5. Tuiles d'action -- */
.ct-block { margin-top: 26px; }
.ct-block-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 2px 12px;
}
.ct-block-hd h2 { flex: 1 1 auto; min-width: 0; }
/* L'icône de section : même socle que les tuiles, donc même succession. */
.ct-block-ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; }
.ct-block-ic .vtx-ic { width: 16px; height: 16px; }
.ct-block-hd h2 {
  margin: 0;
  font-size: 11.5px; font-weight: 650; letter-spacing: .15em; text-transform: uppercase;
  color: var(--c-t3, #6b7396);
}
.ct-block-note { font-size: 11.5px; color: var(--c-t3, #6b7396); }

.ct-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ct-tile {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0;
  padding: 12px 12px;
  text-align: left;
  border-radius: var(--r-lg, 20px);
  border: 1px solid var(--c-border, rgba(140, 150, 200, .14));
  background: var(--c-s1, #1a1817);
  color: var(--c-t1, #f5f7fc);
  box-shadow: var(--shadow-card, 0 10px 24px -10px rgba(5, 7, 20, .55));
  cursor: pointer;
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), background .18s ease, border-color .18s ease;
}
.ct-tile:hover { background: var(--c-s2, #24211f); }
.ct-tile:active { transform: scale(.982); }
.ct-tile:focus-visible { outline: 2px solid var(--c-accent, #8ea9ff); outline-offset: 2px; }
.ct-tile-body { min-width: 0; }
.ct-tile-label {
  display: block;
  font-size: 13px; font-weight: 620; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-tile-sub {
  /* Deux lignes plutôt qu'une ellipse : « 6 240,00 € disp… » n'informe personne.
     La coupe reste bornée, donc les tuiles d'une même rangée gardent la même hauteur. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 11.5px; line-height: 1.35; color: var(--c-t3, #6b7396);
}
.ct-tile.is-danger { border-color: rgba(239, 90, 103, .26); }
.ct-tile.is-danger .ct-tile-label { color: #ffb3ba; }
.ct-tile.is-primary {
  background: linear-gradient(150deg, rgba(90, 107, 216, .3), rgba(90, 107, 216, .08));
  border-color: rgba(90, 107, 216, .44);
}
.ct-tile.is-primary .ct-tile-label { color: #cfd6ff; }
.ct-tile.is-wide { grid-column: 1 / -1; }

/* --------------------------------------------------------------- 6. Réglages -- */
.ct-rows {
  border-radius: var(--r-lg, 20px);
  border: 1px solid var(--c-border, rgba(140, 150, 200, .14));
  background: var(--c-s1, #1a1817);
  box-shadow: var(--shadow-card, 0 10px 24px -10px rgba(5, 7, 20, .55));
  overflow: hidden;
}
.ct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--c-border, rgba(140, 150, 200, .14));
}
.ct-row:first-child { border-top: 0; }
.ct-row.is-button { cursor: pointer; transition: background .16s ease; }
.ct-row.is-button:hover { background: var(--c-s2, #24211f); }
.ct-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ct-row-txt { min-width: 0; }
.ct-row-name { display: block; font-size: 13.5px; font-weight: 570; }
.ct-row-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px; color: var(--c-t3, #6b7396);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-row.is-off .ct-row-name { color: var(--c-t2, #a8afd0); }
.ct-row-value {
  font-family: var(--f-mono, 'JetBrains Mono', monospace);
  font-size: 13px; color: var(--c-t2, #a8afd0);
}
.ct-chevron { color: var(--c-t3, #6b7396); flex: 0 0 auto; }

/* La bascule est celle de l'application (.toggle / .knob) : même geste, même
   couleur, sur tous les écrans. */
#view-cartes .toggle { cursor: pointer; }
#view-cartes .toggle.disabled { opacity: .38; cursor: not-allowed; }
#view-cartes .ct-row .toggle{display:inline-flex;align-items:center;flex:0 0 48px;width:48px;height:28px;padding:2px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid color-mix(in srgb,var(--tg-color) 42%,rgba(255,255,255,.2));box-shadow:inset 0 1px 2px rgba(0,0,0,.22);transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;}
#view-cartes .ct-row .toggle .knob{display:block;width:22px;height:22px;border-radius:50%;background:#c7cad8;box-shadow:0 2px 5px rgba(0,0,0,.32);transform:translateX(0);transition:transform .18s ease,background .18s ease;}
#view-cartes .ct-row .toggle.on{background:var(--tg-color);border-color:transparent;box-shadow:0 0 0 3px color-mix(in srgb,var(--tg-color) 20%,transparent),inset 0 1px 0 rgba(255,255,255,.25);}
#view-cartes .ct-row .toggle.on .knob{transform:translateX(20px);background:#fff;}
#view-cartes .ct-row .toggle.disabled{pointer-events:none;filter:saturate(.55);}
@supports not (color:color-mix(in srgb,red 50%,transparent)){
  #view-cartes .ct-row .toggle{border-color:rgba(255,255,255,.2);}
  #view-cartes .ct-row .toggle.on{border-color:transparent;}
}

/* --------------------------------------------------------------- 7. Plafonds -- */
.ct-caps { display: grid; gap: 10px; }
.ct-cap {
  padding: 14px;
  border-radius: var(--r-lg, 20px);
  border: 1px solid var(--c-border, rgba(140, 150, 200, .14));
  background: var(--c-s1, #1a1817);
}
.ct-cap-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ct-cap-ic { display: inline-flex; flex: 0 0 auto; }
.ct-cap-ic .vtx-socle { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; }
.ct-cap-hd .ct-cap-name { flex: 1 1 auto; min-width: 0; }
.ct-cap-hd .ct-cap-amount { flex: 0 0 auto; }
.ct-cap-name { font-size: 13px; font-weight: 560; }
.ct-cap-amount {
  font-family: var(--f-mono, 'JetBrains Mono', monospace);
  font-size: 13.5px; font-weight: 600;
  color: var(--c-t1, #f5f7fc);
}
.ct-cap-amount small { font-size: 10.5px; color: var(--c-t3, #6b7396); margin-left: 3px; }
.ct-cap-rail {
  margin-top: 10px;
  height: 5px; border-radius: 999px;
  background: rgba(140, 150, 200, .12);
  overflow: hidden;
}
.ct-cap-fill {
  display: block; height: 100%; border-radius: 999px;
  background: var(--ct-cap, var(--c-accent, #8ea9ff));
  opacity: .85;
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
}
.ct-cap-note {
  margin-top: 9px;
  font-size: 11px; color: var(--c-t3, #6b7396);
}

/* --------------------------------------------------------------- 8. Modales -- */
#view-cartes .pin-modal-mask {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  background: rgba(6, 6, 8, .62);
  backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .26s ease, visibility .26s ease;
}
#view-cartes .pin-modal-mask.show { opacity: 1; visibility: visible; }
#view-cartes .pin-modal {
  width: 100%; max-width: 460px;
  max-height: 92vh; overflow-y: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--c-border-mid, rgba(140, 150, 200, .22));
  border-bottom: 0;
  background: linear-gradient(165deg, var(--c-s2, #24211f), var(--c-bg, #100E0D) 62%);
  box-shadow: 0 -30px 70px -30px rgba(0, 0, 0, .9);
  transform: translateY(18px);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
#view-cartes .pin-modal-mask.show .pin-modal { transform: translateY(0); }

.ct-modal-grip {
  width: 44px; height: 4px; margin: 0 auto 16px;
  border-radius: 999px; background: rgba(140, 150, 200, .3);
}
.ct-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 6px;
}
.ct-modal-title {
  font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  color: var(--c-t1, #f5f7fc);
}
.ct-modal-sub {
  margin: 8px 0 0;
  font-size: 12.5px; line-height: 1.55; color: var(--c-t2, #a8afd0);
}
.ct-modal-actions { display: grid; gap: 10px; margin-top: 18px; }
.ct-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 16px;
  border-radius: var(--r-lg, 20px);
  border: 1px solid var(--c-border, rgba(140, 150, 200, .14));
  background: var(--c-s2, #24211f);
  color: var(--c-t1, #f5f7fc);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.ct-btn:hover { background: var(--c-s3, #2a2724); }
.ct-btn:active { transform: scale(.985); }
.ct-btn.is-primary {
  background: linear-gradient(150deg, #9db4ff, #7d95f0);
  border-color: rgba(142, 169, 255, .5);
  color: #0a0d1e;
  box-shadow: 0 14px 30px -16px rgba(142, 169, 255, .8);
}
.ct-btn.is-danger {
  background: rgba(239, 90, 103, .14);
  border-color: rgba(239, 90, 103, .32);
  color: #ffb3ba;
}
.ct-btn.is-ghost { background: transparent; color: var(--c-t2, #a8afd0); }

.ct-input {
  width: 100%; margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg, 20px);
  border: 1px solid var(--c-border-mid, rgba(140, 150, 200, .22));
  background: var(--c-s1, #1a1817);
  color: var(--c-t1, #f5f7fc);
  font-size: 15px; text-align: center;
}
.ct-input:focus { outline: 2px solid var(--c-accent, #8ea9ff); outline-offset: 1px; }

/* ------------------------------------------------------------ 9. Animations -- */
@keyframes ct-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#view-cartes.active .ct-reveal {
  animation: ct-rise .52s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: var(--ct-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  #view-cartes.active .ct-reveal { animation: none; }
  .ct-face, .cf { transition: none; }
}

/* -------------------------------------------------------------- 10. Desktop -- */
@media (min-width: 1024px) {
  #view-cartes .ct-shell { padding-top: 6px; }
  .ct-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ct-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .ct-tile-label { white-space: normal; }
  .ct-tile-sub { white-space: normal; }
  .ct-tile.is-wide { grid-column: span 2; flex-direction: row; align-items: center; }
  #view-cartes .pin-modal-mask { align-items: center; padding: 24px; }
  #view-cartes .pin-modal { border-radius: 28px; border-bottom: 1px solid var(--c-border-mid, rgba(140, 150, 200, .22)); }
  .ct-stage { max-width: 520px; margin-left: auto; margin-right: auto; }
  .ct-caps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------------
   Fenêtres de l'écran cartes : la croix et l'œil sont des commandes rondes du
   même métal que le reste — jamais le bouton gris du navigateur.
   --------------------------------------------------------------------------- */
.ct-modal-head .hd-round {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-border, rgba(140, 150, 200, .16));
  background: rgba(255, 255, 255, .055);
  color: var(--c-t2, #b9c2e0);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}
.ct-modal-head .hd-round:hover {
  background: rgba(255, 255, 255, .11);
  border-color: rgba(142, 169, 255, .34);
  color: var(--c-t1, #f5f7fc);
}
.ct-modal-head .hd-round:active { transform: scale(.94); }
.ct-modal-head .hd-round:focus-visible { outline: 2px solid var(--c-accent, #8ea9ff); outline-offset: 2px; }
/* L'œil ouvert signale que les informations sont visibles. */
.ct-modal-head .hd-round[aria-pressed="true"] {
  background: var(--c-signature-dim, rgba(142, 169, 255, .16));
  border-color: rgba(142, 169, 255, .45);
  color: var(--c-accent, #8ea9ff);
}

/* Sur téléphone, la note de section passe sous le titre au lieu de comprimer
   « Actions rapides » ou « Contrôles de paiement » sur deux lignes. */
@media (max-width: 600px) {
  #view-cartes .ct-block-hd { flex-wrap: wrap; align-items: flex-start; }
  #view-cartes .ct-block-note { flex: 1 0 100%; margin-top: 4px; padding-left: 42px; }
  #view-cartes .ct-face-legend { padding-right: 68px; }
}

/* ---------------------------------------------------------------------------
   Guide des cartes : une fiche éditoriale, quatre gestes expliqués.
   Le fond reste marine ; les accents suivent la carte, le plafond et les
   contrôles. Les illustrations sont décoratives, le texte porte le sens.
   --------------------------------------------------------------------------- */
#view-cartes .ct-lead-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 6px; padding: 0;
  border: 0; background: transparent;
  color: var(--c-accent, #8ea9ff);
  font: inherit; font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
#view-cartes .ct-lead-link:hover { color: #c8d4ff; }
#view-cartes .ct-lead-link:focus-visible { outline: 2px solid var(--c-accent, #8ea9ff); outline-offset: 3px; border-radius: 4px; }

#view-cartes .ctg-guide {
  position: relative;
  margin: 22px 0 8px;
  padding: 22px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(142, 169, 255, .2);
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(90, 107, 216, .2) 0%, transparent 46%),
    radial-gradient(90% 120% at 0% 100%, rgba(98, 184, 176, .12) 0%, transparent 48%),
    linear-gradient(155deg, #151C37 0%, #0D1225 58%, #10182C 100%);
  box-shadow: 0 24px 60px -34px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .045);
  scroll-margin-top: 18px;
}
#view-cartes .ctg-guide::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(142, 169, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 169, 255, .055) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent 72%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .8), transparent 72%);
}
#view-cartes .ctg-guide-hero {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(190px, .82fr);
  gap: 22px;
  align-items: center;
  padding-bottom: 20px;
}
#view-cartes .ctg-guide-copy { min-width: 0; }
#view-cartes .ctg-guide-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: #E6B34E;
  font-size: 10px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
}
#view-cartes .ctg-guide-kicker::before {
  content: ""; width: 18px; height: 1px;
  background: currentColor;
  box-shadow: 0 0 12px rgba(230, 179, 78, .65);
}
#view-cartes .ctg-guide-title {
  margin: 10px 0 0;
  color: var(--c-t1, #f5f7fc);
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.035em;
  text-wrap: balance;
}
#view-cartes .ctg-guide-lead {
  max-width: 58ch;
  margin: 12px 0 0;
  color: var(--c-t2, #b7bfdc);
  font-size: 13px;
  line-height: 1.65;
}
#view-cartes .ctg-guide-actions {
  display: flex; flex-wrap: wrap; gap: 9px;
  margin-top: 17px;
}
#view-cartes .ctg-guide-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(142, 169, 255, .28);
  background: rgba(255, 255, 255, .045);
  color: var(--c-t1, #f5f7fc);
  font-size: 12px; font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
#view-cartes .ctg-guide-btn:hover { background: rgba(255, 255, 255, .09); border-color: rgba(142, 169, 255, .5); }
#view-cartes .ctg-guide-btn:active { transform: scale(.985); }
#view-cartes .ctg-guide-btn:focus-visible { outline: 2px solid var(--c-accent, #8ea9ff); outline-offset: 2px; }
#view-cartes .ctg-guide-btn.is-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #8EA9FF 0%, #62B8B0 100%);
  color: #0A0D1E;
  box-shadow: 0 12px 26px -16px rgba(142, 169, 255, .9);
}
#view-cartes .ctg-guide-art {
  margin: 0; min-width: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(142, 169, 255, .16);
  background: rgba(5, 8, 18, .42);
  box-shadow: 0 18px 36px -24px rgba(0, 0, 0, .9);
}
#view-cartes .ctg-guide-art img { display: block; width: 100%; height: auto; }
#view-cartes .ctg-guide-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#view-cartes .ctg-guide-card {
  --ctg-accent: #8EA9FF;
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .085);
  background: linear-gradient(155deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  scroll-margin-top: 18px;
}
#view-cartes .ctg-guide-card::before {
  content: "";
  position: absolute; top: 0; left: 16px; right: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--ctg-accent), transparent 72%);
  opacity: .9;
}
#view-cartes .ctg-guide-card--signature { --ctg-accent: #62B8B0; }
#view-cartes .ctg-guide-card--limit { --ctg-accent: #E6B34E; }
#view-cartes .ctg-guide-card--controls { --ctg-accent: #5FB03E; }
#view-cartes .ctg-guide-card--replace { --ctg-accent: #EF5A67; }
#view-cartes .ctg-guide-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: var(--ctg-accent);
  font-family: var(--f-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 10px; font-weight: 800;
  letter-spacing: .06em;
}
#view-cartes .ctg-guide-card h3 {
  margin: 10px 0 0;
  color: var(--c-t1, #f5f7fc);
  font-size: 15px; line-height: 1.25;
  font-weight: 750; letter-spacing: -.015em;
}
#view-cartes .ctg-guide-card p {
  margin: 8px 0 0;
  color: var(--c-t2, #b7bfdc);
  font-size: 12px; line-height: 1.62;
}
#view-cartes .ctg-guide-card figure {
  margin: 14px 0 0;
  padding: 7px;
  border-radius: 16px;
  border: 1px solid rgba(142, 169, 255, .12);
  background: rgba(5, 8, 18, .38);
  overflow: hidden;
}
#view-cartes .ctg-guide-card figure img { display: block; width: 100%; height: auto; }
#view-cartes .ctg-guide-card--replace {
  justify-content: flex-start;
  background:
    radial-gradient(120% 120% at 100% 100%, rgba(239, 90, 103, .12), transparent 54%),
    linear-gradient(155deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
}
#view-cartes .ctg-guide-note {
  position: relative; z-index: 1;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(142, 169, 255, .14);
  color: var(--c-t3, #8d98bd);
  font-size: 11px; line-height: 1.6;
}
@media (max-width: 760px) {
  #view-cartes .ctg-guide { padding: 17px; border-radius: 24px; }
  #view-cartes .ctg-guide-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #view-cartes .ctg-guide-art { max-width: 420px; }
  #view-cartes .ctg-guide-grid { grid-template-columns: minmax(0, 1fr); }
  #view-cartes .ctg-guide-title { font-size: 24px; }
  #view-cartes .ctg-guide-lead { font-size: 12.5px; }
}
@media (max-width: 380px) {
  #view-cartes .ctg-guide { padding: 14px; border-radius: 22px; }
  #view-cartes .ctg-guide-title { font-size: 21px; }
  #view-cartes .ctg-guide-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  #view-cartes .ctg-guide-btn { width: 100%; }
  #view-cartes .ctg-guide-card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #view-cartes .ctg-guide-btn { transition: none; }
  #view-cartes .ctg-guide-btn:active { transform: none; }
}

@media (max-width: 380px) {
  #view-cartes .ct-row-sub { white-space: normal; line-height: 1.35; }
}

@media (max-width: 1100px) {
  #view-cartes .ctg-guide-hero { grid-template-columns: minmax(0, 1fr); }
  #view-cartes .ctg-guide-art { max-width: 420px; }
}

/* L'essentiel des cartes : trois repères avant la pile 3D. */
#view-cartes .ct-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
#view-cartes .ct-fact {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}
#view-cartes .ct-fact-ic { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 10px; }
#view-cartes .ct-fact b { min-width: 0; color: var(--c-t1, #f5f7fc); font-size: 11px; line-height: 1.25; font-weight: 750; }
#view-cartes .ct-fact small { min-width: 0; color: var(--c-t3, #8d98bd); font-size: 9.5px; line-height: 1.35; }
@media (max-width: 760px) {
  #view-cartes .ct-facts { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #view-cartes .ct-fact { grid-template-columns: 32px minmax(0, 1fr); padding: 10px 11px; }
  #view-cartes .ct-fact b { font-size: 11px; }
  #view-cartes .ct-fact small { font-size: 9.5px; }
}
