/* ==========================================================================
   Wallet — système de design
   ========================================================================== */

/* Inter : police libre (SIL OFL) très proche de San Francisco, utilisée sur les
   appareils qui n'ont pas la police d'Apple (Android, Windows…). */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Thème clair par défaut ; le thème sombre suit le réglage du téléphone
   (prefers-color-scheme). Couleurs système iOS. */
:root {
  --bg: #f2f2f7;
  --elev: #fff;
  --elev-2: #f2f2f7;
  --elev-3: #e5e5ea;
  --sheet-bg: #f2f2f7;
  --sheet-group: #fff;
  --sep: rgba(60, 60, 67, .29);
  --label: #000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --fill: rgba(118, 118, 128, .12);
  --press: rgba(0, 0, 0, .06);
  --btn-bg: #fff;
  --btn-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 18px rgba(0, 0, 0, .08);
  --glass: rgba(255, 255, 255, .9);
  --glass-shadow: 0 8px 30px rgba(0, 0, 0, .16);
  --seg-on: #fff;
  --switch-off: rgba(120, 120, 128, .16);
  --card-shadow: rgba(0, 0, 0, .18);
  --backdrop: rgba(0, 0, 0, .3);
  color-scheme: light;

  --r-group: 26px;
  --gutter: 16px;
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.2, .85, .25, 1);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);

  --sat-bar: max(var(--sat), 10px);

  /* Sur iPhone et Mac, -apple-system = San Francisco (SF Pro), la police du
     système. Ailleurs, ces noms sont ignorés et c'est Inter qui s'affiche. */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Inter", system-ui, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  /* Grands montants : San Francisco Rounded sur iPhone et Mac (ui-rounded). */
  --font-rounded: ui-rounded, "SF Pro Rounded", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --elev: #1c1c1e;
    --elev-2: #2c2c2e;
    --elev-3: #3a3a3c;
    --sheet-bg: #1c1c1e;
    --sheet-group: #2c2c2e;
    --sep: rgba(84, 84, 88, .65);
    --label: #fff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --orange: #ff9f0a;
    --fill: rgba(118, 118, 128, .24);
    --press: rgba(255, 255, 255, .07);
    --btn-bg: #1c1c1e;
    --btn-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .08);
    --glass: rgba(44, 44, 46, .9);
    --glass-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    --seg-on: #636366;
    --switch-off: #39393d;
    --card-shadow: rgba(0, 0, 0, .4);
    --backdrop: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

/* --- Barres du haut ------------------------------------------------------ */

.bar {
  position: relative;
  flex: none;
  height: calc(var(--sat-bar) + 60px);
}

.bar-row {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 14px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity .25s ease;
}

.title-lg {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: .37px;
}

.btn-group { display: flex; gap: 12px; }

.btn-round, .btn-capsule {
  height: 44px;
  flex: none;
  border-radius: 22px;
  background: var(--btn-bg);
  box-shadow: var(--btn-shadow);
}
.btn-round {
  width: 44px;
  display: grid;
  place-items: center;
  transition: transform .15s ease;
}
.btn-round svg, .btn-capsule svg { width: 24px; height: 24px; }
.btn-round:active { transform: scale(.92); }

/* Recherche + options réunies dans une seule pastille */
.btn-capsule { display: flex; }
.btn-capsule button { width: 50px; height: 44px; display: grid; place-items: center; transition: opacity .15s ease; }
.btn-capsule button:active { opacity: .4; }

/* --- Accueil : pile de cartes ------------------------------------------- */

.home { position: absolute; inset: 0; display: flex; flex-direction: column; isolation: isolate; }

.home .bar-row--detail { opacity: 0; pointer-events: none; }
.home.is-detail .bar-row--home { opacity: 0; pointer-events: none; }
.home.is-detail .bar-row--detail { opacity: 1; pointer-events: auto; }

.home-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px calc(var(--sab) + 28px);
  scrollbar-width: none;
}
.home-scroll::-webkit-scrollbar, .screen-scroll::-webkit-scrollbar, .models::-webkit-scrollbar { display: none; }

.stack { position: relative; }

.stack .card {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  transform: translate3d(0, var(--y, 0px), 0);
  transition: transform .58s var(--ease-spring);
  will-change: transform;
  cursor: pointer;
}
.stack.no-anim .card { transition: none; }
.stack .card.is-gone { display: none; }

/* --- Carte --------------------------------------------------------------- */

