:root {
  --bg: #0c1410;
  --bg-soft: #121a16;
  --card: #151d19;
  --text: #e8eee9;
  --muted: #8a968e;
  --border: #25312b;
  --accent: #2aa84f;
  --accent-2: #3cb86a;
  --danger: #e0555b;
  --ok: #3cb86a;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --font: "Roboto Slab", "Georgia", "Times New Roman", serif;
  --focus-ring: 0 0 0 3px rgba(42, 168, 79, 0.22);
  --transition: 150ms ease;
  --layout-max: 1100px;
  --trade-panel-max: 40rem;
  --wallet-actions-max: 26rem;
  --app-header-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden; /* empêche le scroll horizontal global (listes/badges trop larges) */
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { color: var(--accent-2); }

.wrap {
  width: min(980px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(160px, 42vw);
  object-fit: contain;
}

.brand-text {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.auth-shell {
  width: min(440px, 100%);
  margin: 0 auto;
}

/* Auth : hero marque + feuille formulaire (login / inscription) */
body.page-auth-stage {
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
}

.auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
}

.auth-hero {
  position: relative;
  flex: 0 0 auto;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1.25rem 2.75rem;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, transparent 42%),
    linear-gradient(180deg, #2aa84f 0%, #1a7a38 100%);
  overflow: hidden;
}
.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.auth-hero::before {
  width: 180px;
  height: 220px;
  top: -40px;
  right: -30px;
  transform: rotate(24deg);
}
.auth-hero::after {
  width: 140px;
  height: 160px;
  bottom: 10px;
  left: -50px;
  transform: rotate(-18deg);
}

.auth-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.brand-text--on-accent { color: #ffffff; }
.brand-logo--on-accent {
  height: 36px;
  max-width: min(148px, 46vw);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 0.28rem 0.55rem;
  box-sizing: content-box;
}

.icon-btn--on-accent {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.icon-btn--on-accent:hover,
.icon-btn--on-accent:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.auth-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 22rem;
}
.auth-hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.auth-hero-title {
  margin: 0;
  font-size: clamp(1.85rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #ffffff;
}
.auth-hero-lead {
  margin: 0.45rem 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.88);
}

.auth-sheet {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  margin-top: -1.35rem;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
  padding: 1.55rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.auth-sheet-inner {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
}

.auth-cta {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  margin-top: 0.25rem;
}

.auth-back {
  width: 100%;
  margin-top: 0.35rem;
}

.auth-switch {
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.auth-switch a {
  font-weight: 700;
  color: var(--accent);
}

.auth-forgot {
  margin: -0.25rem 0 0;
  text-align: right;
  font-size: 0.88rem;
}

.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.25rem;
}
.auth-step {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.auth-step.is-active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}
.auth-step.is-done {
  color: var(--accent);
  border-color: rgba(42, 168, 79, 0.45);
  background: rgba(42, 168, 79, 0.1);
}
.auth-step-line {
  width: 2.5rem;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}

.auth-account-chip {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.4;
}

body.page-auth-stage .field-input {
  min-height: 50px;
  border-radius: 12px;
  background: var(--bg-soft);
}

html[data-theme="light"] body.page-auth-stage {
  background: #f3f5f3;
}
html[data-theme="light"] .auth-sheet {
  background: #ffffff;
  border-color: #e8ece9;
  box-shadow: 0 -6px 24px rgba(18, 24, 22, 0.06);
}
html[data-theme="light"] body.page-auth-stage .field-input {
  background: #f4f6f4;
  border-color: #e1e6e2;
}

@media (min-width: 720px) {
  .auth-stage {
    max-width: 440px;
    min-height: auto;
    margin: 2.5rem auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }
  .auth-hero {
    padding: 1.15rem 1.5rem 2.5rem;
  }
  .auth-sheet {
    margin-top: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    padding: 1.75rem 1.5rem 1.75rem;
  }
}

/* Ancien shell auth (pages non migrées) */
body.page-auth:not(.page-auth-stage) .wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 1.25rem;
}
body.page-auth:not(.page-auth-stage) .auth-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: min(440px, 100%);
  margin-inline: auto;
  padding-block: 0.75rem 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-card { padding: 1.5rem 1.35rem 1.4rem; }

.auth-card h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 2.5vw, 1.6rem);
  font-weight: 600;
}

.auth-lead {
  margin: 0 0 1.15rem;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.stack { display: grid; gap: 0.95rem; }
[hidden] { display: none !important; }

.field { display: grid; gap: 0.4rem; }

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.field-icon {
  position: absolute;
  left: 0.85rem;
  display: inline-flex;
  color: var(--muted);
  pointer-events: none;
  transition: color var(--transition);
}

.field-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 2;
}

.field-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  background: #0b1b13;
  color: var(--text);
  border-radius: 12px;
  padding: 0.8rem 2.7rem 0.8rem 2.55rem;
  font: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

select.field-input {
  appearance: none;
  cursor: pointer;
}

.field-input::placeholder { color: #6f8577; }

.field-input:hover { border-color: #2a5d3f; }

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.field-control:focus-within .field-icon { color: var(--accent-2); }

.field.is-error .field-input {
  border-color: rgba(255, 95, 101, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 95, 101, 0.14);
}

.field.is-success .field-input {
  border-color: rgba(60, 184, 106, 0.65);
}

.field-action {
  position: absolute;
  right: 0.35rem;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.field-action:hover,
.field-action:focus-visible {
  color: var(--accent-2);
  background: rgba(42, 168, 79, 0.1);
  outline: none;
}

.field-action svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 2;
}

.field-action .is-hidden { display: none !important; }

.field-message {
  margin: 0;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.field-message-error { color: #ffd3d5; }
.field-message-success { color: #d8ffe2; }
.field-message svg { width: 0.95rem; height: 0.95rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
  transition: transform var(--transition), filter var(--transition), box-shadow var(--transition), opacity var(--transition), background var(--transition);
  box-shadow: none;
}

.btn svg { width: 1.05rem; height: 1.05rem; stroke-width: 2.2; }

.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(0.97); }
.btn:disabled,
.btn.is-loading,
.btn.is-disabled {
  opacity: 0.78;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.btn.btn-trade-submit:disabled,
.btn.btn-trade-submit.is-disabled {
  background: #6b7280;
  color: #e5e7eb;
  border-color: #6b7280;
  box-shadow: none;
  filter: none;
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  border-color: #3a4a42;
  background: rgba(255, 255, 255, 0.04);
  filter: none;
}

.btn-sm {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
}

.btn-loader {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn-loader { display: inline-block; }
.btn.is-loading .btn-icon { display: none; }

.alert {
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert svg { width: 1rem; height: 1rem; flex: 0 0 auto; margin-top: 0.1rem; }

.alert-error {
  background: rgba(255, 95, 101, 0.12);
  border: 1px solid rgba(255, 95, 101, 0.35);
  color: #ffd3d5;
}

.alert-ok {
  background: rgba(42, 168, 79, 0.1);
  border: 1px solid rgba(42, 168, 79, 0.28);
  color: #c8e6d1;
}

.muted { color: var(--muted); font-size: 0.92rem; }
.auth-forgot {
  margin: -0.35rem 0 0;
  text-align: right;
}

.auth-forgot a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.auth-forgot a:hover {
  text-decoration: underline;
}

.auth-forgot a i {
  width: 1rem;
  height: 1rem;
}

.auth-switch { margin: 0.25rem 0 0; text-align: center; }

.grid-2 {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1fr);
}
/* Portefeuilles / KPI numériques : 2 colonnes dès le mobile */
.wallet-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.stat-card {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}
.stat-card-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}
.stat-card-value {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.stat-card--money .stat-card-value {
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 359px) {
  .stat-card--money {
    grid-column: 1 / -1;
  }
}
@media (min-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat-card--money {
    grid-column: auto;
  }
}
@media (min-width: 720px) {
  .grid-2,
  .wallet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th, .table td {
  text-align: left;
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--muted); font-weight: 600; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* Reveal / entrance — discret et rapide */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms ease, transform 200ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-auth .auth-card .reveal:nth-child(1) { --reveal-delay: 20ms; }
.page-auth .auth-card .reveal:nth-child(2) { --reveal-delay: 40ms; }
.page-auth .auth-card .reveal:nth-child(3) { --reveal-delay: 60ms; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 1.1rem); padding-top: 0.85rem; }
  .nav { align-items: flex-start; }
  .brand-logo { height: 34px; }
  .auth-card { padding: 1.2rem 1rem 1.15rem; }
  .nav-actions .btn span { display: none; }
  .nav-actions .btn { min-width: 42px; padding-inline: 0.7rem; }

  body.page-auth .wrap {
    padding-top: 0.65rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  body.page-auth .nav {
    margin-bottom: 0.35rem;
  }

  body.page-auth .auth-shell {
    padding-block: 0.5rem 0.75rem;
  }
}

/* ========== APP SHELL / DASHBOARD ========== */
.page-app {
  min-height: 100%;
}

.app-shell {
  min-height: 100vh;
  /* Espace réservé au header fixed + safe-area (encoche). */
  padding-top: calc(var(--app-header-height) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  overflow: visible;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  backdrop-filter: blur(10px);
  background: rgba(12, 20, 16, 0.96);
  border-bottom: 1px solid var(--border);
  /* Ancré au viewport — seul le corps défile. */
  transform: translateZ(0);
}

.app-header-inner {
  width: min(var(--layout-max), calc(100% - 1.25rem));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.app-nav-desktop {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.app-nav-link svg { width: 1rem; height: 1rem; }
.app-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.app-nav-link.is-active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: none;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: #2f6a48;
  background: rgba(42, 168, 79, 0.1);
  outline: none;
}
.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(7, 20, 13, 0.9);
}
.badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--accent-2);
  color: #04110a;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(7, 20, 13, 0.9);
  pointer-events: none;
}
html[data-theme="light"] .badge-count {
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
}
.badge-count[hidden] { display: none !important; }

.app-main {
  width: min(var(--layout-max), calc(100% - 1.25rem));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 1.1rem 0 1.5rem;
  box-sizing: border-box;
}

.app-container {
  display: grid;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

.page-enter {
  animation: pageIn 200ms ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-block h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-text { margin: 0; color: var(--muted); }

.balance-hero {
  padding: 1.05rem 1.1rem;
  background: var(--card);
}
.balance-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.balance-hero-value {
  margin-top: 0.3rem;
  font-size: clamp(1.35rem, 3.4vw, 1.7rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.balance-hero-value small,
.wallet-amount small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.balance-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.1);
  color: var(--accent);
  border: 1px solid var(--border);
}
.balance-hero-icon svg { width: 1.25rem; height: 1.25rem; }
.balance-hero-grid {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.balance-hero-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.balance-hero-grid strong {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* ——— Dashboard home (fintech) ——— */
.home-greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}
.home-greeting-kicker {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.home-greeting-title {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.home-balance {
  border-radius: 22px;
  padding: 1.2rem 1.15rem 1.1rem;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(42, 168, 79, 0.14), transparent 55%),
    var(--card);
  box-shadow: var(--shadow);
}
.home-balance-cta {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: #ffffff !important;
  border: 0;
  box-shadow: none;
  transition: background var(--transition), transform var(--transition);
}
.home-balance-cta svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke: currentColor;
  color: #ffffff;
}
.home-balance-cta:hover {
  background: var(--accent-2);
  color: #ffffff !important;
  transform: scale(1.04);
}
.home-balance-note {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.wallet-card--link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.wallet-card--link:hover {
  border-color: #3a4a42;
  color: inherit;
}
.wallet-card-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.home-invite {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), background var(--transition);
}
.home-invite:hover {
  border-color: #3a4a42;
  color: var(--text);
}
.home-invite-copy strong {
  color: var(--text);
}
.home-invite-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.12);
  color: var(--accent);
  flex: 0 0 auto;
}
.home-invite-icon svg { width: 1.15rem; height: 1.15rem; }
.home-invite-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}
.home-invite-copy strong {
  font-size: 0.98rem;
  font-weight: 650;
}
.home-invite-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}
.home-invite-chevron {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  flex: 0 0 auto;
}

.home-activity .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
}
.home-activity .section-title { margin: 0; }
.section-link {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
}
.home-activity-card {
  border-radius: 18px;
  padding: 0.35rem 1rem 0.55rem;
}
.activity-list--home {
  gap: 0;
}
.activity-list--home .activity-item {
  padding: 0.85rem 0;
  border-bottom-color: var(--border);
}
.activity-list--home .activity-icon {
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

html[data-theme="light"] .home-balance {
  background:
    linear-gradient(135deg, rgba(31, 157, 69, 0.08), #ffffff 52%);
  border: 1px solid #dde3df;
  box-shadow: 0 4px 16px rgba(18, 24, 22, 0.06);
}
html[data-theme="light"] .home-balance-cta,
html[data-theme="light"] .home-balance-cta:hover {
  color: #ffffff !important;
}
html[data-theme="light"] .home-balance-cta svg {
  color: #ffffff;
  stroke: #ffffff;
}
html[data-theme="light"] .home-invite:hover,
html[data-theme="light"] .wallet-card--link:hover {
  border-color: #cfd6d1;
}
html[data-theme="light"] .activity-list--home .activity-icon {
  background: #f3f5f3;
  color: #1a2420;
}

.balance-hero-split {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.15rem 0.1rem;
  transition: background var(--transition);
}
.balance-hero-split strong {
  color: var(--text);
}
.balance-hero-split:hover {
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="light"] .balance-hero-split:hover {
  background: rgba(18, 24, 22, 0.04);
}

.home-shortcuts {
  display: grid;
  gap: 0.55rem;
}
.home-shortcut {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), background var(--transition);
}
.home-shortcut:hover {
  border-color: #3a4a42;
  color: var(--text);
}
.home-shortcut-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(42, 168, 79, 0.12);
  color: var(--accent);
  border: 1px solid rgba(42, 168, 79, 0.22);
}
.home-shortcut-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}
.home-shortcut-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}
.home-shortcut-copy strong {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text);
}
.home-shortcut-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.3;
}
.home-shortcut-chevron {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  flex: 0 0 auto;
}
html[data-theme="light"] .home-shortcut:hover {
  border-color: #cfd6d1;
}
html[data-theme="light"] .home-shortcut-icon {
  background: rgba(31, 157, 69, 0.1);
  border-color: rgba(31, 157, 69, 0.2);
}

