/* Mes Comptes v2 « Fusion » : base sombre façon néobanque, bords marqués, ombres pleines, couleurs vives.
   Couleurs : un seul jeu de variables, puis le mode sombre, le noir intégral et les palettes (noms partagés avec la v1 via Firebase). */
:root {
  --bg: #f4f1ff;
  --surface: #ffffff;
  --sunken: #eeeafb;
  --line: #ddd6f3;
  --edge: #1d1838;
  --shc: #1d1838;
  --fg: #1d1838;
  --muted: #5e5880;
  --hero: #5b2ee6;
  --hero2: #3b1da6;
  --hero-fg: #ffffff;
  --hero-soft: rgba(255, 255, 255, 0.18);
  --hero-neg: #c2412d;
  --hero-neg2: #7e1f12;
  --accent: #c8f560;
  --accent-fg: #0e0f16;
  --accent-ink: var(--hero);
  --sun: #ffc93c;
  --coral: #ff6a4d;
  --mint: #2bc48a;
  --sky: #8ab4ff;
  --debit: #c4261d;
  --credit: #11734f;
  --shadow: 0 4px 0 var(--shc);
  --shadow-s: 0 3px 0 var(--shc);
  --display: "Nunito", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, sans-serif;
  --numf: "Space Grotesk", "Nunito", system-ui, sans-serif;
  --c1: #8b6cff;
  --c2: #ff8a73;
  --c3: #ffc93c;
  --c4: #2bc48a;
  --c5: #8ab4ff;
  --c6: #ff8fa3;
  --c7: #7ed8e0;
  --c8: #a7aabd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f16;
    --surface: #181a24;
    --sunken: #20232f;
    --line: #2a2e3e;
    --edge: #2e3244;
    --shc: #05060a;
    --fg: #f4f3fa;
    --muted: #a7aabd;
    --hero-soft: rgba(255, 255, 255, 0.14);
    --accent-ink: var(--accent);
    --mint: #7fe0a8;
    --debit: #ff8a73;
    --credit: #9be27a;
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-oled] {
    --bg: #000;
    --surface: #0f1017;
    --sunken: #181a23;
    --line: #23263a;
    --edge: #262a3a;
    --shc: #000;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0f16;
  --surface: #181a24;
  --sunken: #20232f;
  --line: #2a2e3e;
  --edge: #2e3244;
  --shc: #05060a;
  --fg: #f4f3fa;
  --muted: #a7aabd;
  --hero-soft: rgba(255, 255, 255, 0.14);
  --accent-ink: var(--accent);
  --mint: #7fe0a8;
  --debit: #ff8a73;
  --credit: #9be27a;
  color-scheme: dark;
}
:root[data-theme="dark"][data-oled] {
  --bg: #000;
  --surface: #0f1017;
  --sunken: #181a23;
  --line: #23263a;
  --edge: #262a3a;
  --shc: #000;
}
/* palettes : couleur de la grande carte + couleur des boutons */
:root[data-palette="menthe"] {
  --hero: #0f7b6c;
  --hero2: #0a4d44;
  --accent: #7fe0a8;
}
:root[data-palette="ocean"] {
  --hero: #1e5fd8;
  --hero2: #143b8c;
  --accent: #8ab4ff;
}
:root[data-palette="nuit"] {
  --hero: #2e3350;
  --hero2: #171a2c;
  --accent: #b3a0ff;
}
:root[data-palette="prune"] {
  --hero: #8a2e8c;
  --hero2: #521a55;
  --accent: #ff8fa3;
}
:root[data-palette="corail"] {
  --hero: #d2463a;
  --hero2: #8a2219;
  --accent: #ffc93c;
  --hero-neg: #6b1f54;
  --hero-neg2: #3a0f2d;
}
:root[data-palette="soleil"] {
  --hero: #c0650a;
  --hero2: #7a3d05;
  --accent: #ffc93c;
}
:root[data-palette="automne"] {
  --hero: #9a4722;
  --hero2: #5a2610;
  --accent: #ffb15c;
}

/* ---------- base et composants ---------- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
img {
  max-width: 100%;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* no pinch zoom and no double-tap zoom; scrolling and text selection in fields still work */
  touch-action: pan-x pan-y;
}
body {
  margin: 0;
  color: var(--fg);
  font-family: var(--body);
  line-height: 1.45;
  min-height: 100vh;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 10;
}
/* auth */
.auth {
  max-width: 420px;
  margin: 6vh auto 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth .logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: block;
}
.auth h1 {
  font-size: 2rem;
  font-weight: 900;
}
.auth form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth .err {
  color: var(--debit);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}
.auth .ok {
  color: var(--credit);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}
.linkbtn {
  border: 0;
  background: none;
  font-weight: 700;
  padding: 6px 0;
  align-self: flex-start;
}
.acct {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.acct .who {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.me {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid var(--edge);
  font-family: var(--numf);
}
#logout {
  color: var(--debit);
}
.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wrap {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  margin: 0;
  text-wrap: balance;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea {
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--sunken);
  padding: 11px 12px;
  width: 100%;
}
input:focus,
textarea:focus {
  background: var(--surface);
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 64px;
}

/* month header */
.top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top .ttl {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.top .hello {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 800;
}
.top h1 {
  text-transform: capitalize;
}
.round {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--edge);
  border-radius: 15px;
  box-shadow: var(--shadow-s);
  background: var(--surface);
}
.round svg {
  width: 20px;
  height: 20px;
}

/* hero */
.hero {
  color: var(--hero-fg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero2) 100%);
  border: 2px solid var(--edge);
  box-shadow: 0 6px 0 var(--shc);
  border-radius: 28px;
  padding: 20px;
  transition: background 0.4s;
}
.hero.alert .big {
  animation: nudge 0.5s ease-out;
}
@keyframes nudge {
  0%,
  100% {
    transform: none;
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}
.gauge {
  position: relative;
  display: flex;
  border-radius: 99px;
  overflow: hidden;
  height: 18px;
  border: 2px solid #14102a;
  background: rgba(255, 255, 255, 0.16);
  gap: 0;
}
.gauge .g-over {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, var(--hero-fg) 0 4px, transparent 4px 8px);
  opacity: 0.55;
}
.short {
  display: none;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
  margin-top: 6px;
  font-weight: 800;
}
.hero.alert .short {
  display: block;
}
.flow .box.now.negbox {
  background: color-mix(in srgb, var(--debit) 16%, var(--surface));
}
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  right: -60px;
  top: -70px;
  width: 200px;
  height: 200px;
  background: none;
  border: 30px solid rgba(255, 255, 255, 0.06);
}
.hero .lab {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.9;
}
.hero .big {
  line-height: 1;
  margin-top: 4px;
  font-weight: 700;
  font-size: 3.1rem;
  letter-spacing: -0.045em;
  text-shadow: none;
}
.mood {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 900;
  padding: 5px 12px;
}
.gauge i {
  display: block;
  height: 100%;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
}
.legend b {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  border: 1.5px solid #14102a;
}