.card {
  position: relative;
  display: block;
  aspect-ratio: 1.586;
  container-type: inline-size;
  color: var(--fg, #fff);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 3.9cqw;
  overflow: hidden;
  background: #2c2c2e;
  box-shadow: 0 -1.2cqw 3.6cqw var(--card-shadow);
  transition: box-shadow .4s ease;
}
/* Carte ouverte : l'ombre passe dessous, comme une carte posée. */
.home.is-detail .stack .card:not(.is-away) .card-face { box-shadow: 0 2.4cqw 6cqw var(--card-shadow); }
.card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .28);
  pointer-events: none;
}

.card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.card-top {
  position: absolute;
  left: 5cqw;
  right: 5cqw;
  top: 3.9cqw;
  height: 7.4cqw;
  display: flex;
  align-items: center;
  gap: 2.4cqw;
}
.card-logo { width: 7.4cqw; height: 7.4cqw; flex: none; object-fit: contain; }
.card-logo.is-tint {
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}
.card-bank {
  font-size: 4.5cqw;
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-label {
  margin-left: auto;
  padding-left: 2cqw;
  font-size: 2.9cqw;
  line-height: 1;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: .78;
}

/* Quatre derniers chiffres, en bas à gauche */
.card-number {
  position: absolute;
  left: 5.6cqw;
  bottom: 5cqw;
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  font-size: 4.7cqw;
  line-height: 1.2;
  letter-spacing: .02em;
}
.card-dots { font-size: 3.3cqw; letter-spacing: .38em; margin-right: -.38em; }

/* --- Détail d'une carte -------------------------------------------------- */

.detail { display: none; padding-top: 28px; }
.home.is-detail .detail { display: block; animation: rise .5s .1s var(--ease-spring) both; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to { opacity: 1; transform: none; }
}

.h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: .35px;
  margin: 0 16px 10px;
}
.h2-row { display: flex; align-items: baseline; justify-content: space-between; margin: 0 16px 10px; }
.h2-row .h2 { margin: 0; }

.group {
  background: var(--elev);
  border-radius: var(--r-group);
  overflow: hidden;
}
.group + .group { margin-top: 16px; }

.row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 15px 16px 12px;
  text-align: left;
}
.row + .row::before, .cell + .cell::before, .field + .field::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: .5px;
  background: var(--sep);
}
/* Le séparateur démarre sous le texte quand la ligne a une vignette à gauche. */
.row:has(> .thumb) + .row::before { left: 86px; }
button.row:active, button.cell:active { background: var(--press); }

.row-main { flex: 1; min-width: 0; display: block; }
.row-title {
  display: block;
  font-size: 17px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -.43px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  display: block;
  font-size: 15px;
  line-height: 17px;
  letter-spacing: -.23px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub.is-declined { color: var(--red); }
.row-sub.is-pending { color: var(--orange); }
.row-amount {
  flex: none;
  font-size: 17px;
  line-height: 20px;
  letter-spacing: -.43px;
  white-space: nowrap;
}
.row-amount.is-declined { text-decoration: line-through; color: var(--label-2); }
.row-amount.is-credit { color: var(--green); }
.row > .chev { margin-top: 4px; margin-left: -2px; }
.row--center { align-items: center; }
.row--center > .chev { margin-top: 0; }
.row--link { align-items: center; justify-content: center; min-height: 50px; padding: 12px 16px; color: var(--blue); font-size: 17px; }

.chev { width: 7px; height: 12px; flex: none; color: var(--label-3); }

.field-none { color: var(--label-3); font-size: 17px; }

.tx-icon {
  width: 40px;
  height: 40px;
  flex: none;
  align-self: center;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  background: var(--elev-2);
}

.placeholder { padding: 28px 20px; text-align: center; color: var(--label-2); font-size: 15px; line-height: 20px; }

.balance { margin-bottom: 26px; }
.balance .row { align-items: center; padding: 14px 16px; }
.balance-label { font-size: 15px; color: var(--label-2); flex: 1; }
.balance-value { font-family: var(--font-rounded); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: 0; }

.detail-actions { display: flex; justify-content: space-between; padding: 14px 16px 0; }
.link-btn { color: var(--blue); font-size: 17px; letter-spacing: -.43px; padding: 6px 0; }
.link-btn:active { opacity: .5; }

/* --- État vide ----------------------------------------------------------- */

.empty { padding: 18vh 24px 0; text-align: center; }
.empty img { width: 84px; height: 84px; border-radius: 20px; }
.empty h2 { font-size: 22px; line-height: 28px; font-weight: 700; margin: 20px 0 6px; }
.empty p { color: var(--label-2); font-size: 15px; line-height: 20px; margin-bottom: 24px; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 28px;
  border-radius: 25px;
  background: var(--label);
  color: var(--bg);
  font-weight: 600;
  font-size: 17px;
}
.pill:active { opacity: .7; }

/* --- Écrans empilés ------------------------------------------------------ */

#layers, #overlays { position: absolute; inset: 0; pointer-events: none; }
#layers { z-index: 10; }
#overlays { z-index: 20; }
#layers > *, #overlays > * { pointer-events: auto; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  isolation: isolate;
}

