/* Famora : interface mobile, tablette et ordinateur. Les couleurs passent par des variables.
   Fond beige partout ; le vert de marque (--brand) est le même sur l'accueil et sur la bande du mois du Budget. */
:root {
  /* Charte Famora, alignée sur Naatal : vert profond, or, crème */
  --bg: #f6f0e4;
  --card: #fffdf8;
  --field: #fbf7ec;
  --ink: #10282c;
  --muted: #5b6b6b;
  --line: #e6dcc7;
  --brand: #12404a;
  --brand-deep: #0b2e34;
  --on-brand: #fffdf8;
  --brand-soft: #dce9e4;
  --brand-ink: #12404a;
  --amber-bg: #f8ecd0;
  --amber-ink: #73480a;
  --red-bg: #f6dccf;
  --red-ink: #8f2f1f;
  --red: #c4503a;
  --track: #ece3cf;
  --dark-btn: #0b2e34;
  --on-dark-btn: #fffdf8;
  --gold: #d9a441;
  --gold-soft: rgba(217, 164, 65, 0.16);
  --nav-bg: #0b2e34;
  --nav-ink: #b9c9c6;
  --nav-active: #e0b055;
  --nav-hover: rgba(255, 255, 255, 0.07);
  --shadow: 0 10px 30px rgba(11, 46, 52, 0.16);
  --radius: 20px;
  color-scheme: only light;
}
:root[data-theme="dark"] {
  --bg: #08191d;
  --card: #0f2a30;
  --field: #0c2227;
  --ink: #eef3ee;
  --muted: #9db3b0;
  --line: #1f4147;
  --brand: #1b5a66;
  --brand-deep: #06171a;
  --on-brand: #fffdf8;
  --brand-soft: #14383f;
  --brand-ink: #9fd6cd;
  --amber-bg: #3a2f14;
  --amber-ink: #f0d28f;
  --red-bg: #3f211c;
  --red-ink: #f4aa9b;
  --red: #e0735d;
  --track: #17383e;
  --dark-btn: #e8c36f;
  --on-dark-btn: #08191d;
  --gold: #e0b055;
  --gold-soft: rgba(224, 176, 85, 0.16);
  --nav-bg: #06171a;
  --nav-ink: #9db3b0;
  --nav-active: #e0b055;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* Structure de page */
#app { min-height: 100dvh; }
.frame { display: flex; flex-direction: column; min-height: 100dvh; width: 100%; margin: 0; }
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; order: 1; }
.side-brand { display: none; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 14px max(20px, env(safe-area-inset-left, 0px));
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; margin-bottom: 0;
}
.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.top .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-ink); }
.top h1 { font-size: 26px; line-height: 1.15; font-weight: 800; }
.foyer-switch {
  background: none; border: none; padding: 0; margin: 0; max-width: 100%;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-ink);
}
.bell {
  position: relative; width: 46px; height: 46px; border-radius: 23px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--field); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #c4503a; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
main {
  flex: 1; padding-top: 16px; min-width: 0; display: flex; flex-direction: column; gap: 16px;
  padding: 8px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px));
}
.plain-page { justify-content: center; padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
/* Documents légaux et liens vers eux */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding: 8px 0; }
.legal-links a { color: var(--muted); }
.legal-page { justify-content: flex-start; }
.legal p { line-height: 1.6; }
.check.consent { align-items: flex-start; font-weight: 500; line-height: 1.45; }
.check.consent input { margin-top: 2px; flex-shrink: 0; }

/* Téléphone et tablette : barre fixée en bas, qui défile au doigt quand les huit modules ne tiennent pas en largeur.
   Chaque module garde une largeur lisible ; le module à moitié visible au bord signale qu'on peut faire glisser. */
.tabs {
  order: 2; position: sticky; bottom: 0; z-index: 5; display: flex; background: var(--nav-bg); border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 1 0 auto; min-width: 78px; min-height: 56px; padding: 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 700; color: var(--nav-ink); text-decoration: none; position: relative; scroll-snap-align: start; border-radius: 14px;
}
.tab-label { white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--nav-active); background: var(--gold-soft); }
.tabs .badge { top: 2px; right: calc(50% - 26px); }