.wallet-card {
  padding: 0.85rem 0.9rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.wallet-card:hover {
  transform: none;
  border-color: #33443c;
  box-shadow: var(--shadow);
}
.wallet-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.wallet-card-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}
.wallet-card-title svg { width: 0.95rem; height: 0.95rem; color: var(--accent); }
.wallet-amount {
  font-size: clamp(1.02rem, 2.6vw, 1.15rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.wallet-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.4rem 0 0;
  border-top: 1px solid var(--border);
}
.wallet-meta span {
  flex: 1 1 auto;
  min-width: 0;
  background-image: linear-gradient(to right, rgba(138, 150, 142, 0.35) 33%, transparent 0);
  background-position: 0 0.85em;
  background-size: 5px 1px;
  background-repeat: repeat-x;
  padding-right: 0.35rem;
}
.wallet-meta strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--card);
  padding-left: 0.25rem;
  flex: 0 0 auto;
}
.wallet-meta-locked span { color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

.section-head { margin-top: 0.35rem; min-width: 0; max-width: 100%; }
.section-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.section-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(16, 42, 27, 0.95), rgba(13, 33, 23, 0.95));
  color: var(--text);
  font-weight: 500;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.quick-action svg { width: 1.15rem; height: 1.15rem; color: var(--accent-2); }