/* cards */
.card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  padding: 16px;
}
.cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cardhead h2 {
  font-weight: 700;
}
.rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inrow {
  display: grid;
  grid-template-columns: 1fr 150px;
  align-items: center;
  gap: 10px;
}
.inrow label {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.inrow input {
  text-align: right;
  font-weight: 700;
}
.ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: var(--sunken);
}
.relwrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pill {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  gap: 2px;
}
.pill button {
  border: 0;
  background: none;
  border-radius: 99px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
}
.pill button[aria-pressed="true"][data-sign="1"] {
  background: var(--credit);
  color: #fff;
}
.pill button[aria-pressed="true"][data-sign="-1"] {
  background: var(--debit);
  color: #fff;
}
.hint {
  font-size: 0.8rem;
  margin: 0;
}

/* real */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.flow .box {
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.flow .box .k {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.flow .box .v {
  font-size: 1.35rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.flow .arrow {
  color: var(--muted);
  font-size: 1.3rem;
}
.neg {
  color: var(--debit) !important;
}

/* ledger */
.group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ghead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  padding: 0 4px;
}
.ghead .gsub {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}
.ghead .gsub b {
  color: var(--fg);
}
.ghead .gsub b.credit {
  color: var(--credit);
}
.ghead h2 {
  font-weight: 800;
}
.ghead .tot {
  font-weight: 700;
  color: var(--muted);
}
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  padding: 10px 10px 10px 12px;
  transition:
    opacity 0.25s,
    transform 0.2s;
  border: 2px solid var(--edge);
  border-radius: 20px;
  box-shadow: var(--shadow-s);
}
.item .ico {
  font-size: 1.3rem;
}
.item .main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}
.item .txt {
  flex: 1;
  min-width: 0;
}
.item .lbl {
  font-weight: 700;
  overflow-wrap: anywhere;
  display: block;
}
.item .sub {
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  display: block;
}
.amtcol {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
}
.amt {
  white-space: nowrap;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.amt.debit {
  color: var(--fg);
}
.was {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: line-through;
}
.check {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: transparent;
  border: 2px dashed var(--muted);
}
.check svg {
  width: 18px;
  height: 18px;
}
.item.done .lbl {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--muted);
}
.item.pop .check {
  animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes pop {
  0% {
    transform: scale(0.4);
  }
  100% {
    transform: scale(1);
  }
}
.donehead {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}
.donehead svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}
.donehead[aria-expanded="true"] svg {
  transform: rotate(90deg);
}
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  border: 2px dashed var(--muted);
  border-radius: 22px;
  background: transparent;
}
.empty .e {
  font-size: 1.8rem;
}
.btn {
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
  border-radius: 15px;
  font-weight: 900;
  color: var(--fg);
}
.btn.small {
  padding: 8px 12px;
  font-size: 0.88rem;
  border-radius: 12px;
}
.btn.block {
  width: 100%;
}
.notice {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 0.9rem;
  border: 2px solid var(--edge);
  border-radius: 20px;
  background: color-mix(in srgb, var(--sun) 32%, var(--surface));
  font-weight: 800;
}

/* start */
.start {
  background: var(--surface);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.start .wave {
  font-size: 2.4rem;
  line-height: 1;
}
.start h2 {
  font-size: 1.6rem;
  font-weight: 800;
}
.closebox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid var(--edge);
  border-radius: 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--sun) 16%, var(--surface));
}
.closebox h2 {
  font-size: 1.1rem;
}
.closel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.closel li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
}
.closel .t {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.closel .t b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.closel .ca {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.closel .ca .btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.closel .ca .btn.danger {
  flex: 0 0 auto;
  padding: 8px 12px;
}
.closel .ca .hint {
  flex: 1;
}
.preview {
  color: var(--hero-fg);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero2) 100%);
  border: 2px solid var(--edge);
}
.preview .v {
  font-size: 1.6rem;
  font-weight: 800;
}

/* fab + tabs */
.fab {
  position: fixed;
  right: calc(max(16px, env(safe-area-inset-right, 0px)) + 4px);
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  z-index: 8;
  bottom: calc(98px + env(safe-area-inset-bottom, 0px));
}
.fab svg {
  width: 28px;
  height: 28px;
}
.tabs {
  position: fixed;
  display: flex;
  justify-content: center;
  z-index: 5;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: 520px;
  margin: 0 auto;
  padding: 6px;
  gap: 0;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--shc);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tabs button {
  flex: 1;
  max-width: 220px;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
  padding: 7px 4px 6px;
  border-radius: 20px;
  transition: color 0.25s;
  font-weight: 800;
  color: var(--muted);
}
.tabs svg {
  width: 24px;
  height: 24px;
}

