/* Reste — premium fintech redesign (N26/Revolut lite) */
:root {
  --ink: #0B0D12;
  --ink-soft: #1A1F2E;
  --muted: #6B7280;
  --muted-soft: #9CA3AF;
  --bg: #F4F5F7;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --border: rgba(11, 13, 18, 0.08);
  --border-strong: rgba(11, 13, 18, 0.12);
  --accent: #3B5BDB;
  --accent-deep: #243B9B;
  --accent-soft: rgba(59, 91, 219, 0.10);
  --accent-glow: rgba(59, 91, 219, 0.28);
  --success: #12B76A;
  --success-soft: rgba(18, 183, 106, 0.12);
  --warn: #F79009;
  --danger: #F04438;
  --hero-grad: linear-gradient(160deg, #0B0D12 0%, #1A1F2E 55%, #243B9B 130%);
  --bg-grad: linear-gradient(180deg, #F7F8FA 0%, #F0F1F4 100%);
  --text: var(--ink);
  --card: rgba(255, 255, 255, 0.92);
  --card-solid: #FFFFFF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tab-h: 72px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(11, 13, 18, 0.04), 0 4px 12px rgba(11, 13, 18, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 13, 18, 0.06), 0 12px 32px rgba(11, 13, 18, 0.05);
  --shadow-lg: 0 12px 40px rgba(11, 13, 18, 0.12);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --motion: 240ms var(--ease-out);
  --mint: #2DD4BF;
  --mint-bright: #5EEAD4;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Syne", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --font-wordmark: "Syne", "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-family: var(--font);
  letter-spacing: -0.014em;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Author `display` must not resurrect [hidden] controls (SOS, FAB, overlays). */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg-grad);
  background-attachment: fixed;
}

body.modal-open { overflow: hidden; }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

button {
  touch-action: manipulation;
  transition: transform 0.16s var(--spring),
    background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, opacity 0.15s ease;
}
button:active:not(:disabled) { transform: scale(0.97); }

#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 28px);
}

.ambient-field {
  position: fixed;
  inset: 0;
  max-width: 430px;
  margin: 0 auto;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.35;
}
.ambient-canvas { display: block; width: 100%; height: 100%; }

#app > .view { position: relative; z-index: 1; }

#app.app--booting { opacity: 0; }
#app.app--ready {
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
}
html.splash-skip #app.app--booting { opacity: 1; }
body.splash-handoff #app.app--ready {
  opacity: 1;
}