.quick-action:hover {
  transform: translateY(-1px);
  border-color: #2f6a48;
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 1.4rem 0.75rem;
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.1);
  border: 1px solid rgba(42, 168, 79, 0.22);
  color: var(--accent-2);
}
.empty-icon svg { width: 1.25rem; height: 1.25rem; }
.empty-state h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.activity-list,
.notif-list,
.market-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.activity-item,
.notif-item,
.market-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(29, 73, 48, 0.45);
  min-width: 0;
  max-width: 100%;
}
.activity-item:last-child,
.notif-item:last-child,
.market-item:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.1);
  color: var(--accent-2);
  flex: 0 0 auto;
}
.activity-icon svg { width: 1rem; height: 1rem; }
.activity-body,
.market-body {
  flex: 1 1 auto;
  min-width: 0;
}
.activity-body strong,
.market-body strong,
.notif-item strong {
  display: block;
  margin-bottom: 0.15rem;
}
.activity-body span,
.market-body span,
.notif-item p,
.notif-item time {
  color: var(--muted);
  font-size: 0.86rem;
}
.activity-meta {
  text-align: right;
  flex: 0 0 auto;
}
.activity-meta time {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}
.market-logos {
  display: flex;
  align-items: center;
}
.market-logos img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(7, 20, 13, 0.9);
  background: #0b1b13;
}
.market-logos img + img { margin-left: -8px; }
.market-note { margin: 1rem 0 0; }

.market-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.market-link:hover .market-body strong { color: var(--accent-2); }
.market-meta {
  text-align: right;
  flex: 0 0 auto;
  display: grid;
  gap: 0.12rem;
  justify-items: end;
  min-width: 0;
}
.market-meta strong { font-size: 0.98rem; }
.market-meta .muted { font-size: 0.72rem; }
.change-up { color: var(--ok); }
.change-down { color: var(--danger); }

.trade-pair-head {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.trade-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
}
.trade-pair-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.trade-pair-title h1 {
  margin: 0;
  font-size: 1.35rem;
}
.trade-price-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.trade-price-row > div {
  min-width: 0;
}
.trade-price-row .muted {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}
.trade-price {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.trade-refresh-note { margin: 0; font-size: 0.82rem; }
.trade-chart-card { padding: 0.75rem; min-width: 0; }
.trade-chart-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.trade-intervals {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
}
.trade-intervals .btn.is-active {
  background: rgba(42, 168, 79, 0.18);
  border-color: rgba(42, 168, 79, 0.45);
  color: var(--text);
}
.trade-chart {
  width: 100%;
  max-width: 100%;
  min-height: 240px;
  height: 280px;
}
.trade-chart-empty { margin: 0.5rem 0 0; }
.trade-panel {
  width: 100%;
}
.trade-side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.trade-side-btn {
  width: 100%;
  min-height: 46px;
  padding: 0.75rem 0.85rem;
  opacity: 0.52;
  outline: none;
  box-shadow: none;
}
.btn.trade-side-long,
.trade-side-long {
  background: var(--accent);
  color: #ffffff;
}
.btn.trade-side-short,
.trade-side-short {
  background: var(--danger);
  color: #ffffff;
}
.trade-side-btn:hover {
  filter: none;
  transform: none;
  opacity: 0.78;
}
.trade-side-btn.is-selected,
.trade-side-btn.is-selected:hover {
  opacity: 1;
  outline: none;
  box-shadow: none;
  filter: none;
  transform: none;
}
html[data-theme="light"] .btn.trade-side-long,
html[data-theme="light"] .trade-side-long {
  background: var(--accent);
  color: #ffffff;
}
html[data-theme="light"] .btn.trade-side-short,
html[data-theme="light"] .trade-side-short {
  background: var(--danger);
  color: #ffffff;
}
.trade-direction-row {
  margin-top: 0.85rem;
}

@media (min-width: 768px) {
  .trade-panel {
    width: min(100%, var(--trade-panel-max));
    max-width: var(--trade-panel-max);
    margin-inline: auto;
  }
  .trade-side-btn {
    min-height: 44px;
    padding: 0.65rem 0.9rem;
  }
}

@media (min-width: 1280px) {
  .trade-side-actions {
    gap: 0.75rem;
  }
  .trade-side-btn {
    min-height: 42px;
    padding: 0.6rem 1rem;
    border-radius: 12px;
  }
}

.trade-open-section {
  width: 100%;
}
.trade-open-list {
  display: grid;
  gap: 0.85rem;
}
.trade-position-card {
  width: 100%;
  border-color: var(--border);
  background: var(--card);
}
.trade-position-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.trade-position-head strong {
  display: block;
  font-size: 1.05rem;
}
.trade-position-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 600;
}
.trade-position-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 168, 79, 0.18);
}
.trade-position-dir {
  flex: 0 0 auto;
}
.trade-position-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}
.trade-position-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}
.trade-position-grid strong {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.trade-position-countdown {
  margin-top: 0.95rem;
  text-align: center;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.trade-position-countdown.is-settling {
  color: var(--accent-2);
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
  letter-spacing: 0.02em;
}
.trade-position-card.is-settling .trade-position-status {
  color: var(--accent-2);
}
.trade-position-card.is-settling .trade-position-dot {
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(42, 168, 79, 0.18);
  animation: tradeSettlePulse 1.1s ease-in-out infinite;
}
@keyframes tradeSettlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
  .trade-position-card.is-settling .trade-position-dot {
    animation: none;
  }
}

@media (min-width: 768px) {
  .trade-open-section,
  .trade-open-list,
  .trade-position-card {
    width: min(100%, var(--trade-panel-max));
    max-width: var(--trade-panel-max);
    margin-inline: auto;
  }
}

@media (max-width: 360px) {
  .trade-position-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="light"] .trade-position-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(31, 157, 69, 0.08), transparent 42%),
    var(--card);
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
.field-feedback {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}
.field-feedback.is-error {
  color: #ff7a80;
}
.field-feedback.is-ok {
  color: #35c95b;
}
.field-feedback.is-pending {
  color: var(--muted);
  font-weight: 500;
}
/* Espacement compact Solde → actions → portefeuilles (gap .app-container déjà présent). */
.balance-hero + .wallet-actions {
  margin-top: 0.15rem;
}
.wallet-actions + .wallet-grid {
  margin-top: 0.2rem;
}
.trade-form {
  margin-top: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.kybit-toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 0.65rem);
  z-index: 80;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  pointer-events: none;
  padding: 0 0.85rem;
}
.kybit-toast {
  pointer-events: auto;
  max-width: 22rem;
  width: min(100%, 22rem);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 92%, #000 8%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.kybit-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.kybit-toast.is-ok {
  border-color: rgba(42, 168, 79, 0.45);
}
.kybit-toast.is-error {
  border-color: rgba(255, 95, 101, 0.45);
}
@media (min-width: 900px) {
  .kybit-toast-host {
    bottom: 1.25rem;
  }
}
html[data-theme="light"] .kybit-toast {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 40, 24, 0.12);
}
.trade-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.trade-summary .muted { display: block; font-size: 0.78rem; margin-bottom: 0.2rem; }

@media (max-width: 430px) {
  .trade-price-row {
    grid-template-columns: 1fr 1fr;
  }
  .trade-price-row > div:last-child {
    grid-column: 1 / -1;
  }
  .trade-chart { height: 240px; }
}

@media (min-width: 768px) {
  .trade-chart { height: 340px; }
  .trade-pair-title h1 { font-size: 1.6rem; }
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(29, 73, 48, 0.45);
}
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row--uid .uid-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.info-row--uid .uid-value code {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  overflow-wrap: anywhere;
}
.info-row--uid .uid-value .icon-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 auto;
}
.referral-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1b13;
}
.referral-box code {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}
.referral-box-link {
  flex-direction: column;
  align-items: stretch;
}
.referral-box-link .invite-link {
  word-break: break-all;
  letter-spacing: 0;
  font-size: 0.85rem;
  font-weight: 500;
}
.invite-link-line {
  word-break: break-all;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(11, 27, 19, 0.9);
}
.segmented-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.segmented-btn:hover { color: var(--text); }
.segmented-btn.is-active {
  background: rgba(42, 168, 79, 0.14);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(42, 168, 79, 0.28);
}
.segmented-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.wallet-panel {
  display: grid;
  gap: 0.85rem;
}
.wallet-panel.is-hidden,
.wallet-panel[hidden] {
  display: none !important;
}
.wallet-panel.is-switching {
  animation: panelIn 180ms ease both;
}

