/* Onboarding de la webapp, DA de l'app iOS : bulle de Tomo, puces « Qui écrit ? », lettres en tuiles bonbon. */
.mt-onb-says{display:flex;align-items:center;gap:12px;margin:4px 0 10px}
.mt-onb-tomo{flex:none;width:64px;height:64px;animation:mt-onb-enter .75s cubic-bezier(.34,1.4,.64,1) both,mt-onb-bob 2.4s ease-in-out .75s infinite}
/* Nouvelle page : Tomo arrive par la gauche en sautant (il est sorti par la droite de la page d'avant). */
@keyframes mt-onb-enter{0%{transform:translate(-120px,-30px) rotate(-12deg);opacity:0}45%{transform:translate(-40px,-46px) rotate(-6deg);opacity:1}75%{transform:translate(0,4px) scale(1.12,.86)}100%{transform:none}}
.mt-onb-tomo>*{width:100%!important;height:100%!important;margin:0!important}
.mt-onb-bubble{position:relative;margin:0;padding:10px 14px;border-radius:18px;background:linear-gradient(135deg,#ffffffe6,#ffffffb3);border:1px solid #ffffffcf;box-shadow:inset 0 1px 1px #fff,0 8px 18px -12px #24384a59;font-weight:800;color:#203b4a}
.mt-onb-bubble::before{content:"";position:absolute;left:-7px;top:50%;width:14px;height:14px;transform:translateY(-50%) rotate(45deg);background:#fffffff0;border-left:1px solid #ffffffcf;border-bottom:1px solid #ffffffcf}
.mt-onb-name h1{font-family:"Fraunces Variable","Fraunces",Georgia,serif;margin:4px 0 12px}
.mt-onb-who{margin:0 0 6px;font-weight:850;font-size:14px;color:#203b4abf}
.mt-onb-tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;min-height:46px;margin:10px 0 6px}
.mt-onb-tile{display:grid;place-items:center;width:38px;height:44px;border-radius:12px 12px 10px 10px;background:radial-gradient(70% 55% at 30% 18%,#ffffffd9,#fff0 60%),var(--c);box-shadow:inset 0 -4px 0 #00000012,inset 0 2px 2px #fff,0 8px 12px -8px #24384a66;font:650 24px/1 "Fraunces Variable","Fraunces",Georgia,serif;color:#203b4a;animation:mt-onb-pop .38s cubic-bezier(.34,1.56,.64,1) both}
.mt-onb-gap{width:12px}
.mt-onb-tiles.is-reading .mt-onb-tile{animation:mt-onb-hop .5s ease-in-out both;animation-delay:calc(var(--i) * 90ms)}
.mt-onb-note{margin:12px 0 0}
.mt-onb-note [data-for]{display:none}
.mt-onb-name[data-writer="adult"] .mt-onb-note [data-for="adult"],.mt-onb-name[data-writer="self"] .mt-onb-note [data-for="self"]{display:inline}
.mt-onb-name form{display:flex;flex-direction:column;align-items:stretch}
@keyframes mt-onb-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@keyframes mt-onb-pop{from{opacity:0;transform:translateY(8px) scale(.6)}to{opacity:1;transform:none}}
@keyframes mt-onb-hop{0%,100%{transform:none}40%{transform:translateY(-10px) rotate(-4deg)}}

/* Les règles de verre du thème sont en couche avec « !important » : on se place dans la même couche. */
@layer meettomo-theme{
.mt-onb-chips{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin:0 0 12px!important}
.mt-onb-chips>button{display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:48px!important;padding:8px 10px!important;border-radius:18px!important;border:1px solid #ffffffcf!important;background:linear-gradient(135deg,#ffffff99,#ffffff4d)!important;box-shadow:inset 0 1px 1px #fff,0 6px 16px -10px #59657955!important;color:#203b4a!important;font:800 14px/1.2 "Nunito Sans",system-ui,sans-serif!important;cursor:pointer!important}
.mt-onb-chips>button[aria-pressed="true"]{border:2px solid #438775!important;background:linear-gradient(135deg,#e7f5ee,#ffffffb3)!important;box-shadow:inset 0 1px 1px #fff,0 0 0 4px #9fd6b94d!important}
.mt-onb-name #onb-nickname{width:100%!important;min-height:52px!important;padding:10px 16px!important;border-radius:18px!important;border:2px solid #f0cf6a!important;background:#fffdf5!important;font:650 22px/1.2 "Fraunces Variable","Fraunces",Georgia,serif!important;color:#203b4a!important;text-align:center!important;box-shadow:inset 0 2px 4px #24384a14!important}
.mt-onb-name #onb-nickname:focus-visible{outline:4px solid #438775!important;outline-offset:2px!important}
.mt-onb-name .mt-onb-read{align-self:center!important;margin:4px 0 8px!important}
.mt-onb-name .mt-onb-go{width:100%!important;justify-content:center!important;text-align:center!important}
.mt-onb-name .mt-onb-later{align-self:center!important;margin-top:4px!important}

/* Accueil : choix de langue en boules-drapeaux comme sur iOS (nom sous la boule), la langue choisie
   cerclée de l'arc pastel et qui rebondit doucement. */
.onboarding .lang-picker{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:6px 10px!important;margin:0 auto 16px!important;padding-top:10px!important;max-width:460px!important}
.onboarding .lang-picker button{display:flex!important;flex-direction:column!important;align-items:center!important;gap:6px!important;min-width:68px!important;min-height:0!important;padding:4px 2px!important;border:0!important;border-radius:18px!important;background:none!important;box-shadow:none!important;font:800 12.5px/1.1 "Nunito Sans",system-ui,sans-serif!important;color:var(--mt-nav-ink,#24384a)!important;cursor:pointer;animation:mt-lang-pop .5s cubic-bezier(.34,1.56,.64,1) both}
.onboarding .lang-picker button:nth-child(2){animation-delay:.06s}.onboarding .lang-picker button:nth-child(3){animation-delay:.12s}.onboarding .lang-picker button:nth-child(4){animation-delay:.18s}.onboarding .lang-picker button:nth-child(5){animation-delay:.24s}.onboarding .lang-picker button:nth-child(6){animation-delay:.3s}
.onboarding .lang-picker button .lang-flag{width:50px!important;height:50px!important;margin:0!important;box-shadow:0 0 0 3px #fff,0 8px 16px -6px #40526466!important;transition:transform .25s cubic-bezier(.34,1.56,.64,1),box-shadow .25s ease!important}
.onboarding .lang-picker button[aria-pressed="true"]{color:var(--mt-nav-ink,#203b4a)!important;transform:none!important}
.onboarding .lang-picker button[aria-pressed="true"] .lang-flag{width:58px!important;height:58px!important;box-shadow:0 0 0 3px #fff,0 10px 18px -6px #40526480!important;animation:mt-lang-ball 1.8s ease-in-out infinite}
.onboarding .lang-picker button[aria-pressed="true"]::before{content:"";position:absolute;top:-2px;left:0;right:0;margin-inline:auto;width:70px;height:70px;border-radius:50%;background:conic-gradient(#9fd6b9,#bba8ea,#f0ad8c,#f0cf6a,#9fd6b9);-webkit-mask:radial-gradient(circle,#0000 30px,#000 31px);mask:radial-gradient(circle,#0000 30px,#000 31px);animation:mt-lang-ball 1.8s ease-in-out infinite;pointer-events:none}
.onboarding .lang-picker button{position:relative!important}
@media(hover:hover){.onboarding .lang-picker button:not([aria-pressed="true"]):hover .lang-flag{transform:translateY(-4px) scale(1.06)!important}}
.onboarding .lang-picker button:active .lang-flag{transform:scale(.9)!important}
.onboarding .lang-picker button:focus-visible{outline:3px solid #438775!important;outline-offset:2px!important}
@keyframes mt-lang-pop{from{opacity:0;transform:scale(.3) translateY(10px)}to{opacity:1;transform:none}}
@keyframes mt-lang-ball{0%,100%{transform:translateY(0) scale(1.04,.96)}50%{transform:translateY(-6px) scale(.98,1.02)}}
@media(prefers-reduced-motion:reduce){.onboarding .lang-picker button,.onboarding .lang-picker button[aria-pressed="true"] .lang-flag,.onboarding .lang-picker button[aria-pressed="true"]::before{animation:none!important}}
}
.onboarding.center>h1{font-family:"Fraunces Variable","Fraunces",Georgia,serif}

html.veilleuse .mt-onb-bubble,[data-veilleuse="on"] .mt-onb-bubble{background:#ffffffe6}
@media(prefers-reduced-motion:reduce){.mt-onb-tomo,.mt-onb-tile,.mt-onb-tiles.is-reading .mt-onb-tile{animation:none}}

/* Cadeau (planche v2) : boîte lavande et ruban pêche, rayons dorés qui tournent, étincelles, étiquette « Nouveau ». */
.mt-gift-rays,.mt-gift-spark{position:absolute;pointer-events:none;opacity:0;transition:opacity .6s ease}
.mt-gift-rays{left:50%;top:46%;width:440px;height:440px;margin:-220px 0 0 -220px;border-radius:50%;background:repeating-conic-gradient(#fff1c4cc 0 6deg,#fff1c400 6deg 22.5deg);-webkit-mask:radial-gradient(#000 12%,#0009 40%,#0000 68%);mask:radial-gradient(#000 12%,#0009 40%,#0000 68%);animation:mt-gift-spin 24s linear infinite}
.mt-gift-spark{width:16px;height:16px;background:#f0cf6a;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);animation:mt-c-twinkle 2.2s ease-in-out infinite}
.mt-gift-spark:nth-of-type(1){left:12%;top:16%}.mt-gift-spark:nth-of-type(2){right:14%;top:8%;width:22px;height:22px;animation-delay:.5s}
.mt-gift-spark:nth-of-type(3){left:20%;top:62%;width:11px;height:11px;animation-delay:1s}.mt-gift-spark:nth-of-type(4){right:20%;top:56%;width:13px;height:13px;animation-delay:1.5s}
.gift-screen:is([data-stage="opening"],[data-stage="revealed"]) :is(.mt-gift-rays,.mt-gift-spark){opacity:1}
.gift-screen[data-stage="revealed"] .gift-reveal-copy{position:relative;margin:18px auto 0;max-width:340px;padding:18px 18px 12px;border-radius:20px;background:linear-gradient(135deg,#ffffffcc,#ffffff80);border:1px solid #ffffffcf;box-shadow:inset 0 1px 1px #fff,0 10px 24px -16px #24384a66}
.gift-screen .gift-reveal-copy .victory-label{position:absolute;left:50%;top:0;transform:translate(-50%,-50%);padding:4px 10px;border-radius:999px;background:#438775;color:#fff;font:900 11.5px/1.2 "Nunito Sans",system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.gift-screen .gift-reveal-copy h2{font-family:"Fraunces Variable","Fraunces",Georgia,serif}
.gift-screen[data-stage="revealed"] .gift-accessory img{filter:drop-shadow(0 8px 10px #c79a2e59)}
@keyframes mt-gift-spin{to{transform:rotate(360deg)}}
@keyframes mt-c-twinkle{0%,100%{opacity:.5;transform:scale(.75)}50%{opacity:1;transform:scale(1.05)}}
@media(prefers-reduced-motion:reduce){.mt-gift-rays,.mt-gift-spark{animation:none}}

/* Étapes de l'onboarding : tirets comme sur iOS, sans texte. */
.mt-onb-progress{display:flex;justify-content:center;gap:6px;margin:2px auto 14px}
.mt-onb-progress i{width:26px;height:6px;border-radius:99px;background:#24384a1f;transition:background .3s ease,width .35s cubic-bezier(.34,1.56,.64,1)}
.mt-onb-progress i.on{background:linear-gradient(90deg,#9fd6b9,#bba8ea)}
.mt-onb-progress i.now{width:40px;background:linear-gradient(90deg,#9fd6b9,#bba8ea,#f0ad8c)}
:root[data-veilleuse=on] .mt-onb-progress i{background:#ffffff2e}
:root[data-veilleuse=on] .mt-onb-progress i.on{background:linear-gradient(90deg,#9fd6b9,#bba8ea)}
:root[data-veilleuse=on] .mt-onb-progress i.now{background:linear-gradient(90deg,#9fd6b9,#bba8ea,#f0ad8c)}
@media(prefers-reduced-motion:reduce){.mt-onb-progress i{transition:none}}

/* Objectif et matière (11 novembre, retour de Loïc) : Tomo pose la question, grosses tuiles bonbon, peu de texte. */
@layer meettomo-theme{
.mt-onb-pick .mt-onb-goals{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:14px!important;margin:8px 0 14px!important}
.mt-onb-pick .mt-onb-goals>button{position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-height:132px!important;padding:16px 12px!important;border-radius:24px!important;border:1px solid #ffffffd9!important;text-align:center!important;
 background:radial-gradient(ellipse 70% 40% at 30% 12%,#ffffffd0,#fff0 70%),linear-gradient(180deg,var(--lt),var(--b) 60%,var(--d))!important;box-shadow:inset 0 -6px 0 #00000010,inset 0 2px 2px #fff,0 14px 20px -12px #24384a59!important;color:#24384a!important;
 animation:mt-onb-pop .5s cubic-bezier(.34,1.56,.64,1) both;transition:transform .2s cubic-bezier(.34,1.56,.64,1)!important}
.mt-onb-pick .mt-onb-goals>button:nth-child(4n+1){--lt:#f3fbf7;--b:#cdeedd;--d:#a6dcc0}
.mt-onb-pick .mt-onb-goals>button:nth-child(4n+2){--lt:#f7f3fe;--b:#e1d6fa;--d:#c3b1ee;animation-delay:.08s}
.mt-onb-pick .mt-onb-goals>button:nth-child(4n+3){--lt:#fff6ef;--b:#fbdcc8;--d:#f3bf9f;animation-delay:.16s}
.mt-onb-pick .mt-onb-goals>button:nth-child(4n+4){--lt:#fffbea;--b:#fbecb4;--d:#f2d57e;animation-delay:.24s}
.mt-onb-pick .mt-onb-goals>button strong{font:800 16px/1.2 "Nunito Sans",system-ui,sans-serif!important;overflow-wrap:anywhere}
.mt-onb-pick .mt-onb-goals>button small{font-size:12px!important;font-weight:800!important;padding:3px 8px;border-radius:99px;background:#ffffffb3}
.mt-onb-pick .mt-onb-emoji{font-size:34px;line-height:1;filter:drop-shadow(0 3px 3px #24384a2e)}
.mt-onb-pick .mt-onb-goals .subject-icon{width:46px!important;height:46px!important;border-radius:16px!important}
@media(hover:hover){.mt-onb-pick .mt-onb-goals>button:hover{transform:translateY(-4px) rotate(-1deg)!important}}
.mt-onb-pick .mt-onb-goals>button:active{transform:scale(.95)!important}
.mt-onb-pick .mt-onb-goals>button:focus-visible{outline:4px solid #438775!important;outline-offset:3px!important}
.mt-onb-pick .mt-onb-optional{margin:0 0 4px!important;text-align:center!important;font-size:12.5px!important;opacity:.7}
.mt-onb-pick .mt-onb-try{display:block!important;margin:0 auto 14px!important}
.onboarding h1:focus:not(:focus-visible),.onboarding [tabindex="-1"]:focus{outline:none!important}
@media(prefers-reduced-motion:reduce){.mt-onb-pick .mt-onb-goals>button{animation:none!important}}
}
/* Mode nuit (veilleuse) : la bulle, les tuiles et les cartes bonbon restent claires, donc leur texte reste foncé.
   La couche veilleuse est déclarée avant le thème : ses !important gagnent, on corrige donc ici dans cette couche. */
@layer meettomo-veilleuse{
:root[data-veilleuse=on] :is(.mt-onb-bubble,.mt-onb-tile),:root[data-veilleuse=on] .mt-onb-pick .mt-onb-goals>button,:root[data-veilleuse=on] .mt-onb-pick .mt-onb-goals>button *{color:#203b4a!important}
:root[data-veilleuse=on] .mt-onb-pick .mt-onb-goals>button{background:radial-gradient(ellipse 70% 40% at 30% 12%,#ffffffd0,#fff0 70%),linear-gradient(180deg,var(--lt),var(--b) 60%,var(--d))!important;border-color:#ffffffd9!important}
}
/* Téléphone : un peu d'air entre les drapeaux et Tomo, pour que sa bulle tienne sans cacher les langues. */
@media(max-width:600px){@layer meettomo-theme{.onboarding.center>.lang-picker+.tomo{margin-top:58px!important}}}
/* Menu : le surnom reprend les carrés bonbon de l'onboarding, en petit (idée de Loïc, 11 novembre). */
.mt-name-tiles{display:inline-flex;flex-wrap:wrap;gap:3px;vertical-align:middle}
.mt-name-tiles .mt-onb-tile{width:24px;height:28px;border-radius:8px 8px 7px 7px;font-size:16px;box-shadow:inset 0 -3px 0 #00000012,inset 0 1px 1px #fff,0 5px 8px -6px #24384a66;animation-delay:calc(var(--i) * 60ms)}
.mt-name-tiles .mt-onb-gap{width:6px}
/* 17/11/2026 (Loïc) : dans la barre latérale, le surnom reste sur une seule ligne, en entier ; les tuiles rétrécissent si le nom est long. */
.sidebar .mt-name-tiles{display:flex;flex-wrap:nowrap;gap:2px;max-inline-size:100%;min-inline-size:0}
.sidebar .mt-name-tiles .mt-onb-tile{flex:0 1 22px;inline-size:auto;min-inline-size:0;block-size:26px;font-size:15px;overflow:hidden}
.sidebar .mt-name-tiles .mt-onb-gap{flex:0 1 5px;inline-size:auto;min-inline-size:0}
@layer meettomo-veilleuse{:root[data-veilleuse=on] .mt-name-tiles .mt-onb-tile{color:#203b4a!important}}
/* Boutons qui respirent (consigne du 11 novembre) : « Retour » bien séparé du bouton principal. */
@layer meettomo-theme{.onboarding [data-action="ob-back"],.onboarding [data-action="ob-cancel"]{margin-top:24px!important}
.onboarding .mt-c-go{margin-bottom:6px!important}}
/* Bulle D de l'onboarding : son coin pointu arrive à la hauteur de la bouche de Tomo (pas sous ses pieds). */
@layer meettomo-theme{.mt-onb-says{align-items:flex-end!important}.mt-onb-says .mt-onb-bubble{margin-bottom:24px!important}}
/* Pôle Conversion (12/11/2026) : réassurance sous le bouton d'essai, drapeaux en bas de la carte d'accueil. */
.onboarding .mt-onb-trust{margin:10px auto 14px!important;color:#5f6b63}
.onboarding.center>.lang-picker:not(:first-child){margin-top:18px!important}
/* 14/11/2026, contrôle du parcours d’essai : en russe sur iPhone SE, les objectifs passent sur une colonne et
   « Пропустить этот шаг » sortait de l’écran (544–676 px pour 667). Cartes plus basses sur les écrans courts. */
@media(max-height:700px){@layer meettomo-theme{.mt-onb-pick .mt-onb-goals>button{min-height:104px!important;padding:12px!important;gap:4px!important}}}