/* ========== Splash ========== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 28px 22px calc(28px + var(--safe-bottom));
}
.splash[hidden] { display: none !important; }
.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #1A1F2E 0%, #0B0D12 70%),
    #0B0D12;
  opacity: 1;
  transition: opacity 0.4s var(--ease-out);
}
.splash-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.splash-stage {
  width: 176px;
  height: 208px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
}
.splash-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}
.splash-word {
  font-family: var(--font-wordmark);
  font-weight: 800;
  font-size: clamp(2.85rem, 10.5vw, 3.55rem);
  letter-spacing: 0.085em;
  line-height: 0.95;
  color: #F8FAFC;
  text-transform: none;
  font-feature-settings: "ss01" 1, "kern" 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 40px rgba(45, 212, 191, 0.14),
    0 0 72px rgba(59, 91, 219, 0.22);
  opacity: 0;
  margin: 0;
  background: transparent;
  /* Optical mix: lead letter slightly tighter feel via child classes */
}
.splash-word--in {
  opacity: 1;
  transition: none;
}
.splash-word--in:not(:has(.splash-letter)) {
  animation: wordIn 0.55s var(--ease-out) 0.1s both;
}
.splash-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px) scale(0.92);
  filter: blur(4px);
  animation: splashLetterIn 0.58s var(--ease-out) forwards;
  will-change: transform, opacity, filter;
  font-weight: 700;
}
.splash-letter--lead {
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-right: -0.02em;
}
.splash-letter--accent {
  font-weight: 800;
  background: linear-gradient(165deg, #A7F3D0 0%, var(--mint-bright) 38%, var(--mint) 72%, #818CF8 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  /* no blur filter — breaks background-clip text */
  animation-name: splashLetterAccentIn;
}
.splash-word-rule {
  display: block;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, var(--mint) 22%, #818CF8 78%, transparent 100%);
  opacity: 0;
  transform-origin: center;
}
.splash-wordmark--in .splash-word-rule {
  animation: splashRuleIn 0.55s var(--ease-out) 0.52s forwards;
}
@keyframes wordIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes splashLetterIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes splashLetterAccentIn {
  from { opacity: 0; transform: translateY(18px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes splashRuleIn {
  from { width: 0; opacity: 0; }
  to { width: 3.4rem; opacity: 0.95; }
}
.splash-skip {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  z-index: 3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.splash-skip:hover { background: rgba(255, 255, 255, 0.14); }
.splash--exit { pointer-events: none; }
.splash--exit .splash-bg { opacity: 0; }
.splash--exit .splash-stage,
.splash--exit .splash-wordmark {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-out);
}
.splash--exit .splash-letter {
  animation: none;
  opacity: 1;
  filter: none;
  transform: none;
}

/* ========== Views ========== */
.view {
  display: none;
  padding: 8px 18px 28px;
  animation: viewIn 0.35s var(--ease-out);
}
.view.active { display: block; }
.view[hidden] { display: none !important; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 44px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: #FFFFFF;
  background:
    linear-gradient(145deg, #1E3A8A 0%, var(--accent) 48%, #14B8A6 125%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 6px 16px rgba(59, 91, 219, 0.28),
    var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, transparent 42%);
  pointer-events: none;
}
.brand-mark-svg {
  position: relative;
  z-index: 1;
  display: block;
}
.brand-stack { display: flex; flex-direction: column; gap: 0; }
.logo {
  font-family: var(--font-wordmark);
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.1;
}
.brand-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  line-height: 1.35;
}
.month-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}

.top-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

/* ========== Hero budget card ========== */
.reste-card {
  position: relative;
  background: var(--hero-grad);
  border-radius: var(--radius-lg);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 24px;
  overflow: hidden;
  color: #fff;
}
.reste-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(59, 91, 219, 0.45) 0%, transparent 68%);
  pointer-events: none;
}
.reste-card::after {
  content: "";
  position: absolute;
  bottom: -45%;
  left: -25%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(18, 183, 106, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.reste-card--hero.is-parallaxing {
  transform: translate3d(0, calc(var(--py, 0) * 0.04px), 0);
  will-change: transform;
}
.reste-card-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  min-height: 96px;
}
.reste-card-copy { min-width: 0; align-self: center; }
.reste-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.reste-amount {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.045em;
  font-size: 3rem;
  color: #fff;
  line-height: 1;
  margin-bottom: 0;
  font-variant-numeric: tabular-nums;
}
.reste-amount.over { color: #FF8A8A; }

.plafond-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  clear: both;
  width: 100%;
}
.plafond-btn {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 650;
  font-size: 0.8125rem;
  cursor: pointer;
}
.plafond-btn:hover {
  background: rgba(59, 91, 219, 0.35);
  border-color: rgba(59, 91, 219, 0.5);
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #6B8AFF 100%);
  border-radius: 999px;
  transition: width 0.6s var(--ease-out), background 0.3s;
}
.progress-fill.warn {
  background: linear-gradient(90deg, var(--warn) 0%, #FDB022 100%);
}
.progress-fill.danger {
  background: linear-gradient(90deg, var(--danger) 0%, #F97066 100%);
}
.spent-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ========== Buddy mascot (NEW) ========== */
.mascot-wrap {
  flex-shrink: 0;
  width: 92px;
  height: 112px;
  position: relative;
  overflow: visible;
  background: transparent;
  align-self: center;
}
.mascot-wrap[data-parallax="mascot"].is-parallaxing {
  transform: translate3d(calc(var(--px, 0) * 0.15px), calc(var(--py, 0) * -0.06px), 0);
  will-change: transform;
}
.guy-host {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.buddy {
  position: relative;
  width: 92px;
  height: 112px;
  transform-origin: 50% 88%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  /* Soft depth without opaque plate */
  filter: drop-shadow(0 10px 18px rgba(11, 13, 18, 0.22));
}
/* Soft indigo/violet ambient glow behind character (fintech UI) */
.buddy::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10%;
  width: 68%;
  height: 62%;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 55%,
      rgba(99, 102, 241, 0.28) 0%,
      rgba(139, 92, 246, 0.14) 40%,
      rgba(99, 102, 241, 0) 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}
.splash-stage .buddy::before {
  width: 88%;
  height: 78%;
  background:
    radial-gradient(ellipse at 50% 55%,
      rgba(129, 140, 248, 0.45) 0%,
      rgba(167, 139, 250, 0.28) 40%,
      rgba(99, 102, 241, 0) 70%);
}
.buddy .buddy-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  background: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.buddy--lg {
  width: 168px;
  height: 210px;
}
.buddy--hero {
  width: 92px;
  height: 112px;
}
.buddy--splash-enter {
  animation: buddyEnter 0.7s var(--ease-out) both;
}
@keyframes buddyEnter {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

.buddy--idle {
  animation: buddyIdle 3.2s ease-in-out infinite;
}
@keyframes buddyIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.buddy--walk {
  animation: buddyWalk 0.55s ease-in-out infinite;
}
@keyframes buddyWalk {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-4px) rotate(1deg); }
}

.buddy--jump {
  animation: buddyJump 0.7s var(--spring);
}
@keyframes buddyJump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-18px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

.buddy--oh .buddy-img {
  filter: saturate(1.05) brightness(1.02);
}
.buddy--worried .buddy-img {
  filter: saturate(0.92) brightness(0.97);
}
.buddy--celebrate .buddy-img {
  filter: saturate(1.08) brightness(1.03);
}

.mascot-speech {
  position: absolute;
  top: -8px;
  left: -4px;
  right: auto;
  z-index: 3;
  background: #fff;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  border: 1px solid var(--border);
}
.mascot-speech.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}
.mascot-speech::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 16px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

/* ========== Sections / expenses ========== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.expense-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.expense-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.35s var(--ease-out) both;
}
.expense-item:active { transform: scale(0.985); }
.expense-item .info { flex: 1; min-width: 0; }
.expense-item .label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expense-item .date {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.expense-item .amount {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.expense-item .del {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.expense-item .del svg { width: 16px; height: 16px; }
.expense-item .del:hover { color: var(--danger); background: rgba(240, 68, 56, 0.08); }

.empty-inline {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 28px 16px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== FAB ========== */
.fab {
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 20px);
  right: max(22px, calc((100vw - 430px) / 2 + 22px));
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow), var(--shadow-md);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.fab.hidden { display: none; }
.fab:hover { background: var(--accent-deep); }
.fab-bounce { animation: fabBounce 0.55s var(--spring); }
@keyframes fabBounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}