.asset-list,
.invite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.asset-item,
.invite-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(29, 73, 48, 0.45);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.asset-item:last-child,
.invite-item:last-child { border-bottom: 0; padding-bottom: 0; }
.asset-identity,
.invite-identity {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  /* auto (pas 12rem) : en colonne un basis 12rem devenait une hauteur ~192px */
  flex: 1 1 auto;
  max-width: 100%;
}
.asset-identity strong,
.invite-identity strong {
  display: block;
  overflow-wrap: anywhere;
}
.invite-item > .pill {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  align-self: center;
}
.signal-schedule-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
  max-width: 58%;
  min-width: 0;
  text-align: right;
}
.signal-schedule-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--accent-2, var(--accent));
  white-space: nowrap;
}
.signal-schedule-ready,
.signal-schedule-waiting,
.signal-schedule-expired,
.signal-schedule-used {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}
.signal-schedule-expired,
.signal-schedule-used {
  color: var(--muted);
  opacity: 0.92;
}
.signal-schedule-code {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  background: transparent;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.signal-schedule-copy {
  min-height: 34px;
  min-width: 34px;
  padding: 0.35rem 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .invite-item[data-schedule-key] {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .invite-item[data-schedule-key] .signal-schedule-status {
    max-width: 100%;
    width: 100%;
    justify-content: flex-start;
    padding-left: calc(36px + 0.7rem);
  }
}

.asset-identity .muted,
.invite-identity .muted {
  display: block;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.asset-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(42, 168, 79, 0.25);
  background: #0b1b13;
  flex: 0 0 auto;
}
.asset-logo-fallback {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-2);
}
.asset-amounts {
  text-align: right;
}
.asset-amounts strong {
  display: block;
  font-variant-numeric: tabular-nums;
}
.asset-amounts .muted {
  display: block;
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.wallet-actions,
.finance-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
}
.wallet-action,
.finance-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  min-height: 0;
  min-width: 0;
  padding: 0.2rem 0.15rem;
  border-radius: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: center;
  transition: transform var(--transition), opacity var(--transition);
}
.wallet-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: border-color var(--transition), background var(--transition), color var(--transition), filter var(--transition), transform var(--transition), box-shadow var(--transition);
}
/* Hiérarchie discrète : Recharge > Retrait > Transfert (même format, accents progressifs). */
.wallet-action--primary .wallet-action-icon,
.finance-action.wallet-action--primary .wallet-action-icon {
  border: 1px solid rgba(42, 168, 79, 0.45);
  background: rgba(42, 168, 79, 0.14);
  color: var(--accent);
  box-shadow: none;
}
.wallet-action--secondary .wallet-action-icon,
.finance-action.wallet-action--secondary .wallet-action-icon {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: none;
}
.wallet-action--tertiary .wallet-action-icon,
.finance-action.wallet-action--tertiary .wallet-action-icon,
.wallet-action:not(.wallet-action--primary):not(.wallet-action--secondary) .wallet-action-icon {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.wallet-action--primary .wallet-action-label { color: var(--text); font-weight: 700; }
.wallet-action--secondary .wallet-action-label { color: var(--text); font-weight: 600; }
.wallet-action--tertiary .wallet-action-label { color: var(--muted); font-weight: 550; }
.wallet-action-icon svg,
.wallet-action svg,
.finance-action svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  stroke-width: 2.25;
}
.wallet-action-label,
.wallet-action > span:not(.wallet-action-icon),
.finance-action > span:not(.wallet-action-icon) {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}
.wallet-action:hover,
.finance-action:hover {
  color: var(--text);
  transform: translateY(-1px);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.wallet-action--primary:hover .wallet-action-icon,
.finance-action.wallet-action--primary:hover .wallet-action-icon {
  border-color: rgba(42, 168, 79, 0.6);
  background: rgba(42, 168, 79, 0.22);
  color: var(--accent-2);
  filter: none;
  box-shadow: none;
}
.wallet-action--secondary:hover .wallet-action-icon,
.finance-action.wallet-action--secondary:hover .wallet-action-icon {
  border-color: #3a4a42;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  filter: none;
  box-shadow: none;
}
.wallet-action--tertiary:hover .wallet-action-icon,
.finance-action.wallet-action--tertiary:hover .wallet-action-icon {
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text);
  filter: none;
  box-shadow: none;
}
.wallet-action--tertiary:hover .wallet-action-label { color: var(--text); }
.wallet-action:hover .wallet-action-label,
.finance-action:hover .wallet-action-label {
  color: var(--text);
}
.wallet-action:active .wallet-action-icon,
.finance-action:active .wallet-action-icon {
  transform: scale(0.96);
}

@media (min-width: 768px) {
  .balance-hero + .wallet-actions,
  .wallet-actions {
    width: min(100%, var(--wallet-actions-max));
    max-width: var(--wallet-actions-max);
    /* Aligné à gauche comme les autres contenus du dashboard (pas centré). */
    margin-inline: 0;
    margin-right: auto;
    gap: 0.55rem;
  }
  .wallet-action,
  .finance-action {
    padding: 0.25rem 0.2rem;
  }
  .wallet-action-icon {
    width: 52px;
    height: 52px;
  }
  .wallet-action-icon svg,
  .wallet-action svg,
  .finance-action svg {
    width: 1.32rem;
    height: 1.32rem;
  }
}
.wallet-action:focus-visible,
.finance-action:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 14px;
}

@media (max-width: 420px) {
  .wallet-actions,
  .finance-actions { gap: 0.25rem; }
  .wallet-action,
  .finance-action {
    padding: 0.15rem 0.1rem;
  }
  .wallet-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }
  .wallet-action-icon svg,
  .wallet-action svg,
  .finance-action svg {
    width: 1.18rem;
    height: 1.18rem;
  }
  .wallet-action-label,
  .wallet-action > span:not(.wallet-action-icon),
  .finance-action > span:not(.wallet-action-icon) {
    font-size: 0.72rem;
  }
}