.screen--push {
  transform: translate3d(100%, 0, 0);
  transition: transform .45s var(--ease-ios);
  box-shadow: -20px 0 40px rgba(0, 0, 0, .25);
}
.screen--push.is-in { transform: none; }

.screen--fade { opacity: 0; transition: opacity .22s ease; }
.screen--fade.is-in { opacity: 1; }

.screen--sheet { background: transparent; }
.screen--sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity .35s ease;
}
.screen--sheet.is-in::before { opacity: 1; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(var(--sat) + 12px);
  display: flex;
  flex-direction: column;
  background: var(--sheet-bg);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform .5s var(--ease-ios);
}
.screen--sheet.is-in .sheet { transform: none; }
.sheet .group { background: var(--sheet-group); }
.sheet .tx-icon { background: var(--elev-3); }

.screen-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--gutter) calc(var(--sab) + 36px);
  scrollbar-width: none;
}

.nav {
  flex: none;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 var(--gutter);
}
.nav-title { min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.43px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-side { display: flex; min-width: 0; }
.nav-side--end { justify-content: flex-end; }
.nav-btn { font-size: 17px; letter-spacing: -.43px; padding: 8px 0; white-space: nowrap; }
.nav-btn.is-strong { font-weight: 600; }
.nav-btn:active { opacity: .5; }

.section-label {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -.08px;
  text-transform: uppercase;
  color: var(--label-2);
  margin: 24px 16px 7px;
}
.section-label:first-child { margin-top: 6px; }
.footnote { font-size: 13px; line-height: 16px; letter-spacing: -.08px; color: var(--label-2); margin: 7px 16px 0; }
.lead { font-size: 13px; line-height: 18px; letter-spacing: -.08px; color: var(--label-2); margin: 0 16px 14px; }
.footnote + .group, .group + .section-label { margin-top: 24px; }

/* Cellules génériques (listes de réglages, infos) */
.cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  text-align: left;
  font-size: 17px;
  letter-spacing: -.43px;
}
.cell--stack { display: block; }
.cell--state { padding-bottom: 13px; }
.cell--state .cell-sub { font-size: 17px; line-height: 23px; letter-spacing: -.43px; }
.cell--total { min-height: 43px; padding-top: 10px; padding-bottom: 10px; }
/* Entre deux liens, le séparateur va d'un bord à l'autre. */
.cell--link + .cell--link::before, .cell--link + .cell--danger::before { left: 0; right: 0; }
.cell-title { font-weight: 600; }
.cell-sub { display: block; font-size: 15px; line-height: 20px; color: var(--label-2); letter-spacing: -.23px; }
.cell-sub--wrap { white-space: normal; }
.cell-grow { flex: 1; min-width: 0; }
.cell-value { color: var(--label-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell--link { color: var(--blue); }
.cell--danger { color: var(--red); }
.cell--center { justify-content: center; }
.cell svg:not(.chev) { width: 22px; height: 22px; flex: none; }

/* --- Détail d'une transaction -------------------------------------------- */

.txd-head { text-align: center; margin-top: -5px; padding: 0 0 38px; }
.txd-amount {
  font-family: var(--font-rounded);
  font-size: 66px; /* réduit automatiquement pour les grands montants */
  line-height: 70px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.txd-amount.is-declined { text-decoration: line-through; color: var(--label-2); }
.txd-amount.is-credit { color: var(--green); }
.txd-meta { font-size: 17px; line-height: 22px; color: var(--label-2); letter-spacing: -.43px; }
.txd-meta + .txd-meta { margin-top: 1px; }

/* --- Recherche ----------------------------------------------------------- */

.search-scroll { padding-top: calc(var(--sat) + 22px); padding-bottom: calc(var(--kb, 0px) + var(--sab) + 96px); }
.search-scroll .h2 { margin-top: 26px; }
.search-scroll .h2:first-child, .search-scroll .h2-row:first-child { margin-top: 0; }
.search-scroll .h2-row { margin-top: 26px; }

.suggest {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font-size: 17px;
  letter-spacing: -.43px;
}
.suggest svg { width: 19px; height: 19px; color: var(--label-2); }
.suggest + .suggest::before { content: ""; position: absolute; top: 0; left: 47px; right: 16px; height: .5px; background: var(--sep); }
.suggest:active { opacity: .5; }

.searchbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--kb, 0px) + max(var(--sab), 12px));
  display: flex;
  gap: 8px;
  z-index: 3;
}
.search-field {
  flex: 1;
  min-width: 0;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--glass-shadow);
}
.search-field svg { width: 18px; height: 18px; flex: none; color: var(--label-2); }
.search-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; padding: 0; }
.search-field input::placeholder { color: var(--label-2); }
.search-field input::-webkit-search-cancel-button { display: none; }
.searchbar .btn-round { width: 48px; height: 48px; border-radius: 24px; background: var(--glass); box-shadow: var(--glass-shadow); }