/* sheets */
.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s;
  background: rgba(8, 6, 20, 0.55);
}
.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 540px;
  padding: 10px 18px 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 92vh;
  overflow: auto;
  animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  margin-left: env(safe-area-inset-left, 0px);
  margin-right: env(safe-area-inset-right, 0px);
}
.sheet > * {
  flex-shrink: 0;
}
.grab {
  width: 40px;
  height: 5px;
  border-radius: 9px;
  align-self: center;
  background: var(--muted);
  opacity: 0.5;
}
@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.sheethead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sheethead .ico {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
}
.sheethead h3 {
  font-size: 1.25rem;
  font-weight: 800;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  gap: 4px;
}
.seg.three {
  grid-template-columns: 1fr 1fr 1fr;
}
.seg button {
  border: 0;
  background: none;
  padding: 10px;
  border-radius: 11px;
  font-weight: 700;
  color: var(--muted);
}
.seg button[data-kind="debit"][aria-pressed="true"] {
  color: var(--debit);
}
.seg button[data-kind="credit"][aria-pressed="true"] {
  color: var(--credit);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.bigamt {
  font-size: 2rem !important;
  font-weight: 800;
  text-align: center;
  padding: 14px !important;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.actions .spacer {
  flex: 1;
}

/* toast + status */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 30;
  max-width: calc(100% - 32px);
  text-align: center;
  bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
  font-weight: 800;
  border-radius: 16px;
}
.toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.status {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}
.status.err {
  color: var(--debit);
}
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  width: 100%;
  height: 100%;
}
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
  font-weight: 600;
}
.loading .e {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: block;
  margin: 0 auto 12px;
}
@media (max-width: 370px) {
  .inrow {
    grid-template-columns: 1fr 120px;
  }
  .hero .big {
    font-size: 2.5rem;
  }
  .flow {
    grid-template-columns: 1fr;
  }
  .flow .arrow {
    display: none;
  }
}
/* category colors (mid-tones, readable on both themes) */
select {
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--sunken);
  padding: 11px 12px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
  text-overflow: ellipsis;
}
/* chips, budgets, cagnottes, prévision */
.chip {
  margin-left: 6px;
  vertical-align: 2px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent);
  border: 1.5px solid var(--edge);
}
.goal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hero-soft);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.goal.ok {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hero-fg) 35%, transparent);
}
/* donut */
.donut {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.donut svg {
  width: 150px;
  height: 150px;
  display: block;
}
.dleg {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.dleg .r {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
}
.dleg b {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: block;
}
.dleg .n {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dleg .a {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dleg .p {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  margin-left: 4px;
}
.dsplit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 2px dashed var(--line);
  padding-top: 12px;
}
.dbar {
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: hidden;
  border: 2px solid var(--edge);
}
.dbar i + i {
  border-left: 2px solid var(--edge);
}
.drow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3.2em;
  gap: 8px;
  align-items: center;
  font-size: 0.86rem;
}
.drow span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.drow b {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
.drow .p {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}
.dsplit .hint {
  margin: 4px 0 0;
}
.dsplit .hint b.credit {
  color: var(--credit);
}
@media (max-width: 390px) {
  .donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .dleg {
    width: 100%;
  }
}
.hist svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
/* search */
.res {
  display: flex;
  flex-direction: column;
}
.resrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.resrow .ico {
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
}
.resrow .t {
  min-width: 0;
}
.resrow .t b {
  display: block;
  overflow-wrap: anywhere;
}
.resrow .t span {
  font-size: 0.78rem;
  color: var(--muted);
}
.ressum {
  font-weight: 700;
  padding: 4px 0 8px;
}
/* recap */
.recap .hero {
  align-items: flex-start;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tile {
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tile .k {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}
.tile .v {
  font-size: 1.15rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.tile .s {
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.tile.good .v {
  color: var(--credit);
}
.tile.bad .v {
  color: var(--debit);
}
.recapbtns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recapbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--sunken);
  border-radius: 16px;
  padding: 12px;
}
.recapbtn .t {
  flex: 1;
  min-width: 0;
}
.recapbtn b {
  display: block;
}
.recapbtn span.s {
  font-size: 0.8rem;
  color: var(--muted);
}
.recapbtn svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
/* swipe */
.swipe {
  position: relative;
  border-radius: 18px;
}
.swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-weight: 800;
  color: #fff;
  background: var(--mint);
  opacity: 0;
  border-radius: 20px;
}
.swipe-bg.undo {
  background: var(--muted);
  justify-content: flex-end;
}
.swipe-bg.ready {
  filter: brightness(1.08);
}
.swipe > .item {
  position: relative;
  touch-action: pan-y;
}
.swipe:not(.dragging) > .item {
  transition:
    transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity 0.25s;
}
.swipehint {
  text-align: center;
  font-weight: 700;
}
/* lock */
.lock {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.lock img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}
.lock h2 {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
}
.lock .hint {
  text-align: center;
  min-height: 1.3em;
}
.dots {
  display: flex;
  gap: 18px;
  margin: 4px 0 8px;
}
.dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  transition: background 0.12s;
  border-color: var(--edge);
  background: var(--surface);
}
.dots.shake {
  animation: nudge 0.4s;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 14px 22px;
}
.pad button {
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.75rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
  font-family: var(--numf);
  width: 76px;
  height: 76px;
  min-height: 0;
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  font-weight: 600;
}
.pad button:active {
  background: var(--sunken);
  transform: scale(0.95);
}
.pad .ghost {
  background: none;
  box-shadow: none;
}
.pad .ghost svg {
  width: 26px;
  height: 26px;
}
/* palettes (couleurs, clair/sombre, noir intégral) */
.swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.sw {
  width: 46px;
  height: 46px;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--line);
  padding: 0;
  position: relative;
  border-radius: 16px;
}
.sw[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--fg);
}
.sw span {
  position: absolute;
  inset: auto 6px 6px auto;
  width: 12px;
  height: 12px;
  border-radius: 4px;
}
/* suggestions de saisie */
.suggs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: -4px;
}
.sugg {
  border: 0;
  background: var(--sunken);
  border-radius: 99px;
  padding: 7px 12px;
  font-weight: 600;
  font-size: 0.86rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sugg span {
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
}
/* notifications */
.notifs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 8px 12px 14px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  transition:
    opacity 0.25s,
    transform 0.25s;
  border: 2px solid var(--edge);
  border-radius: 20px;
  box-shadow: var(--shadow-s);
}
.notif.out {
  opacity: 0;
  transform: translateX(40px);
}
.notif .e {
  font-size: 1.3rem;
  line-height: 1.2;
}
.notif .t {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.notif .t b {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
}
.notif .t span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.notif .x {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 8px;
}
.flash {
  animation: flash 1.4s ease-out;
}
@keyframes flash {
  0%,
  100% {
    box-shadow: var(--shadow);
  }
  25%,
  60% {
    box-shadow: 0 0 0 3px var(--accent);
  }
}
/* budgets */
.buds {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.budrow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.budrow .bt {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}
.budrow .bt .num {
  white-space: nowrap;
}
.bar {
  overflow: hidden;
  height: 10px;
  border-radius: 99px;
  background: var(--sunken);
}
.bar i {
  display: block;
  height: 100%;
  transition: width 0.4s;
  border-radius: 99px;
  background: var(--mint);
}
.budrow .s {
  font-size: 0.78rem;
  color: var(--muted);
}
.budrow .s.over {
  color: var(--debit);
  font-weight: 600;
}
.budset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 40px;
  gap: 8px;
  align-items: center;
}
.budset .n {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.budset input {
  text-align: right;
  font-weight: 700;
}
.budset .rm {
  border: 0;
  background: var(--sunken);
  border-radius: 12px;
  height: 44px;
  color: var(--muted);
  font-size: 1.1rem;
}
.budadd {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(80px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
/* cagnottes */
.pots {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pot {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
}
.pot svg {
  width: 52px;
  height: 52px;
  display: block;
}
.pot .t {
  min-width: 0;
}
.pot b {
  display: block;
  overflow-wrap: anywhere;
}
.pot .s {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
.pot .act {
  border: 0;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-weight: 800;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.pot .act.ok {
  background: var(--sunken);
  color: var(--muted);
}
.emos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.emos button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 0;
  background: var(--sunken);
  font-size: 1.3rem;
}
.emos button[aria-pressed="true"] {
  box-shadow: 0 0 0 2.5px var(--accent);
  background: var(--surface);
}
.switchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}
.tog {
  position: relative;
  width: 52px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 99px;
  background: var(--line);
  transition: background 0.2s;
  padding: 0;
}
.tog::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.tog[aria-checked="true"]::after {
  transform: translateX(20px);
}
.provision {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--sun) 22%, var(--surface));
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.9rem;
}
.provision ul {
  margin: 4px 0 6px;
  padding-left: 18px;
}
.hero .nmx {
  margin-top: 2px;
  font-size: 0.85rem;
  opacity: 0.85;
}
/* import du relevé */
.impbtn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border-radius: 18px;
  padding: 14px;
}
.impbtn .t {
  flex: 1;
  min-width: 0;
}
.impbtn svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}
.impbtn b {
  display: block;
}
.impbtn span.s {
  font-size: 0.8rem;
  color: var(--muted);
}
.txs {
  display: flex;
  flex-direction: column;
}
.tx {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.tx input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.tx .l {
  min-width: 0;
}
.tx .l b {
  display: block;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.tx .l span {
  font-size: 0.76rem;
  color: var(--muted);
}
.tx .a {
  font-weight: 800;
  font-family: var(--display);
  white-space: nowrap;
}
.tx select {
  grid-column: 2/4;
  padding: 8px 34px 8px 10px;
  font-size: 16px;
  border-radius: 10px;
}
.tx.dup {
  opacity: 0.5;
}
.tx.match select {
  background-color: color-mix(in srgb, var(--mint) 18%, var(--surface));
}
.impbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 10px;
}
@media (max-width: 370px) {
  .budset {
    grid-template-columns: minmax(0, 1fr) 96px 40px;
  }
  .budadd {
    grid-template-columns: 1fr 1fr;
  }
  .budadd .btn {
    grid-column: 1/-1;
  }
}
/* ===== Aide et visite guidée ===== */
.tourbtn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border-radius: 20px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--hero) 0%, var(--hero2) 100%);
  color: #fff;
}
.tourbtn .e {
  font-size: 1.8rem;
}
.tourbtn b {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
}
.tourbtn span.s {
  font-size: 0.85rem;
  opacity: 0.85;
}
.helps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help {
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
}
.help summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}
.help summary::-webkit-details-marker {
  display: none;
}
.help summary .e {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--sunken);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex: none;
}
.help summary .t {
  flex: 1;
  min-width: 0;
}
.help summary .t small {
  display: block;
  font-weight: 500;
  font-size: 0.8rem;
}
.help summary svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.2s;
  flex: none;
}
.help[open] summary svg {
  transform: rotate(90deg);
}
.help .b {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.93rem;
  line-height: 1.55;
}
.help .b p {
  margin: 0;
}
.help .b h4 {
  margin: 8px 0 0;
  font-size: 0.98rem;
  font-weight: 800;
}
.help .b .fx {
  background: var(--sunken);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 600;
}
.help .b ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ex {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.88rem;
}
.ex b:first-child {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.ex code,
.help code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  background: var(--sunken);
  padding: 1px 6px;
  border-radius: 6px;
}
.showme {
  align-self: flex-start;
  border: 0;
  background: var(--sunken);
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
}
.tour {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.tour .spot {
  position: fixed;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(8, 16, 12, 0.62);
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: none;
  outline: 2px solid color-mix(in srgb, var(--hero-fg) 70%, transparent);
}
.tour .bubble {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  max-width: 420px;
  margin: 0 auto;
  background: var(--surface);
  color: var(--fg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    top 0.3s,
    bottom 0.3s;
  animation: up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.tour .bubble h3 {
  font-size: 1.1rem;
  font-weight: 800;
}
.tour .bubble p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fg);
}
.tour .bubble .row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.tour .bubble .row .k {
  flex: 1;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}
.tour .x {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.3rem;
  padding: 4px 8px;
}
/* ===== Micro-animations, parcours de l’argent, apparence ===== */
.check path {
  stroke-dasharray: 22;
  stroke-dashoffset: 0;
}
.item.pop .check path {
  animation: draw 0.45s 0.08s cubic-bezier(0.3, 0.8, 0.3, 1) both;
}
@keyframes draw {
  from {
    stroke-dashoffset: 22;
  }
}
.enter .pot circle + circle,
.enter .donut circle {
  animation: ringfill 1s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes ringfill {
  from {
    stroke-dasharray: 0 999;
  }
}
.enter .bar i,
.enter .gauge i {
  animation: growx 0.9s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes growx {
  from {
    width: 0;
  }
}
.goal.cheer {
  animation: cheer 0.7s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes cheer {
  0% {
    transform: scale(0.9);
  }
  55% {
    transform: scale(1.05);
  }
  100% {
    transform: none;
  }
}
.enter .flowsvg path {
  animation: flowin 0.9s 0.1s ease-out both;
}
@keyframes flowin {
  from {
    opacity: 0;
  }
}
.flowsvg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.seg3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  gap: 4px;
}
.seg3 button {
  border: 0;
  background: none;
  padding: 9px 6px;
  border-radius: 11px;
  font-weight: 700;
  color: var(--muted);
}
.sw:disabled {
  opacity: 0.35;
}
/* ===== Ajout express, menu du +, glisser à gauche, personnalisation ===== */
.quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.qwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 18px;
  padding: 6px 6px 6px 14px;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
}
.qwrap:focus-within {
  box-shadow:
    0 0 0 2px var(--accent),
    var(--shadow);
  border-color: var(--accent-ink);
}
.qwrap .qi {
  font-size: 1.1rem;
}
.qwrap input {
  border: 0;
  padding: 10px 4px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.qwrap input:focus {
  border: 0;
}
.qwrap button {
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
  border-radius: 13px;
  padding: 10px 14px;
}
.qprev {
  margin: 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.qprev b {
  color: var(--fg);
}
.fabmenu-bg {
  position: fixed;
  inset: 0;
  z-index: 7;
  background: rgba(10, 20, 15, 0.25);
}
.fabmenu {
  position: fixed;
  right: calc(max(16px, env(safe-area-inset-right, 0px)) + 4px);
  bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.fabmenu button {
  background: var(--surface);
  color: var(--fg);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fm 0.28s cubic-bezier(0.3, 1.3, 0.5, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
  font-weight: 900;
}
@keyframes fm {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
}
.swipe-acts {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 6px 6px 0;
  opacity: 0;
}
.swipe-acts button {
  border: 0;
  border-radius: 14px;
  width: 68px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.05rem;
  background: var(--sunken);
  color: var(--fg);
}
.swipe-acts button span {
  font-size: 0.7rem;
  font-weight: 800;
}
.swipe-acts [data-sa="del"] {
  background: color-mix(in srgb, var(--debit) 18%, var(--surface));
  color: var(--debit);
}
.custbtn {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 8px;
  align-self: center;
  font-weight: 800;
}
.lrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.lrow .n {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.lrow .mv {
  border: 0;
  background: var(--sunken);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-weight: 800;
  color: var(--muted);
}
.lrow .mv:disabled {
  opacity: 0.3;
}
.lrow .fixed {
  font-size: 0.75rem;
  color: var(--muted);
  width: 52px;
  text-align: center;
}
/* ===== Transitions et barre d’onglets flottante ===== */
.tabs button svg {
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
  stroke-width: 2.4;
}
.tabs button[aria-selected="true"] svg {
  transform: translateY(-1px) scale(1.08);
}
.tab-ind {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  transition:
    transform 0.4s cubic-bezier(0.3, 1.25, 0.5, 1),
    width 0.3s,
    height 0.3s;
  z-index: 0;
  pointer-events: none;
  background: var(--accent);
  border-radius: 18px;
}
.item:active {
  transform: scale(0.985);
}
.enter > * {
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.enter.from-r > * {
  animation-name: fromR;
}
.enter.from-l > * {
  animation-name: fromL;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes fromR {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes fromL {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}
/* day strip */
.strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px 3px 4px;
  margin: 0 -3px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar {
  display: none;
}
.dy {
  flex: none;
  width: 46px;
  border-radius: 15px;
  padding: 8px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  scroll-snap-align: center;
  transition:
    background 0.2s,
    color 0.2s;
  border: 2px solid transparent;
  background: var(--surface);
}
.dy .w {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dy .n {
  font-weight: 800;
  font-size: 1.08rem;
  line-height: 1;
}
.dy .dd {
  display: flex;
  gap: 3px;
  height: 6px;
}
.dy .dd i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.dy .dd i.ok {
  background: var(--mint);
}
.dy .dd i.late {
  background: var(--debit);
}
.dy.past:not([aria-pressed="true"]) .n {
  opacity: 0.5;
}
.dy.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  border-color: var(--edge);
}
.dy[aria-pressed="true"] .w {
  color: inherit;
  opacity: 0.85;
}
.dy[aria-pressed="true"] .dd i {
  background: var(--accent-fg);
}
.daydet {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.daydet .h {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.daydet .h::first-letter {
  text-transform: uppercase;
}
.daydet .r {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border: 0;
  background: none;
  text-align: left;
  width: 100%;
}
.daydet .r .ico {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}
.daydet .r b {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.daydet .r span.s {
  font-size: 0.75rem;
  color: var(--muted);
}
/* collapsible entries */
.enthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
}
.enthead h2 {
  font-weight: 700;
}
.enthead svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
  transition: transform 0.25s;
}
.ent.open .enthead svg {
  transform: rotate(90deg);
}
/* compact header */
.mini {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 9px
    max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  font-weight: 800;
}
.mini.on {
  transform: none;
}
.mini #mini-m {
  text-transform: capitalize;
  color: var(--muted);
  font-size: 0.9rem;
}
.mini #mini-v {
  font-weight: 800;
  font-size: 1.1rem;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Grands écrans : tablette et ordinateur ===== */
.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* tablette (iPad portrait et plus) */
@media (min-width: 820px) {
  body {
    font-size: 16px;
  }
  .wrap {
    max-width: 1080px;
  }
  /* Bilan et Compte : cartes réparties sur deux colonnes */
  #view-stats,
  #view-account {
    display: block;
    columns: 2;
    column-gap: 20px;
  }
  #view-stats > *,
  #view-account > * {
    break-inside: avoid;
    margin-bottom: 16px;
  }
  #view-stats > .top,
  #view-account > .top {
    column-span: all;
  }
  .helps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  /* colonnes étroites (iPad portrait) : légende sous l’anneau */
  .col .donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .col .dleg {
    width: 100%;
  }
  /* fenêtres : centrées au lieu de remonter du bas */
  .sheet-bg {
    align-items: center;
    padding: 24px;
  }
  .sheet {
    border-radius: 26px;
    max-height: 88vh;
    padding-bottom: 18px;
    margin: 0;
  }
  .sheet .grab {
    display: none;
  }
  .sheet > .actions,
  .sheet > .impbar {
    position: sticky;
    bottom: -18px;
    background: var(--surface);
    padding-block: 12px 2px;
    margin-bottom: -2px;
  }
  .auth {
    margin-top: 12vh;
  }
}

/* ordinateur et iPad paysage : onglets dans une barre latérale */
@media (min-width: 1024px) {
  html {
    font-size: 17px;
  }
  body {
    padding-left: calc(132px + env(safe-area-inset-left, 0px));
    padding-right: 32px;
    padding-top: 24px;
    padding-bottom: 48px;
  }
  .wrap {
    max-width: 1180px;
  }
  .tabs {
    top: 50%;
    bottom: auto;
    left: max(16px, env(safe-area-inset-left, 0px));
    right: auto;
    transform: translateY(-50%);
    flex-direction: column;
    width: 96px;
    max-width: none;
    margin: 0;
    gap: 4px;
    box-shadow: 0 5px 0 var(--shc);
  }
  .tabs button {
    flex: none;
    max-width: none;
    padding: 10px 4px 9px;
  }
  /* le bouton + passe sous la barre latérale, à gauche */
  .fab {
    bottom: 32px;
    right: auto;
    left: calc(34px + env(safe-area-inset-left, 0px));
  }
  .fabmenu {
    bottom: 104px;
    right: auto;
    left: calc(34px + env(safe-area-inset-left, 0px));
    align-items: flex-start;
  }
  .toast {
    bottom: 40px;
  }
  .mini {
    padding-left: calc(132px + env(safe-area-inset-left, 0px));
  }
  .top h1 {
    font-size: 2rem;
  }
  /* colonnes plus larges : légende de nouveau à côté de l’anneau */
  .col .donut {
    grid-template-columns: 150px minmax(0, 1fr);
    justify-items: stretch;
  }
}

/* ===== Import du relevé vers les fixes ===== */
.tx .txl {
  padding: 8px 10px;
  font-weight: 700;
  margin-bottom: 3px;
}
.tx .l > span {
  display: block;
}
.tx .am {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tx .sg {
  font-family: var(--display);
  font-weight: 800;
}
.tx .sg.credit {
  color: var(--credit);
}
.tx .txa {
  width: 92px;
  text-align: right;
  padding: 8px 10px;
  font-weight: 800;
}

/* ---------- composants ajoutés en v2 ----------
   Actions rapides, icônes dessinées, bande de notifications, pastilles de catégories, comparaison bancaire…
   Quelques réglages d’éléments de base (corps de page, titres, feuilles, bouton +) sont aussi ici car ils doivent
   passer après les règles d’écran large et d’icônes plus haut. */
/* ---------- tokens ---------- */

/* palettes : couleur de la grande carte + couleur des boutons (les noms restent ceux de la v1, partagés via Firebase) */

/* ---------- base ---------- */
body {
  font-weight: 600;
  font-size: 15.5px;
  background: var(--bg);
}
h1,
h2,
h3 {
  font-weight: 900;
  letter-spacing: -0.015em;
}
.top h1 {
  font-weight: 900;
}
.num,
.amt,
.hero .big,
.preview .v,
.flow .box .v,
.tile .v,
.bigamt,
.dy .n,
.mini #mini-v {
  font-family: var(--numf);
  font-variant-numeric: tabular-nums;
}
.amt.credit {
  color: var(--credit);
}
.hint,
.muted {
  color: var(--muted);
}
.linkbtn,
.showme,
.ex b,
.help summary .t small {
  color: var(--accent-ink);
}
.tabs button[aria-selected="true"],
.chip {
  color: var(--accent-fg);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 2px;
}
input,
textarea,
select {
  border: 2px solid transparent;
  border-radius: 14px;
  font-weight: 700;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-ink);
}
::placeholder {
  color: var(--muted);
  opacity: 0.75;
  font-weight: 600;
}

/* ---------- surfaces : bord marqué + ombre pleine ---------- */
.card,
.start,
.recapbtn,
.impbtn,
.tourbtn,
.tile,
.flow .box,
.goal {
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
}
.item.done {
  opacity: 0.7;
  box-shadow: none;
  background: var(--sunken);
  border-color: var(--line);
}
.tile,
.flow .box {
  background: var(--surface);
  box-shadow: none;
}
.tile.good,
.flow .box.now {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}
.round:active,
.btn:active,
.acts button:active .ab,
.fab:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--shc);
}
.ghead h2,
.cardhead h2,
.enthead h2 {
  font-size: 1.15rem;
}

/* ---------- icônes ---------- */
.ico.fz {
  background: var(--t);
  color: #0e0f16;
  border-radius: 14px;
  font-size: 0;
}
.ico.fz svg {
  width: 58%;
  height: 58%;
}
.item .ico {
  width: 44px;
  height: 44px;
  border-radius: 15px;
}
.e.fz {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--t);
  color: #0e0f16;
  font-size: 0;
  flex: none;
}
.e.fz svg {
  width: 21px;
  height: 21px;
}
.empty .e.fz {
  width: 48px;
  height: 48px;
  border: 2px solid var(--edge);
}
.ci {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--t);
  color: #0e0f16;
  vertical-align: -5px;
  margin-right: 7px;
  flex: none;
}
.ci svg {
  width: 14px;
  height: 14px;
}
.provision > span.fz {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--t);
  color: #0e0f16;
  flex: none;
}
.provision > span.fz svg {
  width: 21px;
  height: 21px;
}

/* ---------- en-tête + grande carte ---------- */
.top h1 {
  font-size: 1.75rem;
}
.hero.alert {
  background: linear-gradient(150deg, var(--hero-neg) 0%, var(--hero-neg2) 100%);
}
.hero::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 14px;
  left: auto;
  bottom: auto;
  border-radius: 0;
  width: 78px;
  height: 86px;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 96 104%22%3E%3Crect x=%2220%22 y=%226%22 width=%2256%22 height=%2214%22 rx=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Cpath d=%22M14 30c0-6 5-10 11-10h46c6 0 11 4 11 10v56c0 8-6 14-14 14H28c-8 0-14-6-14-14z%22 fill=%22%23FFFFFF%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Cpath d=%22M14 62h68v24c0 8-6 14-14 14H28c-8 0-14-6-14-14z%22 fill=%22%23C8F560%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Ccircle cx=%2236%22 cy=%2246%22 r=%224%22 fill=%22%2314102A%22/%3E%3Ccircle cx=%2260%22 cy=%2246%22 r=%224%22 fill=%22%2314102A%22/%3E%3Cpath d=%22M40 54c4 4 12 4 16 0%22 fill=%22none%22 stroke=%22%2314102A%22 stroke-width=%223%22 stroke-linecap=%22round%22/%3E%3Ccircle cx=%2230%22 cy=%2254%22 r=%224%22 fill=%22%23FF8FA3%22/%3E%3Ccircle cx=%2266%22 cy=%2254%22 r=%224%22 fill=%22%23FF8FA3%22/%3E%3Ccircle cx=%2234%22 cy=%2280%22 r=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2252%22 cy=%2284%22 r=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2266%22 cy=%2274%22 r=%225%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3C/svg%3E")
    no-repeat center / contain;
  pointer-events: none;
  z-index: 0;
}
.hero.alert::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 96 104%22%3E%3Crect x=%2220%22 y=%226%22 width=%2256%22 height=%2214%22 rx=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Cpath d=%22M14 30c0-6 5-10 11-10h46c6 0 11 4 11 10v56c0 8-6 14-14 14H28c-8 0-14-6-14-14z%22 fill=%22%23FFFFFF%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Cpath d=%22M14 62h68v24c0 8-6 14-14 14H28c-8 0-14-6-14-14z%22 fill=%22%23C8F560%22 stroke=%22%2314102A%22 stroke-width=%223%22/%3E%3Ccircle cx=%2236%22 cy=%2246%22 r=%224%22 fill=%22%2314102A%22/%3E%3Ccircle cx=%2260%22 cy=%2246%22 r=%224%22 fill=%22%2314102A%22/%3E%3Cpath d=%22M31 38l8 3M65 38l-8 3%22 stroke=%22%2314102A%22 stroke-width=%223%22 stroke-linecap=%22round%22/%3E%3Cpath d=%22M40 57c4-3 12-3 16 0%22 fill=%22none%22 stroke=%22%2314102A%22 stroke-width=%223%22 stroke-linecap=%22round%22/%3E%3Ccircle cx=%2230%22 cy=%2254%22 r=%224%22 fill=%22%23FF8FA3%22/%3E%3Ccircle cx=%2266%22 cy=%2254%22 r=%224%22 fill=%22%23FF8FA3%22/%3E%3Ccircle cx=%2234%22 cy=%2280%22 r=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2252%22 cy=%2284%22 r=%226%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3Ccircle cx=%2266%22 cy=%2274%22 r=%225%22 fill=%22%23FFC93C%22 stroke=%22%2314102A%22 stroke-width=%222.5%22/%3E%3C/svg%3E");
}
.hero > div:first-child {
  padding-right: 84px;
}
.hero.alert .mood {
  background: #fff;
  color: #7e1f12;
}
.hero .goal {
  border: 0;
  box-shadow: none;
}
.gauge i + i {
  border-left: 2px solid #14102a;
}
.g-fix {
  background: var(--sky);
}
.g-exc {
  background: #ff8fa3;
}
.g-rest {
  background: var(--sun);
}
.legend strong {
  font-family: var(--numf);
  font-weight: 600;
}