.choice-grid {
  display: grid;
  gap: 0.65rem;
}
.choice-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0b1b13;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}
.choice-card strong,
.choice-card .muted { display: block; }
.choice-card img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.choice-card.is-active,
.choice-card:hover {
  border-color: rgba(42, 168, 79, 0.45);
  background: rgba(42, 168, 79, 0.08);
  color: var(--text);
}
.qr-wrap {
  display: grid;
  place-items: center;
  padding: 0.5rem 0;
}
.qr-wrap img {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

/* —— Recharge (fintech) —— */
.recharge-hero {
  margin-bottom: 1.25rem;
}
.recharge-hero .hero-text {
  max-width: 36rem;
}
.recharge-panel,
.recharge-address-panel,
.recharge-declare {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    var(--card);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.recharge-panel-head {
  margin-bottom: 1rem;
}
.recharge-panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.recharge-panel-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.recharge-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}
.recharge-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 0.65rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7, 20, 13, 0.45);
  color: var(--text);
  text-align: center;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.recharge-method:hover {
  border-color: rgba(42, 168, 79, 0.4);
  background: rgba(42, 168, 79, 0.07);
  color: var(--text);
  transform: translateY(-1px);
}
.recharge-method.is-active {
  border-color: rgba(42, 168, 79, 0.65);
  background: rgba(42, 168, 79, 0.12);
  box-shadow: 0 0 0 1px rgba(42, 168, 79, 0.2), 0 10px 24px rgba(0, 0, 0, 0.18);
  color: var(--text);
}
.recharge-method-icon {
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.14), transparent 50%),
    linear-gradient(160deg, #163526, #0c1f15);
  margin-bottom: 0.15rem;
}
.recharge-method[data-network="TRC20"] .recharge-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(160deg, #1a3d2a, #0e2418);
}
.recharge-method[data-network="BEP20"] .recharge-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(240, 185, 11, 0.22), transparent 52%),
    linear-gradient(160deg, #2a2614, #14110a);
}
.recharge-method[data-network="TRON"] .recharge-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 60, 60, 0.18), transparent 52%),
    linear-gradient(160deg, #2a1418, #140c10);
}
.recharge-method-icon img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
}
.recharge-method-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--accent-2);
}
.recharge-method-asset {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.recharge-method-network {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.recharge-method.is-active .recharge-method-network {
  color: var(--accent-2);
}
.recharge-address-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.recharge-address-asset {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.recharge-address-asset img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.recharge-address-asset strong {
  display: block;
  font-size: 1.05rem;
}
.recharge-network-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(42, 168, 79, 0.12);
  border: 1px solid rgba(42, 168, 79, 0.28);
}
.recharge-network-warn {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(240, 185, 11, 0.28);
  background: rgba(240, 185, 11, 0.08);
  color: #f0d78c;
  font-size: 0.84rem;
  line-height: 1.45;
}
.recharge-address-block {
  display: grid;
  gap: 0.45rem;
}
.recharge-address-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.recharge-address-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 20, 13, 0.55);
}
.recharge-address-value {
  flex: 1 1 12rem;
  min-width: 0;
  word-break: break-all;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--accent-2);
}
.recharge-qr {
  margin-top: 1rem;
}
.recharge-form {
  margin-top: 0.25rem;
}
.recharge-amount-control {
  position: relative;
}
.recharge-amount-suffix {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  pointer-events: none;
}
.recharge-amount-control .field-input {
  padding-right: 3.6rem;
}
.recharge-submit {
  width: 100%;
  justify-content: center;
}
.recharge-history {
  margin-top: 0.5rem;
}
@media (max-width: 720px) {
  /* Toujours 3 cartes sur la même ligne (mobile inclus). */
  .recharge-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .recharge-method {
    padding: 0.75rem 0.3rem 0.65rem;
    min-width: 0;
  }
  .recharge-method-icon {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 12px;
  }
  .recharge-method-icon img {
    width: 26px;
    height: 26px;
  }
  .recharge-method-asset {
    font-size: 0.8rem;
  }
  .recharge-method-network {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }
}
html[data-theme="light"] .recharge-panel,
html[data-theme="light"] .recharge-address-panel,
html[data-theme="light"] .recharge-declare {
  background:
    var(--card);
}
html[data-theme="light"] .recharge-method {
  background: #f4fbf6;
}
html[data-theme="light"] .recharge-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(160deg, #e8f7ee, #d6efe0);
  border-color: rgba(29, 73, 48, 0.12);
}
html[data-theme="light"] .recharge-address-row {
  background: #f4fbf6;
}
html[data-theme="light"] .recharge-network-warn {
  color: #7a5a00;
  background: rgba(240, 185, 11, 0.12);
}

/* —— Withdraw (fintech) —— */
.withdraw-hero {
  margin-bottom: 1.25rem;
}
.withdraw-hero .hero-text {
  max-width: 36rem;
}
.withdraw-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.withdraw-stat {
  padding: 0.9rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    var(--card);
  box-shadow: var(--shadow);
}
.withdraw-stat span {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.withdraw-stat strong {
  font-size: 1.05rem;
  font-weight: 700;
}
.withdraw-stat small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.withdraw-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    var(--card);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.withdraw-panel-head {
  margin-bottom: 1rem;
}
.withdraw-panel-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.withdraw-panel-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.withdraw-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.withdraw-method {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.95rem 0.55rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7, 20, 13, 0.45);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.withdraw-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.withdraw-method:hover {
  border-color: rgba(42, 168, 79, 0.4);
  background: rgba(42, 168, 79, 0.07);
  transform: translateY(-1px);
}
.withdraw-method.is-active {
  border-color: rgba(42, 168, 79, 0.65);
  background: rgba(42, 168, 79, 0.12);
  box-shadow: 0 0 0 1px rgba(42, 168, 79, 0.2), 0 10px 24px rgba(0, 0, 0, 0.18);
}
.withdraw-method.is-locked {
  cursor: default;
  transform: none;
}
.withdraw-method-icon {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.14), transparent 50%),
    linear-gradient(160deg, #163526, #0c1f15);
  margin-bottom: 0.15rem;
}
.withdraw-method[data-network="TRC20"] .withdraw-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(160deg, #1a3d2a, #0e2418);
}
.withdraw-method[data-network="BEP20"] .withdraw-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(240, 185, 11, 0.22), transparent 52%),
    linear-gradient(160deg, #2a2614, #14110a);
}
.withdraw-method-icon img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.withdraw-method-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-2);
}
.withdraw-method-asset {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.withdraw-method-network {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.withdraw-method.is-active .withdraw-method-network {
  color: var(--accent-2);
}
.withdraw-method-hint {
  font-size: 0.68rem;
}
.withdraw-network-warn {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(240, 185, 11, 0.28);
  background: rgba(240, 185, 11, 0.08);
  color: #f0d78c;
  font-size: 0.84rem;
  line-height: 1.45;
}
.withdraw-amount-control {
  position: relative;
}
.withdraw-amount-suffix {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  pointer-events: none;
}
.withdraw-amount-control .field-input {
  padding-right: 3.6rem;
}
.withdraw-summary {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(7, 20, 13, 0.45);
  margin-bottom: 0.25rem;
}
.withdraw-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.withdraw-summary-row span {
  color: var(--muted);
}
.withdraw-summary-row.is-net {
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
}
.withdraw-summary-row.is-net strong {
  color: var(--accent-2);
  font-size: 1.05rem;
}
.withdraw-submit {
  width: 100%;
  justify-content: center;
}
.withdraw-history {
  margin-top: 0.5rem;
}
@media (max-width: 520px) {
  .withdraw-stats {
    gap: 0.45rem;
  }
  .withdraw-stat {
    padding: 0.75rem 0.55rem;
  }
  .withdraw-stat strong {
    font-size: 0.92rem;
  }
  .withdraw-methods {
    gap: 0.45rem;
  }
  .withdraw-method {
    padding: 0.8rem 0.35rem 0.7rem;
  }
  .withdraw-method-icon {
    width: 2.7rem;
    height: 2.7rem;
  }
  .withdraw-method-icon img {
    width: 26px;
    height: 26px;
  }
}
html[data-theme="light"] .withdraw-stat,
html[data-theme="light"] .withdraw-panel {
  background:
    linear-gradient(165deg, rgba(42, 168, 79, 0.05), transparent 50%),
    var(--card);
}
html[data-theme="light"] .withdraw-method {
  background: #f4fbf6;
}
html[data-theme="light"] .withdraw-method-icon {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), transparent 55%),
    linear-gradient(160deg, #e8f7ee, #d6efe0);
  border-color: rgba(29, 73, 48, 0.12);
}
html[data-theme="light"] .withdraw-summary {
  background: #f4fbf6;
}
html[data-theme="light"] .withdraw-network-warn {
  color: #7a5a00;
  background: rgba(240, 185, 11, 0.12);
}

.invite-teaser {
  display: grid;
  gap: 1rem;
}
.invite-teaser-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.invite-teaser .eyebrow { margin-bottom: 0.35rem; }
.stat-value {
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 0.3rem;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.5rem;
}
.pill-accent {
  border-color: rgba(42, 168, 79, 0.35);
  color: var(--accent-2);
  background: rgba(42, 168, 79, 0.1);
}
.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 27, 19, 0.95);
  border: 1px solid rgba(29, 73, 48, 0.7);
  overflow: hidden;
  margin: 0.55rem 0;
}
.progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 160ms ease;
}