.thumb { width: 58px; flex: none; align-self: center; }
.bank-logo { width: 58px; height: 37px; flex: none; align-self: center; object-fit: contain; border-radius: 6px; }
.row:has(> .bank-logo) + .row::before { left: 86px; }
.thumb .card-face { box-shadow: none; }

/* --- Formulaires --------------------------------------------------------- */

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
}
.field-label { flex: none; font-size: 17px; letter-spacing: -.43px; padding: 8px 0; }
.field-label small { display: block; font-size: 12px; line-height: 15px; color: var(--label-2); letter-spacing: 0; }
.field input:not([type=checkbox]), .field select {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 48px;
  padding: 0;
  background: none;
  border: 0;
  outline: 0;
  border-radius: 0;
  font-size: 17px;
  letter-spacing: -.43px;
  text-align: right;
  text-align-last: right;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder { color: var(--label-3); }
.field select option { background: var(--sheet-group); color: var(--label); }
.field input[type=datetime-local] { min-width: 0; }
.field input[type=datetime-local]::-webkit-date-and-time-value { text-align: right; }
.field-btn { flex: none; color: var(--blue); font-size: 15px; padding: 6px 0 6px 4px; }
.field-btn:active { opacity: .5; }
.field--end { justify-content: space-between; }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--switch-off); transition: background .2s ease; pointer-events: none; }
.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
  transition: transform .2s ease;
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

.seg { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { flex: 1; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; text-align: center; white-space: nowrap; }
.seg button.is-on { background: var(--seg-on); box-shadow: 0 1px 4px rgba(0, 0, 0, .14); font-weight: 600; }
.seg--block { margin: 0; }
.seg--block button { height: 34px; font-size: 15px; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 10px 12px 12px; position: relative; }
.emoji-grid::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: .5px; background: var(--sep); }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 22px; line-height: 1; text-align: center; }
.emoji-grid button.is-on { background: var(--elev-3); }

.form-preview { padding: 4px 28px 0; }
.form-preview .card-face { box-shadow: 0 10px 30px var(--card-shadow); }

.models {
  display: flex;
  gap: 12px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 2px;
  overflow: auto hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.model { flex: none; width: 124px; text-align: center; font-size: 13px; line-height: 18px; color: var(--label-2); }
.model .card { margin-bottom: 8px; border-radius: 7px; outline: 2.5px solid transparent; outline-offset: 3px; transition: outline-color .15s ease; }
.model .card-face { box-shadow: none; }
.model.is-on { color: var(--label); font-weight: 600; }
.model.is-on .card { outline-color: var(--blue); }

/* Grille des modèles d'une banque */
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.model-grid .placeholder { grid-column: 1 / -1; }
.model-cell { min-width: 0; text-align: center; font-size: 13px; line-height: 17px; color: var(--label-2); }
.model-cell .card { margin-bottom: 7px; border-radius: 8px; outline: 2.5px solid transparent; outline-offset: 3px; }
.model-cell .card-face { box-shadow: 0 2px 8px var(--card-shadow); }
.model-cell > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.model-cell.is-on { color: var(--label); font-weight: 600; }
.model-cell.is-on .card { outline-color: var(--blue); }
.model-cell:active { opacity: .6; }

/* --- Banques ------------------------------------------------------------- */

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  margin-bottom: 16px;
  border-radius: 11px;
  background: var(--fill);
}
.search-inline svg { width: 17px; height: 17px; color: var(--label-2); flex: none; }
.search-inline input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; padding: 0; }
.search-inline input::placeholder { color: var(--label-2); }

/* --- Réorganisation ------------------------------------------------------ */