/* ---------- rangée d’actions rapides ---------- */
.acts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.acts button {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--fg);
}
.acts .ab {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: #0e0f16;
  transition: transform 0.12s;
}
.acts .ab svg {
  width: 24px;
  height: 24px;
}
.acts .a1 {
  background: var(--accent);
}
.acts .a2 {
  background: #7fe0a8;
}
.acts .a3 {
  background: #ffc93c;
}
.acts .a4 {
  background: #b3a0ff;
}

/* ---------- lignes ---------- */
.item.done .check {
  border: 2px solid var(--edge);
  background: var(--mint);
  color: #0e0f16;
}
.chip.late {
  background: #ff8a73;
  color: #2a0b05;
}
.chip.once {
  background: color-mix(in srgb, #b9a7ff 50%, var(--surface));
  color: var(--fg);
}
.chip.soon {
  background: #ffc93c;
  color: #2a1d00;
}

/* ---------- boutons ---------- */
.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.btn.danger {
  background: var(--surface);
  color: var(--debit);
}
.btn:disabled {
  box-shadow: none;
}
.custbtn .ci {
  margin-right: 6px;
}
.btn .ci {
  margin-right: 8px;
}
.notif.bad,
.notif.warn {
  background: color-mix(in srgb, #ff6a4d 14%, var(--surface));
  border-color: color-mix(in srgb, #ff6a4d 70%, var(--edge));
}

/* ---------- sélecteurs ---------- */
.seg,
.seg3,
.pill {
  background: var(--sunken);
  border: 2px solid var(--edge);
  border-radius: 16px;
}
.seg button[aria-pressed="true"],
.seg3 button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg) !important;
  box-shadow: none;
  font-weight: 900;
}
.tog[aria-checked="true"] {
  background: var(--accent);
}
.dy[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--edge);
}