.trade-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.trade-summary span {
  display: block;
  margin-bottom: 0.25rem;
}

.side-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 10, 7, 0.55);
  display: grid;
  place-items: end center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}
.side-panel[hidden] { display: none !important; }
.side-panel-card {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
  overflow: auto;
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
  animation: panelIn 180ms ease both;
}
.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.side-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
  padding: 0.45rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 20, 16, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  /* Ancrée au viewport — ne défile pas avec le contenu */
  transform: translateZ(0);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 52px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), transform var(--transition);
}
.bottom-nav-item svg { width: 1.15rem; height: 1.15rem; }
.bottom-nav-item:hover { color: var(--text); }
.bottom-nav-item.is-active {
  color: var(--accent);
  background: rgba(42, 168, 79, 0.12);
  transform: none;
}
html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top-color: #e1e6e2;
}
html[data-theme="light"] .bottom-nav-item,
html[data-theme="light"] .bottom-nav-item:visited {
  color: #6a746e;
}
html[data-theme="light"] .bottom-nav-item:hover {
  color: var(--text);
  background: transparent;
}
html[data-theme="light"] .bottom-nav-item.is-active,
html[data-theme="light"] .bottom-nav-item.is-active:visited,
html[data-theme="light"] .bottom-nav-item.is-active:hover {
  color: var(--accent);
  background: rgba(31, 157, 69, 0.1);
}
.bottom-nav-item[href*="trade.php"].is-active,
.bottom-nav-item[href$="trade.php"] {
  /* Trade reste identifiable */
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(16,42,27,.8), rgba(29,73,48,.35), rgba(16,42,27,.8));
  background-size: 200% 100%;
  animation: shimmer 0.9s linear infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (min-width: 900px) {
  .app-shell { padding-bottom: 1.5rem; }
  .app-nav-desktop { display: flex; }
  .bottom-nav { display: none; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .side-panel { place-items: start end; padding: 5rem 1.25rem 1.25rem; }
}

@media (max-width: 640px) {
  :root { --app-header-height: 58px; }
  .app-header-inner { min-height: 58px; }
  .brand-logo { height: 34px; }
  .trade-summary,
  .balance-hero-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .page-enter,
  .side-panel-card {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
  .btn:hover,
  .wallet-card:hover,
  .quick-action:hover,
  .wallet-action:hover,
  .finance-action:hover,
  .bottom-nav-item.is-active { transform: none; }
}

/* Thème — icônes soleil / lune */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
html[data-theme="light"] .theme-icon-sun { display: block; }
html[data-theme="light"] .theme-icon-moon { display: none; }

.notif-item.is-unread strong { color: var(--accent-2); }
/* Notifications = pile verticale (titre puis message), jamais titre | texte côte à côte. */
.notif-list > .notif-item,
.notif-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-start;
}
.notif-item > strong,
.notif-item .notif-body,
.notif-item .notif-body > strong,
.notif-item .notif-body > p,
.notif-item .notif-body > time,
.notif-item > p,
.notif-item > time {
  display: block;
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
}
.notif-item.is-unread {
  position: relative;
  padding-left: 0.65rem;
}
.notif-item.is-unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}
.notif-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}
.notif-body p {
  margin: 0;
  overflow-wrap: anywhere;
}
.notif-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.35rem;
}
.notif-link {
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.notif-link:hover,
.notif-link:focus-visible {
  text-decoration: underline;
  outline: none;
}
.notif-panel-footer {
  margin-top: 0.85rem;
}
.js-notif-panel-body .empty-state {
  padding: 0.5rem 0;
}
.notif-panel-status {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.35rem 0;
}
.change-up { color: var(--ok); }
.change-down { color: var(--danger); }

/* Mode clair — surfaces blanches, accent discret */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f7;
  --bg-soft: #eef1ef;
  --card: #ffffff;
  --text: #121816;
  --muted: #66706a;
  --border: #e1e6e2;
  --accent: #1f9d45;
  --accent-2: #187a38;
  --danger: #d63d45;
  --ok: #187a38;
  --shadow: 0 2px 10px rgba(18, 24, 22, 0.05);
  --focus-ring: 0 0 0 3px rgba(31, 157, 69, 0.18);
}

html[data-theme="light"] body {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="light"] a { color: var(--accent); }
html[data-theme="light"] a:hover { color: var(--accent-2); }
/* Liens structurels : texte neutre (le vert reste pour accents / actif). */
html[data-theme="light"] .home-shortcut,
html[data-theme="light"] .home-shortcut:hover,
html[data-theme="light"] .home-invite,
html[data-theme="light"] .home-invite:hover,
html[data-theme="light"] .balance-hero-split,
html[data-theme="light"] .balance-hero-split:hover,
html[data-theme="light"] .wallet-card--link,
html[data-theme="light"] .wallet-card--link:hover,
html[data-theme="light"] .market-link,
html[data-theme="light"] .market-link:hover,
html[data-theme="light"] .market-link:visited {
  color: var(--text);
}
html[data-theme="light"] .home-shortcut-copy strong,
html[data-theme="light"] .home-invite-copy strong,
html[data-theme="light"] .balance-hero-grid strong,
html[data-theme="light"] .market-body strong,
html[data-theme="light"] .market-meta strong {
  color: var(--text);
}
html[data-theme="light"] .market-link:hover .market-body strong {
  color: var(--text);
}
html[data-theme="light"] .market-logos img {
  border-color: #e2e8e4;
  background: #ffffff;
}
html[data-theme="light"] .section-link {
  color: var(--accent);
}

