/* ==========================================================================
   WAKAKASH — pages publiques (accueil, futures pages marketing)
   Reprend les styles de template/landing.html. Les tokens et composants
   viennent de wakakash.css (copie de template/assets/css/wakakash.css).
   ========================================================================== */

/* L'attribut hidden doit gagner sur les display des composants (.btn, .list…). */
[hidden] { display: none !important; }

/* En-tête (template/landing.html) */
.l-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.l-header.is-scrolled { border-bottom-color: var(--border); }
.l-header .container { display: flex; align-items: center; gap: 12px; height: 72px; }
.l-header .logo img { height: 32px; width: auto; }
.l-nav { display: none; gap: 4px; margin-left: 24px; }
.l-nav a { padding: 8px 12px; border-radius: 99px; font-weight: 600; font-size: .9375rem; color: var(--text-2); white-space: nowrap; }
.l-nav a:hover { color: var(--text); background: var(--surface-2); }
.l-menu { display: none; position: fixed; inset: 72px 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 16px 20px; z-index: 49; }
.l-menu.is-open { display: grid; gap: 4px; }
.l-menu a { padding: 14px 8px; font-weight: 700; border-bottom: 1px solid var(--border); }
@media (min-width: 960px) { .l-nav { display: flex; } }
@media (max-width: 1099px) { .l-header .only-desktop { display: none !important; } }
@media (min-width: 1100px) { .burger { display: none !important; } }