/* ---------- jauges ---------- */
.bar i.warn {
  background: #ffb15c;
}
.bar i.over {
  background: #ff6a4d;
}

/* ---------- barre d’onglets + bouton + ---------- */
.fab {
  background: var(--accent);
  color: var(--accent-fg);
  border: 2px solid var(--edge);
  box-shadow: 0 5px 0 var(--shc);
  border-radius: 22px;
}

/* ---------- feuilles, toast, verrou, visite ---------- */
.sheet {
  border: 2px solid var(--edge);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
}
.sheethead .ico {
  border-radius: 16px;
}
.dots i.on {
  background: var(--accent);
  border-color: var(--edge);
}
.tour .bubble {
  border: 2px solid var(--edge);
  box-shadow: 0 6px 0 var(--shc);
  border-radius: 22px;
}
.auth .logo,
.lock img {
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
}

/* ---------- grands écrans ---------- */
.qi.fz {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--t);
  color: #0e0f16;
  font-size: 0;
}
.qi.fz svg {
  width: 17px;
  height: 17px;
}
.goal .ci {
  margin-right: 6px;
}
.dots i.on {
  background: var(--accent);
}
.help summary .e.fz {
  background: var(--t);
  color: #0e0f16;
}

/* ---------- icônes dans le texte ---------- */
.fz svg {
  width: 58%;
  height: 58%;
  max-width: 40px;
  max-height: 40px;
}
.ii {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin: 0 0.12em;
  flex: none;
}
.ii svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wave.fz,
.auth .logo.fz {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--t);
  color: #0e0f16;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow-s);
  font-size: 0;
}
.auth .logo.fz {
  width: 84px;
  height: 84px;
  border-radius: 24px;
}
.fabmenu button > span.ci {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  margin: 0;
}
.fabmenu button > span.ci svg {
  width: 17px;
  height: 17px;
}
.emos button .ii,
#pot-emos button .ii {
  width: 24px;
  height: 24px;
  margin: 0;
}