html[data-theme="light"] .card,
html[data-theme="light"] .balance-hero,
html[data-theme="light"] .side-panel-card,
html[data-theme="light"] .quick-action,
html[data-theme="light"] .choice-card,
html[data-theme="light"] .referral-box,
html[data-theme="light"] .stat-card {
  background: var(--card);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .balance-hero {
  background: #ffffff;
}

html[data-theme="light"] .app-header,
html[data-theme="light"] .bottom-nav {
  background: rgba(247, 248, 247, 0.96);
  border-color: var(--border);
  backdrop-filter: blur(10px);
}

html[data-theme="light"] .field-input,
html[data-theme="light"] .field-control {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .field-input::placeholder { color: #7a8f82; }
html[data-theme="light"] .field-message-error { color: #a1262e; }
html[data-theme="light"] .field-message-success { color: #146b2f; }

html[data-theme="light"] .btn {
  color: #ffffff;
  background: var(--accent);
  box-shadow: none;
}
html[data-theme="light"] .btn-loader {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
html[data-theme="light"] .btn-secondary {
  color: var(--text);
  background: #ffffff;
  border-color: var(--border);
}

html[data-theme="light"] .alert-error {
  background: rgba(214, 61, 69, 0.08);
  border-color: rgba(214, 61, 69, 0.28);
  color: #8f1f27;
}
html[data-theme="light"] .alert-ok {
  background: rgba(23, 134, 58, 0.08);
  border-color: rgba(23, 134, 58, 0.28);
  color: #146b2f;
}
html[data-theme="light"] #market-status.alert-ok {
  background: #f3f5f3;
  border-color: #dde3df;
  color: #3d4a43;
}
html[data-theme="light"] #market-status.alert-ok i {
  color: var(--accent);
}

html[data-theme="light"] .icon-btn,
html[data-theme="light"] .pill,
html[data-theme="light"] .activity-icon,
html[data-theme="light"] .empty-icon,
html[data-theme="light"] .balance-hero-icon {
  background: #f3f5f3;
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="light"] .wallet-action,
html[data-theme="light"] .finance-action {
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--primary .wallet-action-icon {
  background: rgba(31, 157, 69, 0.12);
  border-color: rgba(31, 157, 69, 0.35);
  color: var(--accent);
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--secondary .wallet-action-icon {
  background: #f3f5f3;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--tertiary .wallet-action-icon,
html[data-theme="light"] .wallet-action:not(.wallet-action--primary):not(.wallet-action--secondary) .wallet-action-icon {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

html[data-theme="light"] .wallet-action-label,
html[data-theme="light"] .wallet-action > span:not(.wallet-action-icon),
html[data-theme="light"] .finance-action > span:not(.wallet-action-icon) {
  color: var(--text);
  font-weight: 600;
}

html[data-theme="light"] .wallet-action:hover,
html[data-theme="light"] .finance-action:hover {
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--primary:hover .wallet-action-icon {
  background: rgba(31, 157, 69, 0.18);
  border-color: rgba(31, 157, 69, 0.45);
  color: var(--accent-2);
  filter: none;
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--secondary:hover .wallet-action-icon {
  background: #eef1ef;
  border-color: #d5dbd6;
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] .wallet-action--tertiary:hover .wallet-action-icon {
  background: #f3f5f3;
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="light"] .wallet-card {
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .wallet-card:hover {
  border-color: #d0d6d1;
  box-shadow: var(--shadow);
  transform: none;
}
html[data-theme="light"] .balance-hero {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .side-panel {
  background: rgba(13, 33, 23, 0.28);
}

html[data-theme="light"] code,
html[data-theme="light"] .invite-link {
  color: var(--accent-2);
}

/* ——— Landing publique ——— */
body.page-landing .wrap {
  width: min(1120px, calc(100% - 1.25rem));
  padding-bottom: 3rem;
}

.landing-hero {
  --landing-hero-image: none;
  position: relative;
  min-height: min(72vh, 640px);
  margin: 0 0 2.25rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(110deg, rgba(7, 20, 13, 0.92) 18%, rgba(7, 20, 13, 0.72) 52%, rgba(7, 20, 13, 0.45) 100%),
    var(--landing-hero-image) center / cover no-repeat,
    var(--bg-soft);
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(7, 20, 13, 0.55));
  pointer-events: none;
  z-index: 0;
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.9rem;
  align-content: end;
  min-height: inherit;
  padding: clamp(1.4rem, 4vw, 2.6rem);
  max-width: 36rem;
}

.landing-brand {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--accent-2);
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.landing-lead,
.landing-section-lead,
.landing-split-copy p,
.landing-final p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
  max-width: 36rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.landing-section,
.landing-final {
  margin-bottom: 2rem;
}

.landing-section h2,
.landing-split-copy h2,
.landing-final h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  letter-spacing: -0.015em;
}

.landing-points {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.landing-points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.15rem 0;
}

.landing-points i {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  color: var(--accent);
}

.landing-points strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.landing-points span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.landing-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  margin: 2.4rem 0;
}

.landing-split-media {
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  aspect-ratio: 3 / 2;
}

.landing-split-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.005);
  transition: transform 220ms ease;
}

.landing-split.is-visible .landing-split-media img {
  transform: scale(1);
}

.landing-split-copy {
  display: grid;
  gap: 0.85rem;
  align-content: center;
}

.landing-final {
  padding: 1.5rem 0 0.25rem;
  border-top: 1px solid var(--border);
}

html[data-theme="light"] .landing-hero {
  background:
    linear-gradient(110deg, rgba(243, 250, 245, 0.94) 16%, rgba(243, 250, 245, 0.78) 48%, rgba(243, 250, 245, 0.42) 100%),
    var(--landing-hero-image) center / cover no-repeat,
    #e8f5ec;
  border-color: rgba(29, 73, 48, 0.22);
}

html[data-theme="light"] .landing-hero::after {
  background: linear-gradient(180deg, transparent, rgba(243, 250, 245, 0.55));
}

html[data-theme="light"] .landing-brand {
  color: #146b2f;
}

html[data-theme="light"] .landing-split-media,
html[data-theme="light"] .landing-final {
  border-color: rgba(29, 73, 48, 0.18);
}

@media (max-width: 820px) {
  .landing-hero {
    min-height: min(68vh, 560px);
  }

  .landing-split {
    grid-template-columns: 1fr;
  }

  .landing-split-media {
    order: -1;
  }
}

@media (max-width: 520px) {
  .landing-hero-inner {
    max-width: none;
  }

  .landing-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-split-media img {
    transition: none;
  }
}

/* Pages d'erreur */
body.page-error .card h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

body.page-error code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--accent-2);
}

/* PWA — aide installation (compte) */
.pwa-ios-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.55;
}

.pwa-ios-steps strong {
  color: var(--text);
  font-weight: 600;
}

body.is-pwa-standalone .bottom-nav {
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

/* Support client */
.support-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.support-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.support-card.is-available:hover {
  transform: translateY(-1px);
  border-color: #2f6a48;
  color: var(--text);
}
.support-card.is-unavailable {
  opacity: 0.78;
  cursor: not-allowed;
}
.support-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.support-logo,
.support-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
}
.support-logo.is-muted { filter: grayscale(0.35); opacity: 0.85; }
.support-logo-fallback {
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.12);
  color: var(--accent-2);
}
.support-logo-fallback svg { width: 1.1rem; height: 1.1rem; }
.support-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.support-card-text strong {
  font-size: 0.98rem;
  line-height: 1.25;
}
.support-card-action {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  flex-shrink: 0;
}
.support-card-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
html[data-theme="light"] .support-card {
  background: var(--card);
  box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .support-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .support-card.is-available:hover { transform: none; }
}

.support-community {
  margin-top: 1.5rem;
  gap: 0.85rem;
}
.support-community-head h2 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  font-weight: 700;
}
.support-community-lead {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.support-community-card {
  gap: 0.7rem;
}
.support-community-cta {
  width: 100%;
  justify-content: center;
  min-height: 42px;
}

/* Mode maintenance */
.page-maintenance {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--bg);
}
.maintenance-shell {
  width: 100%;
  max-width: 420px;
}
.maintenance-modal {
  padding: 1.35rem 1.2rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.maintenance-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.12);
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}
.maintenance-icon svg { width: 1.35rem; height: 1.35rem; }
.maintenance-logo { height: 34px; width: auto; margin: 0.15rem 0 0.35rem; }
.maintenance-modal h1 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  line-height: 1.25;
}
.maintenance-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.maintenance-message {
  margin: 0.35rem 0 0.55rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}
.maintenance-progress-block,
.maintenance-preview { width: 100%; }
.maintenance-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
  color: var(--muted);
}
.maintenance-progress-label strong { color: var(--accent-2); }
.maintenance-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(42, 168, 79, 0.12);
  border: 1px solid var(--border);
  overflow: hidden;
}
.maintenance-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f9d45, #35c95b);
  transition: width var(--transition);
}
.maintenance-thanks { margin: 0.75rem 0 0; font-size: 0.86rem; }
.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.85rem;
  width: 100%;
}
.maintenance-preview {
  padding: 1rem;
  text-align: center;
}
.app-maintenance-banner,
.admin-maintenance-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  background: rgba(212, 160, 23, 0.16);
  border-bottom: 1px solid rgba(212, 160, 23, 0.35);
  color: #f0d27a;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
}
.app-maintenance-banner svg,
.admin-maintenance-banner svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
html[data-theme="light"] .app-maintenance-banner,
html[data-theme="light"] .admin-maintenance-banner {
  background: rgba(180, 120, 10, 0.12);
  border-bottom-color: rgba(180, 120, 10, 0.28);
  color: #8a5a00;
}
html[data-theme="light"] .maintenance-progress {
  background: rgba(31, 157, 69, 0.1);
}
@media (max-width: 640px) {
  .maintenance-shell { max-width: 100%; }
  .app-maintenance-banner,
  .admin-maintenance-banner {
    font-size: 0.8rem;
    padding: 0.5rem 0.65rem;
  }
}