/* ========== Bons plans ========== */
.bp-lead {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 14px;
  max-width: 36em;
}

.country-toggle {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.country-btn {
  flex: 1;
  min-height: 36px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
}
.country-btn.active {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.search-wrap {
  margin-bottom: 12px;
}
.search-wrap input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-wrap input::placeholder { color: var(--muted-soft); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: rgba(59, 91, 219, 0.28);
}

.partners-strip { margin: 4px 0 16px; opacity: 1; transform: none; }
.partners-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.partners-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  margin: 0 -18px;
  padding: 2px 18px 10px;
  scroll-padding-left: 18px;
  scrollbar-width: none;
}
.partners-rail::-webkit-scrollbar { display: none; }
.partner-card {
  flex: 0 0 auto;
  width: 256px;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px 12px 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(11, 13, 18, 0.04), 0 6px 16px rgba(11, 13, 18, 0.06);
  transition: transform var(--motion), box-shadow var(--motion);
}
.partner-card:active { transform: scale(0.97); }
.partner-logo {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-strong);
  display: block;
}
.partner-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.partner-card--fuel .partner-logo { border-color: transparent; }
.partner-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.partner-body strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partner-body > span {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partner-arrow {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.deals-status {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 550;
  margin-bottom: 12px;
}

.deals-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease-out) both;
  transition: transform var(--motion), box-shadow var(--motion), border-color var(--motion);
}
.deal-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-sm);
}
@media (hover: hover) {
  .deal-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(59, 91, 219, 0.18);
  }
}
.deal-card--hub { opacity: 0.9; }
.deal-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}

/* —— Hero / campaign media —— */
.deal-media {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 168px;
  max-height: 220px;
  background:
    radial-gradient(120% 90% at 12% 10%, rgba(94, 234, 212, 0.28), transparent 55%),
    radial-gradient(100% 80% at 88% 20%, rgba(59, 91, 219, 0.32), transparent 50%),
    linear-gradient(145deg, #0B0D12 0%, #1A1F2E 48%, #243B9B 120%);
  overflow: hidden;
}
.deal-media--noimg {
  display: grid;
  place-items: center;
}
.deal-media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--surface-2);
}
.deal-media-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 20px;
  text-align: center;
}
.deal-media-initial {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
}
.deal-media-merchant {
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.02em;
  max-width: 90%;
}

.deal-media-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11,13,18,0.08) 0%, transparent 42%, rgba(11,13,18,0.55) 100%);
}
.deal-media--noimg .deal-media-overlay {
  background: linear-gradient(180deg, transparent 40%, rgba(11,13,18,0.35) 100%);
}