.qwrap input,
.qwrap input:focus {
  border-color: transparent;
  background: transparent;
}

/* ---------- catégories ---------- */
.catgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.catchip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--edge);
  background: var(--surface);
  border-radius: 14px;
  padding: 6px 11px 6px 7px;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--fg);
  box-shadow: 0 2px 0 var(--shc);
}
.catchip:active {
  transform: translateY(2px);
  box-shadow: none;
}
.catchip.add {
  border-style: dashed;
  box-shadow: none;
}
.flab {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}
.icgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}
.icgrid button {
  height: 44px;
  border-radius: 13px;
  border: 2px solid transparent;
  background: var(--sunken);
  color: var(--fg);
  display: grid;
  place-items: center;
  padding: 0;
}
.icgrid button svg {
  width: 22px;
  height: 22px;
}
.icgrid button[aria-pressed="true"] {
  background: var(--t);
  color: #0e0f16;
  border-color: var(--edge);
  box-shadow: 0 2px 0 var(--shc);
}
.colrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.colrow button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  padding: 0;
}
.colrow button[aria-pressed="true"] {
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 5px var(--fg);
}
#c-ico {
  width: 48px;
  height: 48px;
}

/* ---------- notifications : une bande qui se déplie ---------- */
.notif .nb {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.notif .nb .t {
  width: 100%;
}
.nbar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 2px solid var(--edge);
  border-radius: 20px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: var(--shadow-s);
  color: var(--fg);
}
.nbar.warn,
.nbar.bad {
  background: color-mix(in srgb, #ff6a4d 14%, var(--surface));
  border-color: color-mix(in srgb, #ff6a4d 70%, var(--edge));
}
.nbar > svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.2s;
}
.notifs.open .nbar > svg {
  transform: rotate(90deg);
}
.nstack {
  display: flex;
  flex: none;
}
.nstack .e.fz {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  border: 2px solid var(--surface);
}
.nstack .e.fz svg {
  width: 17px;
  height: 17px;
}
.nstack .e + .e {
  margin-left: -10px;
}
.nbar .nt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.nbar .nt b {
  font-weight: 900;
}
.nbar .nt span {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- fiche d’ajout : catégories en pastilles ---------- */
.monthpick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.monthpick button {
  border: 2px solid var(--edge);
  border-radius: 12px;
  padding: 8px 0;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
}
.monthpick button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
}
.catpick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 2px 6px;
  margin: 0 -2px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent);
}
.catpick::-webkit-scrollbar {
  display: none;
}
.catpick .catchip {
  flex: none;
  scroll-snap-align: start;
  box-shadow: none;
}
.catpick .catchip[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 2px 0 var(--shc);
}