/* Modal invitation Telegram (post-login) */
.tg-invite-overlay {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 10, 7, 0.72);
  backdrop-filter: blur(4px);
  animation: tgInviteIn 220ms ease both;
}
.tg-invite-overlay[hidden] { display: none !important; }
@keyframes tgInviteIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.tg-invite-modal {
  position: relative;
  width: min(100%, 400px);
  max-height: min(90vh, 560px);
  overflow: auto;
  padding: 1.35rem 1.2rem 1.15rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  animation: tgInviteCardIn 260ms ease both;
}
@keyframes tgInviteCardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tg-invite-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.tg-invite-close:hover {
  color: var(--text);
  background: rgba(42, 168, 79, 0.1);
}
.tg-invite-close:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.tg-invite-close svg { width: 1.1rem; height: 1.1rem; }
.tg-invite-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.1);
  border: 1px solid rgba(42, 168, 79, 0.22);
  margin-top: 0.15rem;
}
.tg-invite-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.tg-invite-icon-fallback { color: var(--accent-2); }
.tg-invite-icon-fallback svg { width: 1.4rem; height: 1.4rem; }
.tg-invite-modal h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
}
.tg-invite-lead {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.tg-invite-text {
  margin: 0.55rem 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  font-weight: 400;
}
.tg-invite-hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.tg-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 1rem;
  width: 100%;
}
.tg-invite-actions .btn {
  min-width: 7.25rem;
  flex: 1 1 calc(50% - 0.3rem);
}
html[data-theme="light"] .tg-invite-overlay {
  background: rgba(20, 28, 24, 0.45);
}
html[data-theme="light"] .tg-invite-modal {
  box-shadow: 0 16px 40px rgba(20, 40, 28, 0.18);
}
@media (max-width: 640px) {
  .tg-invite-overlay {
    padding: 0.75rem;
    align-items: end;
  }
  .tg-invite-modal {
    width: 100%;
    border-radius: 18px 18px 12px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tg-invite-overlay,
  .tg-invite-modal {
    animation: none;
  }
}

/* Modal bonus première recharge */
.bonus-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 10, 7, 0.72);
  backdrop-filter: blur(4px);
}
.bonus-modal-overlay[hidden] { display: none !important; }
.bonus-modal {
  width: min(100%, 420px);
  max-height: min(92vh, 640px);
  overflow: auto;
  padding: 1.35rem 1.2rem 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.bonus-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(42, 168, 79, 0.12);
  color: var(--accent-2);
}
.bonus-modal-icon svg { width: 1.35rem; height: 1.35rem; }
.bonus-modal h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  line-height: 1.25;
}
.bonus-modal-amount {
  margin: 0.35rem 0 0;
  font-size: clamp(1.35rem, 4.5vw, 1.65rem);
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.bonus-modal-amount span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.bonus-modal-text {
  margin: 0.35rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}
.bonus-modal-hint { margin: 0.15rem 0 0; font-size: 0.86rem; }
.bonus-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 0.95rem;
  width: 100%;
}
.bonus-modal-actions form { margin: 0; }
.bonus-modal-actions .btn { min-width: 7.5rem; }
.bonus-modal-success { width: 100%; margin-top: 0.35rem; }
.bonus-modal-success-text {
  margin: 0;
  color: var(--accent-2);
  font-weight: 600;
  line-height: 1.4;
}
.bonus-modal.is-success .bonus-modal-hint,
.bonus-modal.is-success .bonus-modal-actions { display: none; }
html[data-theme="light"] .bonus-modal-overlay {
  background: rgba(20, 28, 24, 0.45);
}
html[data-theme="light"] .bonus-modal {
  box-shadow: 0 16px 40px rgba(20, 40, 28, 0.18);
}
@media (max-width: 640px) {
  .bonus-modal-overlay { padding: 0.75rem; align-items: end; }
  .bonus-modal {
    width: 100%;
    border-radius: 18px 18px 12px 12px;
  }
  .bonus-modal-actions .btn { flex: 1 1 calc(50% - 0.3rem); }
}

/* ——— Responsive mobile-first : anti-débordement global ——— */
@media (max-width: 640px) {
  .app-main {
    width: min(var(--layout-max), calc(100% - 1rem));
    padding-top: 0.9rem;
  }
  .app-header-inner {
    width: min(var(--layout-max), calc(100% - 1rem));
  }
  .card {
    padding: 1.05rem 0.9rem;
  }
  .card.balance-hero {
    padding: 1.05rem 1.1rem;
  }
  .card.wallet-card {
    padding: 0.85rem 0.9rem;
  }
  /* Garder le sens row pour activité / marché ; les notifs restent en colonne. */
  .invite-item,
  .asset-item,
  .activity-item,
  .market-item {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .notif-list > .notif-item,
  .notif-item {
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
  }
  .invite-item > .pill,
  .asset-item > .pill {
    align-self: center;
    margin-top: 0.15rem;
  }
  .activity-meta,
  .market-meta {
    margin-left: auto;
    text-align: right;
  }
  .signal-schedule-status {
    margin-left: auto;
  }
  .referral-box {
    flex-wrap: wrap;
  }
  .referral-box .btn {
    width: 100%;
    justify-content: center;
  }
  /* Ne plus forcer .grid-2 / .wallet-grid en 1 colonne : KPI & wallets restent en 2 cols */
  .info-row {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
  }
  .info-row strong {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* KYC badges profil */
.kyc-status-card {
  display: grid;
  gap: 0.75rem;
}
.kyc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  width: fit-content;
  max-width: 100%;
}
.kyc-badge svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.kyc-badge-none,
.kyc-badge-rejected {
  color: #fff5f5;
  background: rgba(255, 95, 101, 0.18);
  border: 1px solid rgba(255, 95, 101, 0.55);
}
.kyc-badge-pending {
  color: #fff8e8;
  background: rgba(255, 186, 73, 0.16);
  border: 1px solid rgba(255, 186, 73, 0.5);
}
.kyc-badge-approved {
  color: #ffffff;
  background: var(--accent);
  border: 1px solid transparent;
}
html[data-theme="light"] .kyc-badge-none,
html[data-theme="light"] .kyc-badge-rejected {
  color: #9b1c1c;
  background: rgba(255, 95, 101, 0.12);
}
html[data-theme="light"] .kyc-badge-pending {
  color: #92400e;
  background: rgba(255, 186, 73, 0.18);
}

/* Recharge multi-étapes */
.recharge-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.recharge-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.recharge-step-pill.is-active {
  color: #ffffff;
  background: var(--accent);
  border-color: transparent;
}
.recharge-step-pill.is-done {
  color: var(--accent-2);
  border-color: rgba(60, 184, 106, 0.35);
}
.recharge-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.recharge-nav-row .btn { flex: 1 1 8rem; justify-content: center; }

/* Historique centralisé + activité dashboard */
.activity-more {
  margin-top: 0.85rem;
  display: flex;
  justify-content: center;
}
.activity-more .btn { min-width: 10rem; }

.history-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem;
  margin-bottom: 0.35rem;
}
.history-tab {
  flex: 0 0 auto;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  white-space: nowrap;
}
.history-tab.is-active {
  color: #ffffff;
  background: var(--accent);
  border-color: transparent;
}
.history-filters {
  padding: 0.85rem 1rem;
  margin-bottom: 0.15rem;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.history-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.15rem;
  border-bottom: 1px solid rgba(29, 73, 48, 0.45);
}
.history-item:last-child { border-bottom: 0; }
.history-item.is-highlight {
  margin: 0 -0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(42, 168, 79, 0.45);
  background: rgba(42, 168, 79, 0.08);
}
.history-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
}
.history-item-sub {
  margin: 0 0 0.2rem;
  font-size: 0.86rem;
}
.history-item-amount {
  text-align: right;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.history-item-amount strong { display: block; font-weight: 600; }
.history-status { font-size: 0.72rem; }
.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.history-footnote {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}
html[data-theme="light"] .history-item {
  border-bottom-color: rgba(31, 157, 69, 0.18);
}
html[data-theme="light"] .history-item.is-highlight {
  background: rgba(31, 157, 69, 0.08);
  border-color: rgba(31, 157, 69, 0.35);
}