.deal-discount {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #12B76A 0%, #0E9F5C 100%);
  box-shadow: 0 4px 14px rgba(18, 183, 106, 0.35);
}
.deal-discount[data-kind="flash"] {
  background: linear-gradient(135deg, #F79009 0%, #E06200 100%);
  box-shadow: 0 4px 14px rgba(247, 144, 9, 0.35);
}

.deal-logo-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 6px 20px rgba(11, 13, 18, 0.22);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.deal-logo {
  width: 32px;
  height: 32px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.deal-logo-fallback {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}

/* —— Body —— */
.deal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.deal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.deal-badges { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.deal-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.deal-badge--source {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}
.deal-badge--type[data-type="flash"] {
  background: rgba(247, 144, 9, 0.12);
  color: #B54708;
  border-color: transparent;
}
.deal-badge--type[data-type="voyage"] {
  background: rgba(59, 91, 219, 0.1);
  color: var(--accent-deep);
  border-color: transparent;
}
.deal-badge--type[data-type="code"] {
  background: rgba(45, 212, 191, 0.14);
  color: #0F766E;
  border-color: transparent;
}
.deal-country {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted-soft);
  flex-shrink: 0;
}
.deal-merchant {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.deal-offer {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.deal-price {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.deal-benefit {
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 650;
}
.deal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.deal-meta {
  font-size: 0.7rem;
  color: var(--muted-soft);
  min-width: 0;
  line-height: 1.35;
}
.deal-cta {
  font-size: 0.8rem;
  font-weight: 750;
  color: var(--accent);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.deal-cta::after {
  content: "→";
  font-weight: 700;
  transition: transform 0.18s var(--ease-out);
}
@media (hover: hover) {
  .deal-card:hover .deal-cta::after { transform: translateX(2px); }
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  position: relative;
}
.empty-state--bons { margin-top: 8px; }
.empty-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.empty-sub {
  font-size: 0.82rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.mint-blob {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(20px);
  pointer-events: none;
}
.mint-blob--lg {
  width: 140px;
  height: 140px;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}
.mint-blob--sm {
  width: 48px;
  height: 48px;
  top: -8px;
  left: 12px;
}

/* ========== Settings ========== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field span {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}
.field input,
.field select {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-ghost {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  cursor: pointer;
}
.settings-hint {
  text-align: center;
  color: var(--success);
  font-weight: 650;
  font-size: 0.84rem;
  margin-top: 12px;
}
.about-row {
  position: relative;
  text-align: center;
  padding: 16px;
}
.about {
  font-size: 0.78rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

/* ========== Tab bar ========== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(10px + var(--safe-bottom));
  pointer-events: none;
  overflow: visible;
}
.tabbar-pill {
  pointer-events: auto;
  display: flex;
  gap: 4px;
  max-width: 400px;
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  border: none;
  background: transparent;
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 4px;
}
.tab.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.tab-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}
.tab-icon svg { width: 20px; height: 20px; }
.tab-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ========== Modals ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 13, 18, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.3s var(--ease-out);
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
.modal h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.modal-actions .btn-primary { flex: 1; }
.modal-actions .btn-ghost { flex: 0 0 auto; }

/* ========== Reveal ========== */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ========== Partner page ========== */
.partner-page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(16px + var(--safe-top)) 18px calc(32px + var(--safe-bottom));
  background: var(--bg-grad);
  color: var(--text);
}
.partner-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 91, 219, 0.18);
}
.partner-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(145deg, #1A1F2E, #0B0D12 60%);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.partner-hero img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  opacity: 0.92;
}
.partner-hero-fallback {
  height: 160px;
  background:
    radial-gradient(circle at 30% 40%, rgba(59,91,219,0.45), transparent 50%),
    linear-gradient(145deg, #1A1F2E, #0B0D12);
}
.partner-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.partner-brand-row img {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}
.partner-page h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 8px;
}
.partner-page .lede {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}
.partner-note {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 22px;
  line-height: 1.45;
}
.product-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.product-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform var(--motion), box-shadow var(--motion);
}
.product-card:active { transform: scale(0.985); }
.product-card img {
  width: 96px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface-2);
}
.product-card .ph {
  width: 96px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-2));
}
.product-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.product-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 8px;
}
.product-card .price {
  font-weight: 800;
  color: var(--accent-deep);
  font-size: 0.92rem;
}
.product-card .price s {
  color: var(--muted);
  font-weight: 600;
  margin-right: 6px;
}
.lissage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}
.lissage-pills span {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid rgba(59, 91, 219, 0.18);
}
.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-stack a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
}
.cta-stack .cta-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.cta-stack .cta-secondary {
  color: var(--accent-deep);
  background: var(--surface);
  border: 1px solid rgba(59, 91, 219, 0.22);
}