/* Sélecteur de langue */
.lang-switch { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); gap: 2px; }
.lang-switch a { min-width: 40px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .04em; color: var(--text-2); text-transform: uppercase; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
:root[data-theme="dark"] .lang-switch a[aria-current="true"] { background: var(--surface-3); }

/* Sections */
section.s { padding: 72px 0; }
@media (min-width: 1024px) { section.s { padding: 112px 0; } }
.s-head { max-width: 680px; margin-bottom: 40px; }
.s-head.center { margin-inline: auto; text-align: center; }
.s-head h2, .h-section { font-size: clamp(1.75rem, 3.6vw, 2.75rem); letter-spacing: -.03em; margin-top: 10px; }
.s-head p { margin-top: 14px; }

/* Hero */
.hero { padding: 40px 0 72px; position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero .display span { color: var(--brand); }
.hero-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.hero-trust span { display: inline-flex; gap: 6px; align-items: center; }
.hero-trust svg { width: 16px; height: 16px; color: var(--success); }
.swoosh { position: absolute; right: -10%; top: 8%; width: 70%; max-width: 900px; opacity: .9; pointer-events: none; z-index: 0; }
.hero .container { position: relative; z-index: 1; }
@media (max-width: 1023px) { .swoosh { display: none; } }
@media (min-width: 1024px) { .hero { padding: 56px 0 112px; } .hero-grid { grid-template-columns: 1.05fr .95fr; } }

/* Maquette téléphone */
.phone-wrap { position: relative; display: grid; place-items: center; padding: 20px 0; }
.phone { width: 300px; border-radius: 44px; padding: 10px; background: #0F1110; box-shadow: var(--sh-3), inset 0 0 0 2px #2A2D2B; position: relative; }
.phone .screen { border-radius: 36px; overflow: hidden; background: var(--bg); height: 600px; position: relative; }
.phone .notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #0F1110; z-index: 3; }
.ph-body { padding: 48px 14px 0; display: grid; gap: 10px; font-size: 12px; }
.ph-hero { background: var(--nav-bg); color: #F1F1ED; border-radius: 20px; padding: 16px; position: relative; overflow: hidden; }
.ph-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; border: 16px solid rgba(255,114,0,.18); }
.ph-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-width: 0; }
.ph-card .amount { white-space: nowrap; }
.ph-nav { position: absolute; bottom: 0; left: 0; right: 0; height: 64px; background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5,1fr); place-items: center; color: var(--text-3); }
.ph-nav svg { width: 18px; height: 18px; }
.ph-nav .add { width: 42px; height: 42px; border-radius: 14px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; margin-top: -18px; }
.float { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px 14px; box-shadow: var(--sh-3); display: flex; gap: 10px; align-items: center; font-size: 13px; z-index: 2; animation: bob 6s ease-in-out infinite; }
.float .cat { width: 34px; height: 34px; border-radius: 11px; font-size: 1rem; }
.float.f1 { left: max(0px, calc(50% - 270px)); top: 47%; }
.float.f2 { right: max(0px, calc(50% - 250px)); bottom: 18%; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }
@media (max-width: 520px) { .float.f1 { left: 0; top: 6%; } .float.f2 { right: 0; bottom: 4%; } .phone { width: 272px; } .phone .screen { height: 540px; } }

.cur-strip { border-block: 1px solid var(--border); padding: 18px 0; }
.cur-strip .container { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; justify-content: center; font-weight: 700; color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
.cur-strip b { color: var(--text); font-size: 1rem; letter-spacing: .04em; }

/* Problème */
.problem-q { display: block; font-size: clamp(1.75rem, 4.2vw, 3.25rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; max-width: 960px; overflow-wrap: break-word; }
.problem-q em { font-style: normal; color: var(--brand); }
.pains { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 768px) { .pains { grid-template-columns: repeat(3, 1fr); } }
.pain { padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.pain .n { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; overflow-wrap: break-word; }

/* Solution */
.path { display: grid; gap: 12px; position: relative; }
.path-step { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); }
.path-step .k { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; }
.path-step .k svg { width: 20px; height: 20px; }
.path-step:last-child { background: var(--nav-bg); color: #F1F1ED; border-color: transparent; }
.path-step:last-child .k { background: var(--brand); color: var(--on-brand); }
.path-step:last-child .muted { color: #A9ADA8; }
.path-step h3 { font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; }
@media (min-width: 1024px) {
  .path { grid-template-columns: repeat(5, 1fr); align-items: end; }
  .path-step { flex-direction: column; min-height: 200px; }
  .path-step:nth-child(2) { margin-bottom: 24px; } .path-step:nth-child(3) { margin-bottom: 48px; } .path-step:nth-child(4) { margin-bottom: 72px; } .path-step:nth-child(5) { margin-bottom: 96px; }
}

/* Fonctionnalités */
.feats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.feat { padding: 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, transform .2s var(--ease); }
.feat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feat .cat { margin-bottom: 18px; }
.feat h3 { margin-bottom: 6px; }
.feat p { color: var(--text-2); font-size: .9375rem; }

/* En un coup d'œil */
.glance { display: grid; gap: 40px; align-items: center; }
.glance > * { min-width: 0; }
@media (min-width: 1024px) { .glance { grid-template-columns: .8fr 1.2fr; } }
.browser { border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-3); overflow: hidden; }
.browser .bar { height: 38px; display: flex; gap: 6px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.mini-app { display: grid; grid-template-columns: 150px 1fr; min-height: 380px; font-size: 12px; }
.mini-side { background: var(--nav-bg); padding: 14px 10px; display: grid; gap: 4px; align-content: start; color: #C9CBC6; }
.mini-side span { padding: 7px 8px; border-radius: 8px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.mini-side span.on { background: rgba(255,122,20,.16); color: #fff; }
.mini-side svg { width: 14px; height: 14px; }
.mini-main { padding: 16px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-content: start; background: var(--bg); }
.mini-main .ph-card { font-size: 12px; }
@media (max-width: 600px) { .mini-app { grid-template-columns: 1fr; } .mini-side { display: none; } }
@media (max-width: 400px) { .mini-main { grid-template-columns: 1fr; } }
.checks { display: grid; gap: 14px; margin-top: 24px; }
.checks div { display: flex; gap: 12px; align-items: flex-start; }
.checks svg { width: 20px; height: 20px; color: var(--brand-ink); flex-shrink: 0; margin-top: 2px; }

/* Objectifs */
.goal-show { display: grid; gap: 16px; }
@media (min-width: 768px) { .goal-show { grid-template-columns: repeat(3, 1fr); } }
.goal-show .card { min-width: 0; }
.goal-amount { overflow-wrap: break-word; }
.goal-amount .cur { font-size: .875rem; }

/* Progression */
.prog { display: grid; gap: 32px; align-items: center; }
.prog > * { min-width: 0; }
@media (min-width: 1024px) { .prog { grid-template-columns: 1fr 1fr; } }
.climb { display: flex; align-items: flex-end; gap: 10px; height: 240px; }
.climb div { flex: 1; border-radius: 12px 12px 4px 4px; background: var(--surface-3); position: relative; }
.climb div:last-child { background: var(--brand); }
.climb div small { position: absolute; top: -22px; left: -4px; right: -4px; text-align: center; font-weight: 800; font-size: 12px; white-space: nowrap; }

/* Intelligence */
.ai-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .ai-grid { grid-template-columns: 1fr 1fr; } }

/* Simplicité */
.speed { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .speed { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.speed .card { text-align: center; padding: 28px 16px; }
.speed .big { font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em; }
.speed .t { font-size: var(--fs-xs); font-weight: 800; color: var(--brand-ink); letter-spacing: .08em; }

/* WhatsApp */
.wa { display: grid; gap: 40px; align-items: center; }
.wa > * { min-width: 0; }
@media (min-width: 1024px) { .wa { grid-template-columns: 1fr 1fr; } }
.chat { background: #ECE5DD; border-radius: 28px; padding: 20px 16px; display: grid; gap: 10px; max-width: 420px; margin-inline: auto; width: 100%; }
:root[data-theme="dark"] .chat { background: #0B141A; }
.bubble { max-width: 86%; padding: 10px 12px 8px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: #fff; color: #111B21; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
:root[data-theme="dark"] .bubble { background: #202C33; color: #E9EDEF; }
.bubble.me { margin-left: auto; background: #D9FDD3; }
:root[data-theme="dark"] .bubble.me { background: #005C4B; }
.bubble time { display: block; text-align: right; font-size: 11px; opacity: .55; margin-top: 2px; }
.chat-head { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; }
.chat-head .avatar { background: #fff; padding: 4px; }
.chat-head .avatar img { width: 100%; }

/* Tarifs */
.price-card { max-width: 560px; margin: 0 auto; padding: 32px; border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-2); }
.price-opts { display: grid; gap: 10px; margin: 24px 0; }
.price-opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); border: 1.5px solid var(--border-strong); cursor: pointer; transition: all .15s; }
.price-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.price-opt input { accent-color: var(--brand); width: 18px; height: 18px; flex-shrink: 0; }
.price-opt > div:first-of-type { min-width: 0; }
.price-opt .p { margin-left: auto; text-align: right; white-space: nowrap; }
.price-opt .p b { font-size: 1.25rem; letter-spacing: -.02em; }
.free { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--nav-bg); color: #fff; }
.free .badge { background: var(--brand); color: var(--on-brand); }
@media (max-width: 420px) { .price-card { padding: 22px 16px; } .price-opt { padding: 14px 12px; gap: 10px; } }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; font-weight: 700; font-size: 1.0625rem; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; font-weight: 500; color: var(--brand-ink); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--text-2); max-width: 680px; }

/* Appel final */
.final { background: var(--nav-bg); color: #F1F1ED; border-radius: var(--r-2xl); padding: 56px 28px; text-align: center; position: relative; overflow: hidden; }
.final::before { content: ""; position: absolute; left: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; border: 56px solid rgba(255,114,0,.12); }
.final > * { position: relative; }
@media (min-width: 768px) { .final { padding: 88px 48px; } }

/* Pied de page */
footer.l-foot { padding: 64px 0 40px; border-top: 1px solid var(--border); }
footer.l-foot .logo img { height: 30px; width: auto; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; }
.foot-grid .foot-brand { grid-column: 1 / -1; max-width: 320px; }
.foot-grid h4 { font-size: var(--fs-sm); margin-bottom: 12px; }
.foot-grid a, .foot-grid .foot-soon { display: block; padding: 5px 0; color: var(--text-2); font-size: var(--fs-sm); }
.foot-grid a:hover { color: var(--text); }
.foot-grid .foot-soon { color: var(--text-3); }
.foot-grid .foot-soon small { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.foot-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); --gap: 8px 24px; }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .foot-grid .foot-brand { grid-column: auto; } }

/* Formulaires : deux champs côte à côte sur écran assez large */
.form-pair { display: grid; gap: 16px; }
.form-pair > * { min-width: 0; }
@media (min-width: 520px) { .form-pair { grid-template-columns: 1fr 1fr; gap: 12px; } }
@media (min-width: 520px) { .form-pair--wide-end { grid-template-columns: 2fr 3fr; } }

/* Espace connecté (provisoire, en attendant le shell complet de /template) */
.app-top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.app-top .container { display: flex; align-items: center; gap: 10px; height: 64px; }
.app-top .logo img { height: 26px; width: auto; }
.app-main { padding: 28px 0 56px; }

/* Liste libellé / valeur (profil, détails). Deux colonnes quand la place le permet,
   libellé au-dessus de la valeur sur petit téléphone : jamais de texte superposé. */
.details { display: grid; margin: 0; }
.details > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--text-2); font-size: var(--fs-sm); min-width: 0; }
.details dd { margin: 0; min-width: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
@media (max-width: 479px) {
  .details > div { grid-template-columns: minmax(0, 1fr); }
  .details dd { text-align: left; justify-content: flex-start; }
}

/* Profil (styles de page de template/profile.html) */
.p-layout { display: grid; gap: 16px; }
.p-layout > *, .cols > * { min-width: 0; }
.p-layout [id] { scroll-margin-top: 80px; }
.p-nav { display: none; }
.set { padding: 4px 20px; }
.set h2 { font-size: 1rem; padding: 16px 0 4px; }
.set .list-item { min-height: 58px; }
.set .list-item .grow { min-width: 0; }
.set .list-item .title, .set .list-item .sub { white-space: normal; }
.set .list-item .sub { flex-wrap: wrap; row-gap: 0; }
.set .list-item .ico { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.set .list-item .ico svg { width: 18px; height: 18px; }
.set .list-item .ico-whatsapp { background: #DCF8E7; color: #128C4B; }
.set .chev { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.plans { display: grid; gap: 8px; margin: 8px 0 16px; }
.plan { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r-lg); cursor: pointer; }
.plan:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.plan input { accent-color: var(--brand); width: 18px; height: 18px; }
.sel-inline { min-height: 40px; width: auto; padding: 8px 36px 8px 12px; font-size: var(--fs-sm); font-weight: 600; text-overflow: ellipsis; }
input.sel-inline { padding-right: 12px; }
.set-actions { display: flex; justify-content: flex-end; padding: 8px 0 16px; }
/* Fonctions à venir : visibles mais inactives. */
.set [aria-disabled="true"] .ico, .set [aria-disabled="true"] .grow, .is-soon .plan { opacity: .55; }
.is-soon .plan { cursor: not-allowed; }
.set .is-danger .ico { background: var(--error-soft); color: var(--error); }
.set .is-danger .title { color: var(--error); }
/* Erreur de validation sous la ligne concernée. */
.set .list-item.has-error { flex-wrap: wrap; }
.set .list-item .field-error { flex-basis: 100%; }
/* Ligne libellé + menu : le menu passe sous le libellé dès que la place manque
   (jamais de libellé écrasé mot par mot). */
.set .list-item.has-select { flex-wrap: wrap; row-gap: 8px; }
.set .list-item.has-select .grow { flex: 1 1 180px; }
.set .list-item.has-select .sel-inline { flex: 0 1 auto; max-width: 100%; margin-left: auto; }
.p-identity p, .p-identity h2 { overflow-wrap: anywhere; }
.p-identity p .num { white-space: nowrap; }
@media (min-width: 768px) {
  .plans { grid-template-columns: repeat(3, 1fr); }
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
}
@media (min-width: 1200px) {
  .p-layout { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .p-nav { display: grid; gap: 2px; position: sticky; top: 92px; }
  .p-nav a { padding: 10px 12px; border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); display: flex; gap: 10px; align-items: center; }
  .p-nav a:hover { background: var(--surface-2); color: var(--text); }
  .p-nav a svg { width: 18px; height: 18px; }
}
/* Comptes : solde aligné à droite, puces de type (radios), comptes archivés repliés. */
.set .list-item .amount { flex-shrink: 0; }
.chip-radio { position: relative; cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-radio:has(input:focus-visible) { box-shadow: var(--focus); }
.archived { border-top: 1px solid var(--border); padding: 4px 0 12px; }
.archived .list-item { flex-wrap: wrap; }
.archived .list-item .grow { flex: 1 1 160px; }
.archived .list-item .btn { margin-left: auto; }
.archived summary { cursor: pointer; padding: 10px 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }

/* Catégories (styles de page de template/profile.html) */
.c-list { max-height: min(52dvh, 460px); overflow-y: auto; }
.c-list .list-item { width: calc(100% + 24px); }
.c-preview { display: flex; justify-content: center; padding: 8px 0 4px; }
.c-preview .chip { min-height: 48px; padding: 0 20px; font-size: 1rem; pointer-events: none; max-width: 100%; }
.c-preview .chip span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ico-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.ico-opt { position: relative; height: 48px; border-radius: var(--r-md); font-size: 1.4rem; background: var(--surface-2); border: 2px solid transparent; transition: border-color .15s, background .15s; display: grid; place-items: center; cursor: pointer; }
.ico-opt:hover { background: var(--surface-3); }
.ico-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ico-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.ico-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.badge-xs { height: 18px; padding: 0 6px; }

/* Shell : éléments à venir (template : pages pas encore disponibles), recherche, bouton de déconnexion */
.nav-item.is-soon, .bottomnav .is-soon { opacity: .45; cursor: not-allowed; }
.bottomnav .is-soon { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--text-3); min-height: 52px; }
.bottomnav .is-soon svg { width: 22px; height: 22px; }
.soon-tag { margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.sidebar form { margin: 0; }
.sidebar button.nav-item { text-align: left; }
.topbar-search { width: 280px; }
.topbar-search .input { min-height: 40px; border-radius: 999px; padding-top: 8px; padding-bottom: 8px; background: var(--surface); }
@media (max-width: 479px) { .topbar .lang-switch { display: none; } }
.chip.is-soon { opacity: .45; cursor: not-allowed; }

/* Ajout rapide */
.amount-input .val { display: block; width: 100%; min-width: 0; border: 0; background: none; text-align: center; padding: 0; color: var(--text); outline: none; }
.amount-input .val:focus-visible { box-shadow: 0 3px 0 -1px var(--brand); }
.sheet { overflow-x: hidden; }
.amount-input.has-error .val { color: var(--error); }
.amount-input .field-error { justify-content: center; margin-top: 6px; }
.pick-row.has-error .k { color: var(--error); }
.attach { display: grid; gap: 8px; justify-items: start; padding: 10px 0 4px; }
.attach-current { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.attach-current img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2); display: block; }
.attach-remove { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.attach-remove input { width: 18px; height: 18px; accent-color: var(--brand); }
.attach-pick { cursor: pointer; }
.attach:has(input[type=file]:focus-visible) .attach-pick { box-shadow: var(--focus); }
.attach.has-error .attach-pick { border-color: var(--error); color: var(--error); }
.tx-clip { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }

/* Transactions (styles de page de template/transactions.html) */
.tx-layout { display: grid; gap: 20px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary .card { padding: 12px 14px; min-width: 0; }
.summary .amount { white-space: normal; font-size: clamp(.9375rem, 3.6vw, 1.125rem); }
.filters { display: grid; gap: 12px; margin-bottom: 8px; }
.day-total { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; font-weight: 600; text-align: right; }
.month-chip { gap: 6px; padding: 0 6px; }
.month-chip a { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.month-chip a:hover { background: var(--surface-2); }
.chip-select { min-height: 40px; border-radius: var(--r-pill); max-width: 100%; }
.tx-list .list-item .sub { flex-wrap: wrap; white-space: normal; row-gap: 0; }
.tx-list .list-item .end { white-space: nowrap; }
.tx-list .list-item .title { white-space: normal; overflow-wrap: break-word; }
.tx-list .tx-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Objectifs (styles de page de template/goals.html) */
.goals { display: grid; gap: 16px; }
.goals > * { min-width: 0; }
.featured { display: grid; gap: 20px; }
.featured h2 { overflow-wrap: break-word; }
.featured .kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.featured .kv .v { font-size: 1rem; white-space: normal; }
.goal-card { display: flex; flex-direction: column; }
.goal-card .top { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.goal-card .top h3 { overflow-wrap: break-word; }
.goal-card .top .pace { flex-shrink: 0; }
.goal-card .advice { margin-top: 14px; padding: 10px 12px; }
.goal-card .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }
.add-goal { border: 2px dashed var(--border-strong); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; min-height: 200px; color: var(--text-2); }
.add-goal:hover { border-color: var(--brand); color: var(--brand-ink); }
.goal-icon { font-size: 1.15rem; padding: 0 12px; }
.featured .hist { display: none; }
@media (min-width: 768px) {
  .goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-column: 1 / -1; grid-template-columns: 180px minmax(0, 1fr); align-items: center; }
  .featured .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .featured { grid-template-columns: 200px minmax(0, 1fr) 300px; }
  .featured .hist { display: block; }
}

/* Budgets (styles de page de template/budgets.html) */
.b-layout { display: grid; gap: 16px; }
.b-sum { display: grid; gap: 18px; }
.b-sum .kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.b-sum .kv .v { white-space: normal; font-size: clamp(.9375rem, 3.8vw, 1.0625rem); }
.b-list { display: grid; gap: 10px; }
.b-item { display: grid; gap: 10px; padding: 16px; }
.b-item.is-over { border-color: color-mix(in srgb, var(--error) 35%, var(--border)); }
.b-item .head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.b-item .head b.grow { flex: 1 1 8rem; min-width: 0; overflow-wrap: break-word; }
.b-item .b-amounts { white-space: nowrap; }
.b-item .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.b-item .status { font-size: var(--fs-xs); font-weight: 700; min-width: 0; }
.b-item .edit { width: 36px; height: 36px; color: var(--text-2); }
.s-ok { color: var(--text-2); } .s-warn { color: var(--warning); } .s-full { color: var(--text); } .s-over { color: var(--error); }
.add-budget { border: 2px dashed var(--border-strong); background: transparent; box-shadow: none; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 112px; color: var(--text-2); font-weight: 700; text-align: center; }
.add-budget:hover { border-color: var(--brand); color: var(--brand-ink); }
.budget-amount { font-size: 1.25rem; font-weight: 800; }
@media (min-width: 768px) {
  .b-sum { grid-template-columns: auto 1fr; align-items: center; }
  .b-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .b-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .b-side { position: sticky; top: 92px; }
}

/* Dettes (styles de page de template/debts.html) */
.d-layout { display: grid; gap: 16px; }
.d-layout > * { min-width: 0; }
.d-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-sum .card { min-width: 0; }
.d-sum .amount { white-space: normal; font-size: clamp(1.125rem, 5vw, 1.5rem); }
.debt-card { display: grid; gap: 12px; }
.debt-card.is-owe { border-color: color-mix(in srgb, var(--t-debt) 40%, var(--border)); }
.debt-card.is-selected { box-shadow: 0 0 0 2px var(--brand); }
.debt-card h3 { overflow-wrap: anywhere; }
.debt-card .meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.debt-card .meta .v { font-size: .9375rem; white-space: normal; overflow-wrap: anywhere; }
.debt-card .row > .badge { flex-shrink: 0; }
.progress.is-debt > span { background: var(--t-debt); }
.avatar-owed { background: var(--success-soft); color: var(--success); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl { position: relative; padding: 0 0 18px; }
.tl::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--t-debt); }
.tl.is-start::before { border-color: var(--text-3); }
.tl .row-between { flex-wrap: wrap; }
.tabs-page .is-soon { height: 36px; padding: 0 16px; display: grid; place-items: center; flex: 1; font-size: var(--fs-sm); font-weight: 700; color: var(--text-3); opacity: .55; cursor: not-allowed; }
/* Historique : affiché sous la liste sur mobile dès qu'une dette est choisie, en panneau latéral sur grand écran. */
.d-detail { scroll-margin-top: 80px; }
@media (min-width: 768px) { .d-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 767px) { .d-cards { display: grid; gap: 16px; } }
@media (min-width: 1200px) {
  .d-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .d-cards { grid-template-columns: 1fr; }
  .d-detail { position: sticky; top: 92px; }
}
/* Boutons radio en contrôle segmenté (sens de la dette) */
.segmented .seg-radio { flex: 1; position: relative; }
.segmented .seg-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented .seg-radio span { height: 36px; padding: 0 16px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.segmented .seg-radio input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.segmented .seg-radio input:focus-visible + span { box-shadow: var(--focus); }
.segmented .seg-radio input:disabled { cursor: not-allowed; }
:root[data-theme="dark"] .segmented .seg-radio input:checked + span { background: var(--surface-3); }
.debt-through { display: grid; gap: 8px; }
.debt-group + .debt-group { margin-top: 10px; }

/* Panneau sans JavaScript : ouvert par son ancre (#personal-sheet). */
.sheet:target { transform: none; visibility: visible; }
@media (min-width: 768px) { .sheet:target { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; } }

/* En-têtes sur petit téléphone : le logo garde toujours sa taille. */
.l-header .logo, .app-top .logo { flex-shrink: 0; }
@media (max-width: 479px) {
  /* Espace connecté : la langue se change dans Profil › Langue et région. */
  .app-top .lang-switch { display: none; }
  .app-top .container, .l-header .container { gap: 4px; }
  .l-header .logo img { height: 26px; }
  /* Bouton d'en-tête réduit à son icône (le libellé reste dans aria-label). */
  .header-cta { width: 44px; padding: 0; }
  .header-cta span { display: none; }
}

/* Tableau de bord (template/dashboard.html) */
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.dash > * { min-width: 0; }
.hero-card { background: var(--nav-bg); color: #F1F1ED; border: 0; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(255,114,0,.14); pointer-events: none; }
.hero-card .caption, .hero-card .muted { color: #A9ADA8; }
.hero-eye { color: #A9ADA8; width: 36px; height: 36px; }
.hero-total { margin-top: 8px; position: relative; z-index: 1; overflow-wrap: break-word; }
.hero-compare { margin-top: 8px; color: #A9ADA8; position: relative; z-index: 1; }
.hero-up { color: #4ADE80; font-weight: 700; }
.hero-down { color: #FCA5A5; font-weight: 700; }
.acc-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-top: 18px; position: relative; z-index: 1; }
.acc { flex: 1 0 auto; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.06); min-width: 120px; }
.acc .caption { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.acc .amount { white-space: nowrap; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.quick button { display: grid; justify-items: center; gap: 6px; padding: 10px 2px; border-radius: 14px; font-size: 12px; font-weight: 700; color: #E8E8E4; background: rgba(255,255,255,.06); transition: background .15s; min-width: 0; overflow-wrap: anywhere; text-align: center; }
.quick button:hover { background: rgba(255,255,255,.11); }
.quick button span { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.quick button:first-child span { background: var(--brand); color: var(--on-brand); }
.quick svg { width: 18px; height: 18px; }
.month-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; margin-top: 18px; }
.month-stats .v { overflow-wrap: break-word; }
.goal-mini + .goal-mini { margin-top: 16px; }
.goal-mini .row-between { margin-bottom: 8px; gap: 8px; }
.goal-mini-name { overflow-wrap: break-word; min-width: 0; }
.dash .grid-2 > * { min-width: 0; }
.dash .grid-2 .amount { overflow-wrap: break-word; }
/* Montants masqués (bouton « œil ») */
.amounts-hidden .dash .amount, .amounts-hidden .dash .tx-list .end, .amounts-hidden .dash .month-stats .v { filter: blur(8px); user-select: none; }
.dash-root .page-head { flex-wrap: wrap; gap: 12px; }
@media (min-width: 768px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash .span-full { grid-column: 1 / -1; }
  .month-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
  .dash .c-hero { grid-column: span 5; } .dash .c-month { grid-column: span 7; }
  .dash .c-budget, .dash .c-goals, .dash .c-debts { grid-column: span 4; }
  .dash .c-tx { grid-column: span 8; } .dash .c-side { grid-column: span 4; }
  .quick { display: none; }
}
@media (max-width: 479px) {
  /* Petit téléphone : plus de place pour le libellé (« Remboursement » ne doit pas se couper). */
  .dash .c-tx { padding-inline: 14px; }
  .dash .tx-list .list-item { gap: 10px; }
  .dash .tx-list .end { font-size: var(--fs-sm); }
}

/* Notifications (cartes insight de template/insights.html) */
.i-list { display: grid; gap: 10px; }
.insight .actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.notif-list .insight .grow { min-width: 0; }
.notif-title { font-size: var(--fs-md, 1rem); margin-top: 4px; overflow-wrap: break-word; }
.notif-list .insight p { overflow-wrap: break-word; }
.notif-list .insight.is-unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: inset 3px 0 0 var(--brand); }
.notif-bell { position: relative; }
.notif-bell[aria-current="page"] { background: var(--surface-2); }
@media (min-width: 1200px) { .notif-list { max-width: 760px; } }

/* Saisie hors ligne (template/states.html) */
.offline-queue { margin-bottom: 16px; }
.offline-queue .card-head h2 { display: flex; align-items: center; gap: 8px; }
.offline-queue .card-head svg { width: 18px; height: 18px; color: var(--warning); }
.offline-queue .list-item { align-items: flex-start; }
.offline-queue .list-item.is-conflict .sub { color: var(--error); }
.offline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.offline-queue .list-item .sub { flex-wrap: nowrap; align-items: flex-start; }
.offline-queue .list-item .sub svg { flex-shrink: 0; margin-top: 2px; }

/* Rapports (template/reports.html) */
.r-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.r-grid > * { min-width: 0; }
.r-title { text-align: center; min-width: 0; }
.r-period .icon-btn.is-disabled { opacity: .35; }
.r-sentence { margin-top: 6px; font-size: clamp(1.125rem, 2.4vw, 1.625rem); font-weight: 700; line-height: 1.3; max-width: 720px; letter-spacing: -.01em; overflow-wrap: break-word; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpis .card { padding: 16px; min-width: 0; }
.kpis .kpi-v { font-size: 1.25rem; overflow-wrap: break-word; }
.top-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.top-row .rank { font-weight: 800; color: var(--text-3); font-size: var(--fs-sm); }
.top-row b { overflow-wrap: break-word; min-width: 0; }
.top-row .amount { white-space: nowrap; }
.top-row .progress { grid-column: 2 / -1; }
.top-row + .top-row { margin-top: 16px; }
.duo { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 10px; }
.duo .m { flex: 1; display: grid; gap: 6px; height: 100%; grid-template-rows: 1fr auto; min-width: 0; }
.duo .pair { display: flex; align-items: flex-end; gap: 4px; justify-content: center; }
.duo .pair span { width: 14px; border-radius: 6px 6px 3px 3px; }
.duo .inc { background: var(--chart-4); } .duo .exp { background: var(--text); }
.duo .m.is-current .exp { background: var(--brand); }
.duo small { text-align: center; font-size: 11px; color: var(--text-3); font-weight: 600; }
@media (min-width: 768px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .r-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-grid .span-2 { grid-column: 1 / -1; }
  .duo { gap: 18px; } .duo .pair span { width: 16px; }
}
@media (min-width: 1200px) {
  .r-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .r-grid .span-desk-2 { grid-column: span 2; }
}
.r-grid .list-item .grow { min-width: 0; }
.r-grid .list-item .title { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
.r-grid .list-item .amount { white-space: nowrap; }

/* Profil : canal WhatsApp */
.wa-row { align-items: flex-start; flex-wrap: wrap; }
.wa-row > .grow { flex: 1 1 0; min-width: 0; }
.wa-row .title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Sous la ligne, aligné sur le texte (icône 36 px + écart 12 px). */
.wa-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 48px; }
/* Libellé long : retour à la ligne plutôt que hors de la carte (colonne étroite sur tablette). */
.wa-actions .btn { max-width: 100%; white-space: normal; height: auto; min-height: var(--h); padding-block: 8px; line-height: 1.25; text-align: center; }
/* Mobile : bouton pleine largeur, centré. */
@media (max-width: 479px) {
  .wa-actions { padding-left: 0; }
  .wa-actions .btn { width: 100%; }
}
/* Cartes d'objectifs de l'accueil : le badge de rythme passe à la ligne plutôt que d'écraser le nom. */
.goal-show .card > .row { flex-wrap: wrap; row-gap: 8px; }
.goal-show .card > .row > b { flex: 1 0 auto; }
.goal-show .pace { white-space: nowrap; }

/* ---------- Pages légales (mise en page longue de template/guide.html) ---------- */
.legal { padding-bottom: 72px; }
.legal-head { padding: 40px 0 32px; }
.legal-head h1 { font-size: clamp(2rem, 5vw, 3.25rem); margin-top: 8px; overflow-wrap: anywhere; }
.legal-head .lead { margin-top: 12px; max-width: 720px; }
.legal-head .caption { margin-top: 10px; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.legal section { padding: 32px 0; border-top: 1px solid var(--border); }
.legal h2 { margin-bottom: 12px; font-size: clamp(1.25rem, 3vw, 1.5rem); }
.legal .txt { max-width: 760px; color: var(--text-2); }
.legal .txt p + p, .legal .txt p + ul { margin-top: 10px; }
.legal .txt ul { padding-left: 20px; display: grid; gap: 6px; }
.legal .txt ul + p { margin-top: 10px; }
.legal .tbl-wrap { margin-top: 18px; padding: 8px 16px; overflow-x: auto; }
.legal .tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.legal .tbl th, .legal .tbl td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal .tbl thead th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.legal .tbl tr:last-child > * { border-bottom: 0; }
.legal .tbl code { font-size: var(--fs-xs); overflow-wrap: anywhere; }
/* Téléphone : chaque ligne du tableau devient une petite fiche, sans défilement horizontal. */
@media (max-width: 640px) {
  .legal .tbl thead { display: none; }
  .legal .tbl tr { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .legal .tbl tr:last-child { border-bottom: 0; }
  .legal .tbl th, .legal .tbl td { display: block; padding: 0; border: 0; }
  .legal .tbl td::before { content: attr(data-label) " · "; color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
}