/* Cartes et textes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.flush { padding: 4px 16px; gap: 0; }
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 130%); color: var(--on-brand); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.hero .label { font-size: 14px; font-weight: 600; opacity: 0.9; }
.hero .big { font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.hero .sub { font-size: 15px; font-weight: 600; opacity: 0.9; }
.hero .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; flex-wrap: wrap; }
.hero .progress { background: rgba(255, 255, 255, 0.28); }
.hero .progress > span { background: var(--gold); }
h2.section { font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 15px; color: var(--muted); line-height: 1.5; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }

.progress { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 5px; background: var(--brand); }
.progress.over > span { background: var(--red); }

/* Lignes de liste */
.line {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 56px;
}
.line:last-child { border-bottom: none; }
.line .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line .title { font-weight: 700; overflow-wrap: anywhere; }
.line .amount { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.line .amount strong { font-size: 17px; font-weight: 800; }

/* Pastilles de statut */
.status { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status.wait { background: var(--amber-bg); color: var(--amber-ink); }
.status.ok { background: var(--brand-soft); color: var(--brand-ink); }
.status.no { background: var(--red-bg); color: var(--red-ink); }
.status.info { background: var(--track); color: var(--muted); }

/* Alertes cliquables */
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%;
  min-height: 60px; padding: 14px 16px; border-radius: 18px; border: 1px solid transparent; text-decoration: none; font-weight: 700;
}
.alert.amber { background: var(--amber-bg); color: var(--amber-ink); }
.alert.green { background: var(--brand-soft); color: var(--brand-ink); }
.alert.info { background: var(--track); color: var(--ink); }
.alert .text { display: flex; flex-direction: column; gap: 2px; }
.alert .text small { font-size: 13px; font-weight: 500; }

/* Boutons */
.btn {
  min-height: 50px; padding: 8px 20px; border-radius: 16px; border: 1.5px solid transparent; font-weight: 700; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.dark { background: var(--dark-btn); color: var(--on-dark-btn); }
.btn.outline { background: var(--field); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--field); border-color: var(--red); color: var(--red-ink); }
.btn.block { width: 100%; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.link-btn { background: none; border: none; padding: 10px 0; min-height: 44px; color: var(--brand-ink); font-weight: 700; text-decoration: underline; text-align: left; }
.rate-note { display: block; margin-top: 2px; }
.rate-stale { color: var(--amber-ink); background: var(--amber-bg); border-radius: 10px; padding: 6px 10px; font-weight: 600; }
.link-btn.danger-link { color: var(--red-ink); align-self: flex-start; font-size: 14px; }
/* Carte aux couleurs de la bande du mois (total du budget) */
.card.brand-card { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.card.brand-card strong { color: var(--on-brand); }
.icon-btn {
  width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn[disabled] { opacity: 0.4; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > * { flex: 1 1 150px; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 15px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--field); color: var(--ink);
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { border-color: var(--brand); }
/* Champ prérempli par la lecture de la facture : à vérifier par l'utilisateur */
.input.from-reading { border-color: var(--gold); background: var(--gold-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-radius: 14px; font-weight: 700;
  background: var(--field); border: 1.5px solid var(--line);
}
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.check input { width: 24px; height: 24px; accent-color: var(--brand); }
.error { background: var(--red-bg); color: var(--red-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.notice { background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.caution { background: var(--amber-bg); color: var(--amber-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }

.subbar { position: sticky; top: var(--top-h, 72px); z-index: 15; background: var(--bg); padding: 10px 0; margin: -8px 0 -8px; }
.subbar.monthband { border-radius: 20px; padding: 10px 12px; margin: 0; box-shadow: 0 0 0 8px var(--bg); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filters.wrap { flex-wrap: wrap; overflow: visible; }
.filters button {
  min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--field); font-weight: 700; white-space: nowrap;
}
.filters button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
/* Sous-sections d'un événement (Contributions, Dépenses) : même allure que les filtres */
.filters .filter-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line);
  background: var(--field); font-weight: 700; white-space: nowrap; color: var(--ink); text-decoration: none;
}
.filters .filter-link[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* Événements */
.plain-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.card > .plain-link + .plain-link { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.event-total { gap: 8px; }
.event-card { max-height: 420px; }
.person-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.small-input { min-height: 44px; width: 120px; }
.contrib-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.contrib-actions .btn { min-height: 44px; flex: 0 0 auto; width: auto; }
.contrib-item { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.contrib-item:last-child { border-bottom: 0; }
.contrib-item .line { border-bottom: 0; padding-bottom: 6px; }
.contrib-item .notice.small { font-size: 13px; padding: 8px 10px; margin-bottom: 6px; }
@media (min-width: 600px) {
  .person-row { grid-template-columns: 1.4fr 1fr 1fr; border-bottom: 0; padding-bottom: 0; }
}

.photo { width: 100%; max-height: 360px; object-fit: contain; border-radius: 14px; background: var(--track); display: block; }
.photo-slot { display: flex; flex-direction: column; gap: 8px; }
.dropzone {
  min-height: 92px; border: 2px dashed var(--line); border-radius: 16px; background: var(--field); color: var(--brand-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; cursor: pointer; text-align: center; padding: 12px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty strong { color: var(--ink); font-size: 17px; }
.code { font-size: 28px; font-weight: 800; letter-spacing: 0.18em; text-align: center; padding: 14px; background: var(--brand-soft); color: var(--brand-ink); border-radius: 14px; user-select: all; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--brand); color: var(--gold); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
details.card summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.brand-mark { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 800; }
.brand-mark svg { width: 48px; height: 48px; }

#toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  width: min(480px, calc(100% - 32px)); z-index: 20; pointer-events: none;
}
#toast div { background: var(--dark-btn); color: var(--on-dark-btn); border-radius: 14px; padding: 14px 16px; font-weight: 600; box-shadow: var(--shadow); }
#toast div.bad { background: var(--red-ink); color: var(--red-bg); }
.offline { background: var(--amber-bg); color: var(--amber-ink); text-align: center; font-size: 14px; font-weight: 700; padding: 8px 12px; }


/* ---------- Ajouts Famora ---------- */
.top h1 { overflow-wrap: anywhere; }
.small-code { font-size: 13px; letter-spacing: 0; text-align: left; word-break: break-all; font-weight: 700; }
.chip-btn {
  min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 700; background: var(--field); border: 1.5px solid var(--line);
}
.chip-btn:hover { border-color: var(--brand); }
.range { width: 100%; height: 36px; accent-color: var(--brand); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.split { display: flex; flex-direction: column; gap: 16px; }
.split > * { min-width: 0; }

/* Bande verte du mois, commune à tous les modules : même variable que le bloc vert de l'accueil */
.monthband {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--brand); color: var(--on-brand); border-radius: 20px; padding: 10px 12px;
}
.monthband strong { font-size: 18px; text-align: center; }
.monthband .icon-btn { background: rgba(251, 246, 233, 0.16); border-color: transparent; color: var(--on-brand); }

/* Pages d'identification */
.auth-side { display: none; }
.plain-page.public { max-width: 520px; width: 100%; margin: 0 auto; }
.lang-pick { align-self: flex-end; }

/* ---------- Animation de lancement ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100; background: var(--brand-deep); display: flex; align-items: center; justify-content: center;
  transition: opacity 0.55s ease, visibility 0.55s;
}
#splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; color: var(--on-brand); }
.splash-logo { width: 116px; height: 116px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.25)); }
.splash-logo .s-bg { fill: #fffdf8; }
.splash-logo .s-house { fill: #12404a; }
.splash-word { font-size: 44px; font-weight: 800; letter-spacing: 0.04em; display: flex; color: var(--gold); }
.splash-word i { font-style: normal; display: inline-block; }
.splash-tag { font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .splash-logo { opacity: 0; transform: scale(0.55); animation: splash-pop 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.15) 0.1s forwards; }
  .splash-logo .s-roof { transform-box: fill-box; transform-origin: center; opacity: 0; animation: splash-roof 0.6s ease-out 0.55s forwards; }
  .splash-word i { opacity: 0; transform: translateY(14px); animation: splash-letter 0.5s ease-out forwards; }
  .splash-word i:nth-child(1) { animation-delay: 0.8s; } .splash-word i:nth-child(2) { animation-delay: 0.87s; }
  .splash-word i:nth-child(3) { animation-delay: 0.94s; } .splash-word i:nth-child(4) { animation-delay: 1.01s; }
  .splash-word i:nth-child(5) { animation-delay: 1.08s; } .splash-word i:nth-child(6) { animation-delay: 1.15s; }
  .splash-tag { opacity: 0; animation: splash-fade 0.6s ease-out 1.45s forwards; }
  @keyframes splash-pop { to { opacity: 1; transform: scale(1); } }
  @keyframes splash-roof { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes splash-letter { to { opacity: 1; transform: translateY(0); } }
  @keyframes splash-fade { to { opacity: 0.85; } }
}

/* ---------- Téléphone étroit ---------- */
@media (max-width: 380px) {
  .two { grid-template-columns: 1fr; }
  .hero .big { font-size: 32px; }
  .top h1 { font-size: 23px; }
  .btn { padding: 8px 14px; }
}

/* ---------- Tablette : 640 à 1023 px ---------- */
@media (min-width: 640px) {
  .top { padding-left: 32px; padding-right: 32px; padding-top: 18px; }
  main { padding: 12px 32px 36px; gap: 20px; }
  .top h1 { font-size: 30px; }
  .tabs { padding-left: 12px; padding-right: 12px; }
  .tabs a { font-size: 13px; }
  .hero { padding: 26px; }
  .hero .big { font-size: 46px; }
  .plain-page { max-width: 520px; width: 100%; margin: 0 auto; }
  #toast { bottom: 96px; }
}
@media (min-width: 768px) {
  .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .split.home-grid { grid-template-columns: 1.15fr 0.85fr; }
}

/* ---------- Ordinateur : 1024 px et plus (navigation latérale) ---------- */
@media (min-width: 1024px) {
  .frame { max-width: none; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .content { order: 2; width: 100%; }
  .tabs {
    order: 1; position: sticky; top: 0; align-self: start; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 6px;
    border-top: none; border-right: none; padding: 28px 16px;
  }
  .side-brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; padding: 0 12px 24px; color: var(--nav-active); }
  .side-brand svg { width: 44px; height: 44px; }
  .tabs { overflow-x: visible; overflow-y: auto; scroll-snap-type: none; }
  .tabs a { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 52px; padding: 0 16px; border-radius: 14px; font-size: 16px; min-width: 0; }
  .tabs a:hover { background: var(--nav-hover); }
  .tabs a[aria-current="page"] { background: var(--gold-soft); }
  .tabs .badge { top: 12px; right: 12px; }
  .top { padding: 18px 48px; }
  .top h1 { font-size: 34px; }
  main { padding: 16px 48px 56px; gap: 24px; }
  .split { gap: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
  .hero .big { font-size: 54px; }
  #toast { bottom: 28px; }

  .auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100dvh; }
  .auth-side {
    display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 64px;
    background: var(--brand-deep); color: var(--on-brand);
  }
  .auth-side .brand-mark { font-size: 48px; }
  .auth-side .brand-mark svg { width: 72px; height: 72px; }
  .auth-tag { font-size: 22px; line-height: 1.4; max-width: 420px; opacity: 0.92; }
  .auth .plain-page { max-width: 460px; margin: auto; padding: 48px 32px; }
  .auth .plain-page .brand-mark { display: none; }
}
@media (min-width: 1500px) {
  .frame { grid-template-columns: 288px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip span, .filters button, .chip-btn { transition: background-color 0.15s, border-color 0.15s; }
}




/* ---------- Menu du profil (en haut à droite) ---------- */
.profile { position: relative; }
.avatar-btn {
  width: 46px; height: 46px; border-radius: 23px; border: 2px solid transparent; background: var(--brand); color: var(--gold);
  font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0.02em;
}
.avatar-btn[aria-expanded="true"] { border-color: var(--gold); }
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px)); z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.pm-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; min-width: 0; }
.pm-head strong { overflow-wrap: anywhere; }
.pm-head span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.pm-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; border: none;
  background: none; color: var(--ink); font-weight: 600; text-align: left; text-decoration: none;
}
.pm-item:hover, .pm-item:focus-visible { background: var(--brand-soft); }
.pm-item.danger { color: var(--red-ink); }
.pm-item .pm-state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.switch { margin-left: auto; width: 40px; height: 24px; border-radius: 12px; background: var(--track); position: relative; flex-shrink: 0; border: 1px solid var(--line); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 9px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
:root[data-theme="dark"] .switch { background: var(--gold); }
:root[data-theme="dark"] .switch::after { transform: translateX(16px); }
.settings-grid { display: grid; gap: 16px; }

/* Contribution : choix du destinataire, preuve */
.paychoice { display: grid; gap: 10px; }
.paychoice label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; }
.paychoice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.paychoice input { margin-top: 4px; accent-color: var(--brand); }
.proof-thumb { display: block; max-width: 160px; max-height: 200px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; margin-top: 6px; }
.chip-line { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.chip-line input { accent-color: var(--brand); width: 18px; height: 18px; }