/* ---------- œil du mode discret ---------- */
#mtop .ttl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.eye {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.eye svg {
  width: 21px;
  height: 21px;
}
.eye[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
}
:root[data-discreet] input.num:not(:focus) {
  color: transparent;
  text-shadow: 0 0 9px var(--fg);
}

/* ---------- le + s’efface quand les actions rapides sont à l’écran ---------- */
.fab {
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.fab.away {
  opacity: 0;
  transform: scale(0.6) translateY(12px);
  pointer-events: none;
}

/* ---------- comparer avec la banque ---------- */
.bankopen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bankopen svg {
  width: 18px;
  height: 18px;
}
.bank {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 2px dashed var(--line);
  padding-top: 12px;
}
.bankres {
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 14px;
  padding: 10px 12px;
  background: color-mix(in srgb, #ffc93c 25%, var(--surface));
}
.bankres.ok {
  background: color-mix(in srgb, var(--mint) 22%, var(--surface));
}

/* ---------- catégories retenues ---------- */
.learn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

/* ---------- suggestions (Mes fixes) ---------- */
.sugs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sug {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sug .nb {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sug .btnrow {
  margin-top: 4px;
}
.sug + .sug {
  border-top: 2px dashed var(--line);
  padding-top: 12px;
}

/* ---------- abonnements ---------- */
.subsum {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.subsum > div {
  display: flex;
  flex-direction: column;
  background: var(--sunken);
  border-radius: 14px;
  padding: 10px 12px;
}
.subsum b {
  font-family: var(--numf);
  font-size: 1.35rem;
  font-weight: 700;
}
.subs {
  display: flex;
  flex-direction: column;
}
.subrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.subrow .ci {
  margin: 0;
}
.subrow .n {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.subrow .n b {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subh {
  margin: 4px 0 -4px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.subrow small,
.ycat small {
  color: var(--muted);
  font-family: var(--body);
  font-weight: 600;
}
.subrow .y {
  min-width: 6.5em;
  text-align: right;
  color: var(--muted);
}

/* ---------- comptes bancaires ---------- */
.acctbar {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px 6px 6px;
  border: 2px solid var(--edge);
  border-radius: 99px;
  background: color-mix(in srgb, var(--t) 30%, var(--surface));
  color: inherit;
  font: inherit;
  font-weight: 800;
}
.acctbar b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acctbar > svg {
  width: 16px;
  height: 16px;
  flex: none;
  transform: rotate(90deg);
}
.aplist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aprow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
}
.aprow b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aprow[aria-pressed="true"] {
  border-color: var(--edge);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}
.aprow > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.xinfo {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, #7ed8e0 24%, var(--surface));
}

/* ---------- occasions ---------- */
.evt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.evt b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evt small {
  color: var(--muted);
  font-size: 0.78rem;
}
.evms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.evm {
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--sunken);
  font-size: 0.82rem;
  font-family: var(--numf);
}
.evm b {
  font-family: var(--display);
  text-transform: capitalize;
}
.evdate {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 8px;
}

/* ---------- le mois prochain ---------- */
.nmhead {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nmhead .k {
  font-weight: 700;
  text-transform: capitalize;
  color: var(--muted);
}
.nmhead .v {
  font-family: var(--numf);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.1;
}
.nmhead .v.neg,
.nmhead .v.neg + .s {
  color: var(--debit);
}
.nmhead .s {
  font-size: 0.85rem;
  color: var(--muted);
}
.nmrows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px dashed var(--line);
}
.nmrows li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}
.nmrows li.x span {
  font-weight: 700;
}
.nmrows b {
  white-space: nowrap;
}
.plrows li {
  align-items: center;
}
.plrows li > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.plrows small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: normal;
}
.plrows li > b {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.plrows b.credit {
  color: var(--credit);
}

/* ---------- « Et si… ? » ---------- */
#wi-card .catpick .catchip {
  padding: 8px 12px;
}
#wi-out {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wil {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wil li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--sunken);
}
.wil .k {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wil .k b {
  text-transform: capitalize;
}
.wil .k small {
  color: var(--muted);
  font-size: 0.76rem;
}
.wil .v {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--numf);
  font-variant-numeric: tabular-nums;
}
.wil .v s {
  color: var(--muted);
  font-size: 0.76rem;
}
.wil .v b {
  font-weight: 800;
}
.wil li.bad .v b {
  color: var(--debit);
}
.wil .lv {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: var(--mint);
}
.wil .mid .lv {
  background: var(--sun);
}
.wil .bad .lv {
  background: #ff6a4d;
}
.wiadv {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 2px solid var(--edge);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-weight: 700;
}
.wiadv > span:not(.ii) {
  flex: 1;
}
.wiadv > svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.wiv {
  margin: 0;
  font-weight: 800;
  border-radius: 14px;
  padding: 10px 12px;
}
.wiv.ok {
  background: color-mix(in srgb, var(--mint) 22%, var(--surface));
}
.wiv.mid {
  background: color-mix(in srgb, var(--sun) 26%, var(--surface));
}
.wiv.bad {
  background: color-mix(in srgb, #ff6a4d 18%, var(--surface));
}

/* ---------- ton année ---------- */
.ybars {
  width: 100%;
  height: auto;
}
.ybars .yl {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
}
.ybars .yz {
  stroke: var(--line);
  stroke-width: 1.5;
}
.ycats {
  display: flex;
  flex-direction: column;
}
.ycat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 4.6em;
  grid-template-areas: "ic n n n" "ic sp am tr";
  align-items: center;
  gap: 2px 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.ycat .ci {
  margin: 0;
}
.ycat .n {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ycat .spark {
  width: 70px;
  height: 20px;
  fill: var(--sky);
}
.ycat .tr {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  color: var(--muted);
}
.ycat .tr.up {
  color: var(--debit);
}
.ycat .tr.down {
  color: var(--credit);
}
.ycat .ci {
  grid-area: ic;
}
.ycat .n {
  grid-area: n;
}
.ycat .spark {
  grid-area: sp;
}
.ycat > .num {
  grid-area: am;
}
.ycat .tr {
  grid-area: tr;
}

/* ---------- Face ID sur l’écran de verrouillage ---------- */
#lock-bio {
  align-self: center;
}
.lock {
  justify-content: safe center;
  overflow-y: auto;
}
@media (max-height: 860px) {
  .lock {
    gap: 12px;
  }
  .pad {
    grid-template-columns: repeat(3, 68px);
    gap: 10px 20px;
  }
  .pad button {
    width: 68px;
    height: 68px;
  }
}

/* ---------- marge par jour (grande carte) ---------- */
.daily {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--hero-soft);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.daily b {
  font-family: var(--numf);
  font-weight: 700;
}
.daily small {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
}
.daily .ii {
  margin-top: 1px;
}

/* ---------- projets ---------- */
.tagc {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 99px;
  background: color-mix(in srgb, #b3a0ff 30%, var(--surface));
  color: var(--fg);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  vertical-align: 1px;
}
.tagc.evc {
  background: color-mix(in srgb, #ff9fb8 38%, var(--surface));
}
.tagc.xfc {
  background: color-mix(in srgb, #7ed8e0 40%, var(--surface));
}
.tagc .ii {
  width: 0.95em;
  height: 0.95em;
  margin: 0;
}
.projs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.proj {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 2px solid var(--edge);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-s);
  padding: 10px 12px;
  color: var(--fg);
}
.proj .ci {
  margin: 0;
}
.proj .t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.proj .t b {
  font-weight: 900;
}
.proj .t span {
  font-size: 0.8rem;
  color: var(--muted);
}
.proj > .num {
  font-family: var(--numf);
  font-weight: 700;
}
.proj > svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
}
.proj:active {
  transform: translateY(2px);
  box-shadow: none;
}