.reorder { position: relative; }
.reorder-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 0 8px 0 16px;
  background: var(--sheet-group);
  transition: transform .2s ease;
}
.reorder-row + .reorder-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; height: .5px; background: var(--sep); }
.reorder-row.is-dragging { z-index: 2; transition: none; background: var(--elev-3); box-shadow: var(--glass-shadow); }
.reorder-row.is-dragging::before, .reorder-row.is-dragging + .reorder-row::before { display: none; }
.drag-handle { width: 44px; height: 44px; display: grid; place-items: center; color: var(--label-3); touch-action: none; cursor: grab; }
.drag-handle svg { width: 22px; height: 22px; }

/* --- Réglages ------------------------------------------------------------ */

.about { display: flex; align-items: center; gap: 14px; padding: 4px 4px 22px; }
.about img { width: 60px; height: 60px; border-radius: 14px; }
.about strong { display: block; font-size: 22px; line-height: 28px; font-weight: 700; }
.about span { font-size: 15px; color: var(--label-2); }

.notice {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 16px;
  border: .5px solid var(--sep);
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}

/* --- Menus, feuilles d'action, toasts ------------------------------------ */

.menu-wrap { position: absolute; inset: 0; z-index: 50; }
.menu {
  position: absolute;
  min-width: 250px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--glass-shadow);
  transform-origin: top right;
  transform: scale(.5);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.15), opacity .16s ease;
}
.menu-wrap.is-in .menu { transform: none; opacity: 1; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 17px;
  letter-spacing: -.43px;
}
.menu-item + .menu-item { border-top: .5px solid var(--sep); }
.menu-item svg { width: 20px; height: 20px; flex: none; }
.menu-item.is-danger { color: var(--red); }
.menu-item:active { background: var(--press); }

.as-wrap {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0);
  transition: background .25s ease;
}
.as-wrap.is-in { background: var(--backdrop); }
.as { width: 100%; padding: 0 8px calc(var(--sab) + 8px); transform: translate3d(0, 105%, 0); transition: transform .38s var(--ease-ios); }
.as-wrap.is-in .as { transform: none; }
.as-group { border-radius: 14px; overflow: hidden; background: var(--glass); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.as-head { padding: 14px 16px; text-align: center; font-size: 13px; line-height: 18px; color: var(--label-2); }
.as-head b { display: block; font-weight: 600; }
.as-btn { display: block; width: 100%; height: 57px; font-size: 20px; text-align: center; color: var(--blue); }
.as-group .as-btn { border-top: .5px solid var(--sep); }
.as-group .as-btn:first-child { border-top: 0; }
.as-btn.is-danger { color: var(--red); }
.as-btn:active { background: var(--press); }
.as-cancel { margin-top: 8px; border-radius: 14px; background: var(--sheet-group); font-weight: 600; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--sab) + 44px);
  z-index: 70;
  max-width: 84%;
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(58, 58, 60, .96);
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  font-size: 15px;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* --- Écran de clé d'accès ------------------------------------------------- */

.gate {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--sat) + 12vh) 28px calc(var(--sab) + 24px);
  overflow: hidden auto;
  scrollbar-width: none;
  background: var(--bg);
  text-align: center;
  transition: opacity .3s ease;
}
.gate.is-leaving { opacity: 0; pointer-events: none; }
.gate-logo { width: 84px; height: 84px; border-radius: 20px; }
.gate-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; margin-top: 18px; }
.gate-lead { font-size: 17px; line-height: 22px; letter-spacing: -.43px; color: var(--label-2); margin: 6px 0 28px; }
.gate-form { width: 100%; max-width: 360px; }
.gate-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  border-radius: 14px;
  background: var(--elev);
  font-size: 17px;
  letter-spacing: .02em;
  text-align: center;
  text-transform: uppercase;
}
.gate-input::placeholder { color: var(--label-3); text-transform: none; letter-spacing: -.43px; }
.gate-error { min-height: 20px; margin: 10px 0 12px; font-size: 15px; line-height: 20px; color: var(--red); }
.gate-submit { width: 100%; }
.gate-submit:disabled { opacity: .5; }
.gate-hint { max-width: 360px; margin: 22px 0 4px; font-size: 13px; line-height: 18px; color: var(--label-2); }
.gate .link-btn { margin-top: 14px; font-size: 15px; text-decoration: none; }
.gate-foot { margin-top: auto; padding-top: 28px; font-size: 13px; line-height: 18px; color: var(--label-3); }

.boot-error { padding: calc(var(--sat) + 80px) 28px 0; text-align: center; color: var(--label-2); font-size: 15px; line-height: 20px; }
.boot-error b { display: block; color: var(--label); font-size: 20px; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