/* ========== Motion prefs ========== */
@media (prefers-reduced-motion: reduce) {
  .buddy, .buddy *,
  .reveal,
  .expense-item,
  .deal-card,
  .fab-bounce,
  .splash-word--in,
  .splash-letter,
  .splash-wordmark--in .splash-word-rule {
    animation: none !important;
    transition: none !important;
  }
  .splash-word,
  .splash-word--in,
  .splash-letter,
  .splash-word-rule {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .splash-word-rule { width: 3.4rem !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 400px) {
  .reste-card--hero .mascot-wrap,
  .reste-card--hero .buddy--hero { width: 96px; height: 128px; }
  .reste-card--hero.hero--long .mascot-wrap,
  .reste-card--hero.hero--long .buddy--hero { width: 72px; height: 96px; }
  .reste-card--hero .reste-amount { font-size: clamp(2.15rem, 10vw, 2.9rem); }
  .reste-card--hero .reste-amount[data-digits="4"] { font-size: clamp(1.75rem, 8vw, 2.4rem); }
  .reste-card--hero .reste-amount[data-digits="5"] { font-size: clamp(1.3rem, 5.8vw, 1.75rem); }
  .reste-card--hero .reste-amount[data-digits="6"],
  .reste-card--hero .reste-amount[data-digits="7"] { font-size: clamp(1.05rem, 4.8vw, 1.45rem); }
}

/* ===== Reste v21 — readable home ===== */
/* Syne only on the big remaining amount (and the splash wordmark). */
.reste-amount {
  font-family: var(--font-display);
}
h1.logo, .h3, .reste-daily, .buy-band, .status-pill, .status-line, .sc-label,
.prev-main, .gauge-score, .sav-val, .btn-cta, .section-head.tight h2, .home-h {
  font-family: var(--font);
}

.demo-badge {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(45, 212, 191, 0.14);
  color: #0F766E;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
}

.inapp-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 8px 16px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.reste-card--hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 28px 22px 26px;
  overflow: visible;
  margin-bottom: 8px;
}
.reste-card--hero .reste-card-top {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin-bottom: 18px;
  align-items: center;
  column-gap: 12px;
}
.reste-card--hero .reste-card-copy { position: relative; z-index: 2; }
.reste-card--hero .mascot-wrap,
.reste-card--hero .buddy--hero {
  width: 108px;
  height: 144px;
  z-index: 1;
}
.reste-card--hero .guy-host {
  overflow: visible;
  border-radius: 0;
}
.reste-card--hero .reste-label {
  font-size: 18px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 6px;
}
.reste-card--hero .reste-amount {
  display: block;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
}
.reste-card--hero .reste-amount[data-digits="4"] {
  font-size: clamp(2rem, 8.6vw, 2.85rem);
}
.reste-card--hero .reste-amount[data-digits="5"] {
  font-size: clamp(1.45rem, 6.4vw, 2.05rem);
}
.reste-card--hero .reste-amount[data-digits="6"],
.reste-card--hero .reste-amount[data-digits="7"] {
  font-size: clamp(1.2rem, 5.2vw, 1.7rem);
}
.reste-card--hero.hero--long .mascot-wrap,
.reste-card--hero.hero--long .buddy--hero {
  width: 84px;
  height: 112px;
}
.reste-days {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}
.reste-daily {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.45;
  color: #fff;
}
.reste-daily .per-day {
  margin-left: 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.9;
}
.status-line {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.45;
  color: #027A48;
}
.status-line.status--confort { color: #027A48; }
.status-pill {
  margin-top: 0;
  display: block;
  padding: 0;
  border-radius: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  background: transparent;
  color: #027A48;
}
.status--attention {
  background: rgba(247, 144, 9, 0.18);
  color: #B54708;
}
.status--serre {
  background: rgba(240, 68, 56, 0.18);
  color: #D92D20;
}
.status-line.status--attention,
.status-line.status--serre,
.status-line.status--confort {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.reste-card--hero .reste-forecast-line,
.home-later .reste-forecast-line {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
  opacity: 1;
}

.btn-cta {
  display: block;
  width: 100%;
  margin: 22px 0 0;
  padding: 18px 20px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--mint) 0%, #818CF8 100%);
  color: #0B0D12;
  font-family: var(--font);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.3;
  box-shadow: 0 10px 28px rgba(45, 212, 191, 0.28);
  cursor: pointer;
}
.btn-sos {
  display: block;
  width: 100%;
  margin: 12px 0 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 16px;
  background: #FEE4E2;
  color: #B42318;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
}

.home-later {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.home-h {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--ink);
}

.section-card {
  margin: 0;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--card-solid);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.section-head.tight { margin-bottom: 10px; }
.section-head.tight h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}
.prev-main { font-size: 16px; line-height: 1.45; margin-bottom: 12px; }
.scenario-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scenario {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
}
.scenario--mid {
  background: rgba(45, 212, 191, 0.12);
  outline: 1px solid rgba(45, 212, 191, 0.35);
}
.sc-label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
}
.scenario strong {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ai-lead {
  margin: 0 16px 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.ai-lead strong { color: var(--ink-soft); font-weight: 700; }
.ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-chip {
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.ai-chip:hover { border-color: var(--mint); }
.ai-thread {
  max-height: min(52vh, 420px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.ai-msg {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg--pending {
  color: var(--muted);
  font-style: italic;
}
.ai-msg--deal {
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.35);
}
.ai-msg--deal a { color: var(--accent-deep, #0f766e); font-weight: 700; text-decoration: none; }
.ai-follow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 2px;
}
.ai-follow .ai-chip {
  font-size: 14px;
  padding: 8px 12px;
  background: var(--surface-2, #f3f4f6);
}
.ai-msg--user {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--accent-deep);
  max-width: 90%;
}
.ai-msg--bot {
  align-self: flex-start;
  background: var(--surface-2);
  max-width: 95%;
}
.ai-form {
  display: flex;
  gap: 8px;
}
.ai-form input {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.goals-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.goal-item .goal-top { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; line-height: 1.4; }
.goal-sub { font-size: 15px; line-height: 1.45; color: var(--muted); margin: 6px 0 8px; }
.goal-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(11,13,18,0.06);
  overflow: hidden;
}
.goal-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), #818CF8);
  border-radius: inherit;
}

.savings-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.savings-counters > div {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  text-align: center;
}
.sav-val { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.sav-lab { display: block; margin-top: 6px; font-size: 16px; line-height: 1.4; color: var(--muted); }

.quick-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}
.tool-btn {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-weight: 650;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.tool-btn:hover { border-color: var(--mint); }

.tab--ai .tab-icon {
  color: #6366F1;
}
.tab--ai.active .tab-icon,
.tab--ai.active .tab-label {
  color: #4F46E5;
}
.tabbar-pill { gap: 0; }
.tab { min-width: 0; flex: 1; padding: 8px 2px 6px; }
.tab-label { font-size: 11px; line-height: 1.25; letter-spacing: 0; font-weight: 600; }

.btn-sm { padding: 10px 14px; border-radius: 12px; font-size: 13px; }
.btn-danger {
  background: #D92D20;
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.modal--lg { max-height: min(92vh, 720px); overflow: auto; }
.modal-actions.col { flex-direction: column; align-items: stretch; }
.modal-actions.col > * { width: 100%; }

.photo-preview {
  margin: 8px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #0B0D12;
}
.photo-preview img { display: block; width: 100%; max-height: 180px; object-fit: contain; }

.gauge-wrap { position: relative; width: 180px; margin: 8px auto 0; }
.gauge { width: 100%; }
.gauge-bg { stroke: rgba(11,13,18,0.08); }
.gauge-fill { stroke: var(--mint); transition: stroke-dasharray 0.6s var(--ease-out); }
.gauge--tres, .gauge--possible { stroke: #12B76A; }
.gauge--reflet { stroke: #F79009; }
.gauge--mauvais, .gauge--eviter { stroke: #F04438; }
.gauge-score {
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
}
.gauge-score small { font-size: 12px; opacity: 0.6; }
.buy-result { margin-top: 8px; }
.buy-result-name { font-weight: 800; font-size: 18px; font-family: var(--font-display); }
.buy-result-price { color: var(--muted); margin-bottom: 4px; }
.buy-band { text-align: center; font-weight: 800; margin: 8px 0; }
.band--tres { color: #039855; }
.band--possible { color: #027A48; }
.band--reflet { color: #B54708; }
.band--mauvais { color: #B42318; }
.band--eviter { color: #912018; }
.buy-deltas { list-style: none; font-size: 13.5px; margin: 10px 0; display: grid; gap: 6px; }
.buy-advice { font-size: 14px; margin-bottom: 12px; }

.reco-badge {
  display: inline-block;
  margin: 0 0 8px 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45,212,191,0.16);
  color: #0F766E;
  font-size: 11px;
  font-weight: 800;
}
.deal-card--reco { outline: 1px solid rgba(45,212,191,0.45); }

.muted-note { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 8px; }
.h3 { font-size: 15px; font-weight: 800; margin-bottom: 6px; font-family: var(--font-display); }
.plus-list { margin: 8px 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-soft); }
.plus-list li { margin: 4px 0; }

.sos-list { margin: 10px 0; padding-left: 18px; font-size: 14px; }
.sos-deals { margin-top: 10px; }
.vbp-result { margin-top: 12px; }
.sim-row {
  display: grid;
  grid-template-columns: 1fr 90px 36px;
  gap: 8px;
  margin-bottom: 8px;
}
.sim-row input {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px;
}
.sim-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 13.5px;
  display: grid;
  gap: 4px;
}

#view-accueil,
#view-depenses {
  /* Clears the + button, which sits above the tab bar. */
  padding-bottom: calc(88px + var(--safe-bottom));
}
#view-bonsplans,
#view-profil {
  padding-bottom: calc(40px + var(--safe-bottom));
}
#view-ai {
  /* Fil de chat + formulaire au-dessus de la barre d'onglets. */
  padding-bottom: calc(96px + var(--safe-bottom));
}
#view-ai .ai-lead, #view-ai .ai-prompts, #view-ai .ai-thread, #view-ai .ai-form {
  margin-left: 16px;
  margin-right: 16px;
}

@media (min-width: 720px) {
  #app, .ambient-field { max-width: 480px; }
}


/* ===== v22 — amount never sits under the mascot; deals fully visible ===== */
.deal-link {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 16px;
  min-width: 0;
}
.deal-logo-wrap {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.deal-logo-wrap .deal-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  object-position: center;
}
.deal-logo-fb {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-deep);
}
.deal-card .deal-body {
  padding: 0;
  min-width: 0;
  gap: 4px;
  flex: 1;
}
.deal-title {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.deal-card .deal-merchant,
.deal-card .deal-price {
  font-size: 15px;
  line-height: 1.35;
}
.scenario {
  min-width: 0;
}
.sc-label { min-width: 0; }
.goal-top strong { min-width: 0; overflow-wrap: anywhere; }
.home-later { gap: 20px; }


/* ===== v23 — deal cards polish (no third-party favicons) ===== */
.deal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}
.deal-pill {
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.deal-pill--src {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: transparent;
}
.deal-pill--type {
  background: rgba(59, 91, 219, 0.1);
  color: var(--accent-deep);
  border-color: transparent;
}
.deal-validity {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}
.deal-cta-inline {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--accent);
}
.deal-logo-wrap .deal-logo-fb {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.demo-badge {
  letter-spacing: 0.01em;
}


/* v23 fab clearance — + button must not cover forecast figures */
#view-accueil .scenario-row {
  padding-right: 56px;
}
#view-accueil #prevision-card {
  position: relative;
  z-index: 1;
}
.fab {
  z-index: 40;
}
.tabbar {
  z-index: 50;
}

/* ===== v25 — Reste AI v2 : chips compactes, fil plus grand, suggestions de suite ===== */
#view-ai .ai-prompts { gap: 6px; }
#view-ai .ai-prompts .ai-chip { font-size: 14.5px; padding: 9px 13px; line-height: 1.25; }
#view-ai .ai-chip:disabled, #view-ai .ai-form button:disabled { opacity: .55; cursor: default; }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: aiDot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; }
.ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ai-typing i { animation: none; opacity: .6; } }
.ai-note { font-size: 12.5px; color: var(--muted); margin: -2px 0 2px 4px; }

/* ===== v26 — logos de marques sur les offres ===== */
.deal-logo-wrap { background: #fff; position: relative; }
.deal-logo-wrap .deal-logo.deal-logo--brand {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.deal-logo-wrap--brand { border-color: var(--border-strong); }
.deal-logo-wrap .deal-logo-fb[hidden] { display: none !important; }

/* ===== Reste AI v3 — fil structuré, affichage progressif, historique local ===== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#view-ai .ai-hero { display: flex; align-items: flex-start; gap: 10px; margin: 0 16px 10px; }
#view-ai .ai-hero .ai-lead { margin: 0; flex: 1; font-size: 14px; }
.ai-clear { flex: none; border: 1px solid var(--border-strong); background: var(--card-solid); color: var(--muted); border-radius: 999px; padding: 7px 12px; font: 600 13px/1 var(--font); min-height: 32px; cursor: pointer; }
.ai-clear:hover { color: var(--ink); border-color: var(--accent); }
.ai-clear:focus-visible, #view-ai .ai-chip:focus-visible, #view-ai .ai-thread:focus-visible, .ai-deal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#view-ai .ai-prompts { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 16px 6px; margin: 0 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#view-ai .ai-prompts::-webkit-scrollbar { display: none; }
#view-ai .ai-prompts .ai-chip { flex: none; scroll-snap-align: start; white-space: nowrap; font-size: 14px; padding: 9px 14px; min-height: 40px; background: var(--card-solid); box-shadow: var(--shadow-sm); }
#view-ai .ai-prompts .ai-chip:first-child { margin-left: 0; }
#view-ai .ai-prompts { margin-left: 0 !important; margin-right: 0 !important; }
#view-ai .ai-thread { max-height: none; min-height: 220px; height: calc(100dvh - 330px - var(--safe-bottom) - var(--safe-top)); padding: 4px 2px 8px; gap: 10px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { #view-ai .ai-thread { scroll-behavior: auto; } }
#view-ai .ai-msg { font-size: 15.5px; line-height: 1.5; white-space: normal; border-radius: 18px; animation: aiIn .28s var(--ease-out) both; }
@keyframes aiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view-ai .ai-msg { animation: none; } }
#view-ai .ai-msg--user { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; max-width: 86%; font-weight: 500; }
#view-ai .ai-msg--bot { background: var(--card-solid); border: 1px solid var(--border); box-shadow: var(--shadow-sm); border-bottom-left-radius: 6px; max-width: 96%; }
.ai-who { display: flex; align-items: center; gap: 6px; font: 700 11.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 6px; }
.ai-who::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--mint)); }
.ai-body p { margin: 0 0 6px; }
.ai-body p:last-child { margin-bottom: 0; }
.ai-body .ai-num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-list { list-style: none; margin: 6px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-list li { position: relative; padding: 8px 10px 8px 26px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; font-size: 14.5px; line-height: 1.42; }
.ai-list li::before { content: ""; position: absolute; left: 10px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.ai-src { font-size: 12.5px; color: var(--muted); }
.ai-msg--streaming .ai-body::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); border-radius: 2px; animation: aiCaret .8s steps(2) infinite; }
@keyframes aiCaret { 50% { opacity: 0; } }
.ai-msg--pending { font-style: normal !important; }
.ai-pending-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.ai-typing i { background: var(--accent) !important; }
.ai-msg--error { border-color: rgba(240, 68, 56, .35) !important; background: rgba(240, 68, 56, .06) !important; }
.ai-retry { display: flex; }
.ai-chip--primary { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
#view-ai .ai-msg--deal { display: flex; flex-direction: column; gap: 4px; background: linear-gradient(135deg, rgba(45, 212, 191, .10), rgba(59, 91, 219, .08)); border: 1px solid rgba(45, 212, 191, .45); }
.ai-deal-tag { font: 700 11.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: #0f766e; }
.ai-deal-title { font-size: 15px; line-height: 1.35; color: var(--ink); }
.ai-deal-benefit { font-size: 13.5px; color: var(--ink-soft); }
.ai-deal-link { align-self: flex-start; margin-top: 4px; padding: 6px 0; font-weight: 700; color: var(--accent-deep); text-decoration: none; min-height: 32px; }
#view-ai .ai-follow { gap: 6px; margin: 0 0 2px; }
#view-ai .ai-follow .ai-chip { font-size: 13.5px; padding: 8px 12px; min-height: 36px; background: var(--card-solid); border-color: rgba(59, 91, 219, .3); color: var(--accent-deep); }
.ai-note--center { text-align: center; margin: 2px 0 !important; font-size: 12px; }
#view-ai .ai-form { position: relative; align-items: center; background: var(--card-solid); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 5px 5px 14px; box-shadow: var(--shadow-md); }
#view-ai .ai-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md); }
#view-ai .ai-form input { border: 0; background: transparent; padding: 10px 0; font-size: 16px; min-width: 0; outline: none; }
#view-ai .ai-send { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; min-height: 42px; padding: 0 16px; }
@media (max-width: 380px) { #view-ai .ai-send span { display: none; } #view-ai .ai-send { padding: 0 13px; } }
#view-ai .ai-form input { flex: 1 1 auto; width: 100%; }
#view-ai .ai-send { flex: none; width: auto; }
#view-ai .ai-thread { height: calc(100dvh - 392px - var(--safe-bottom) - var(--safe-top)); min-height: 240px; }
#view-ai .ai-hero .ai-lead { font-size: 13.5px; line-height: 1.4; }
