/* Matifami : peau visuelle (tokens relevés sur Crea_App_matifami.pdf). Chargée après app.css. */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(../assets/fonts/nunito-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(../assets/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #EFEDF5; --ink: #25233A; --muted: #6B6690;
  --violet: #5E52C4; --violet-2: #6F64CC; --violet-soft: #A99FE6;
  --nuit: #4E353C; --nuit-2: #5F434B; --nuit-3: #6F535B; --nuit-text: #D8C9CE;
  --peche: #FEE2CE;
  --r-lg: 30px; --r-md: 26px; --r-sm: 16px;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
}
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { overscroll-behavior-y: none; }
.demo-bar { display: none; }

/* Boutons : CTA violet, sélection violette (le brun reste réservé à la tab bar et aux fonds profonds) */
.btn { min-height: 48px; border-radius: 16px; }
.btn.primary, .btn.violet { background: var(--violet); color: #fff; }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 18px; }
.seg button[aria-pressed="true"], .whofilter button[aria-pressed="true"], .protiles button[aria-pressed="true"], .iconpick button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--nuit); }
.toast { background: var(--nuit); }

/* Cartes : grands rayons, blanc pur */
.box { border-radius: 28px; padding: 20px; }
.list { border-radius: 28px; padding: 2px 18px; }
.tick { border-color: #CFC8EE; }
.tick:hover { border-color: var(--violet); }

/* ---------- En-tête : logo + date, loupe, avatars ---------- */
.top { align-items: flex-start; gap: 12px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; margin-right: auto; }
.brand .logo { display: block; height: 26px; width: auto; }
.brand .date { font-size: 15px; font-weight: 500; color: var(--muted); }
.searchbtn { width: 46px; height: 46px; margin-left: 0; margin-top: 2px; }
.top .avatars { margin-top: 3px; }
.avatars .av { width: 40px; height: 40px; font-size: 16px; font-weight: 800; border: 2px solid var(--bg); }
.avatars .av + .av { margin-left: -11px; }
.side .brand .logo { filter: brightness(0) invert(1) opacity(.92); height: 24px; }

/* ---------- Avatars ---------- */
.av { overflow: hidden; position: relative; flex: none; }
.av.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.av.sm.has-img { width: 28px; height: 28px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }
.av.lg { width: 100%; height: auto; aspect-ratio: 1; }
.av.xl { width: 68px; height: 68px; font-size: 28px; }
.av.xxl { width: 120px; height: 120px; font-size: 48px; border: 0; }
.avbtn { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; flex: none; display: grid; }
.avbtn .avedit { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.avbtn .avedit svg { width: 13px; height: 13px; }
.avbtn.sm { min-width: 44px; min-height: 44px; place-items: center; }
.av-sheet h2 { margin: 0; }
.av-prev { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.av-prev b { font-size: 18px; }
.av-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
.av-tabs button { padding: 0 4px; }
.av-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.av-cell { border: 0; background: none; padding: 3px; border-radius: 50%; min-width: 72px; box-shadow: none; }
.av-cell[aria-selected="true"] { box-shadow: 0 0 0 3px var(--violet); }
.av-cell:active { transform: scale(.96); }

/* ---------- Aujourd'hui : héros personnage ---------- */
.greet { font-size: clamp(30px, 8.6vw, 38px); font-weight: 800; letter-spacing: -.025em; margin-top: 2px; }
.hello { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 6px; align-items: center; margin-top: -4px; }
.hello-art { aspect-ratio: 1 / 1; display: flex; align-items: flex-end; margin-left: -6px; }
.hello-art .illu { width: 100%; height: 100%; object-fit: contain; object-position: left bottom; }
.hello-txt { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hello .count { margin: 0; font-size: clamp(25px, 7.2vw, 30px); line-height: 1.06; font-weight: 800; letter-spacing: -.02em; color: var(--violet); text-wrap: balance; }
.hello .chips { flex-direction: column; align-items: stretch; gap: 8px; }
.hello .qchip { justify-content: flex-start; padding: 11px 14px; border-radius: 18px; font-size: 14px; line-height: 1.2; }
.hello .qchip svg { flex: none; }

/* Carte « prochaine chose » */
.hero { border-radius: 30px; padding: 24px 22px; min-height: 0; overflow: visible; background: var(--violet); }
.hero .eyebrow { letter-spacing: .12em; text-transform: uppercase; }
.hero .art { width: 168px; height: auto; right: -8px; top: -26px; transform: rotate(0deg); pointer-events: none; }
.hero .big { font-size: 54px; font-weight: 800; letter-spacing: -.02em; }
.hero .title { font-size: 21px; max-width: 62%; }
.hero .row-btns { margin-top: 12px !important; padding-top: 0 !important; }
.hero .btn { min-height: 54px; border-radius: 18px; font-size: 17px; }
.hero .btn.ghost-w { border-color: rgba(255,255,255,.5); }
.hero.light .big { font-weight: 200; font-size: 60px; letter-spacing: -.01em; }
.hero.light { overflow: visible; }
.hero.light .art { width: 150px; right: 10px; top: -20px; }
.hero.meteo { margin-top: 74px; padding-top: 22px; }
.hero.meteo .hero-illu { position: absolute; right: 2px; bottom: 0; height: 150%; width: auto; max-width: 62%; object-fit: contain; object-position: right bottom; pointer-events: none; }
.hero.meteo > *:not(.hero-illu) { max-width: 52%; }
.wmascot { width: 86px; height: auto; flex: none; }
.weather .now { align-items: center; }

/* Pastilles météo, titres de pages (poids léger, comme la maquette) */
.main > h1:not(.greet), .main > .sec-head h1, .main > div > h1 { font-size: 40px; font-weight: 300; letter-spacing: -.02em; line-height: 1.05; }
.main .sec-head > div > .muted { font-size: 16px; font-weight: 400; }
.sec-head h2, .box h2, section > h2 { font-weight: 700; }
.head-art { width: 88px; height: auto; flex: none; margin: -14px 0 -10px auto; }
.empty-art { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 10px; text-align: center; color: var(--muted); }
.empty-art .illu { width: 150px; height: auto; }
.empty-art p { margin: 0; max-width: 28ch; font-weight: 600; }
.mascot { display: block; }

/* ---------- Tab bar brune, + violet clair ---------- */
.tabbar { height: 74px; background: var(--nuit); border-radius: 30px; box-shadow: 0 14px 30px rgba(78,53,60,.28); max-width: 600px; }
.tabbar a { color: #BDB1EE; font-size: 11px; gap: 4px; min-width: 60px; min-height: 44px; justify-content: center; }
.tabbar a[aria-current="page"] { color: #fff; }
.fab { width: 66px; height: 66px; margin-top: -34px; background: var(--violet-soft); color: var(--violet); box-shadow: 0 10px 22px rgba(94,82,196,.32); border: 5px solid var(--bg); }
.fab:active { transform: scale(.95); }
.tabbar .badge { top: 0; }
.main { padding-bottom: 132px; }
.selbar, .composer { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
.side-in { background: var(--nuit); }
.side nav a[aria-current="page"] { background: #fff; color: var(--nuit); }
.side .add { background: var(--violet-soft); color: var(--violet); }

/* ---------- Plus : tuiles à mascotte ---------- */
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { min-height: 150px; border-radius: 28px; padding: 18px; overflow: hidden; }
.tile .tile-art { position: absolute; right: 8px; top: 8px; width: 76px; height: 76px; object-fit: contain; }
.tile b { margin-top: auto; padding-top: 70px; }
.tile .ico { margin-bottom: 0; }

/* ---------- Onboarding ---------- */
.wmf { position: relative; min-height: 100dvh; overflow: hidden; background: linear-gradient(180deg, var(--bg) 0, var(--bg) 66%, var(--peche) 66%); padding-top: env(safe-area-inset-top, 0px); display: flex; flex-direction: column; align-items: center; }
.w-hello { align-self: flex-start; margin: 22px 0 0 max(28px, env(safe-area-inset-left)); font-size: 20px; font-weight: 800; color: var(--ink); position: relative; z-index: 2; }
.w-illu { display: block; width: 100%; max-width: 520px; height: auto; position: relative; z-index: 1; margin-top: -2px; }
.w-card { position: relative; z-index: 3; background: #fff; border-radius: 34px; margin: -22px 16px max(16px, env(safe-area-inset-bottom)); width: calc(100% - 32px); max-width: 520px; padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(78,53,60,.10); }
.w-card .in { height: 50px; border-radius: 18px; font-size: 17px; border-color: #E6E2F4; }
.w-card label.f { font-size: 14px; color: #6B6690; font-weight: 800; }
.w-card small { font-size: 14px; line-height: 1.4; color: #6B6690; }
.w-restore { align-self: center; cursor: pointer; font-size: 14px; }

/* ---------- Feuilles ---------- */
.sheet { border-radius: 30px 30px 0 0; }
.scrim { background: rgba(78,53,60,.38); }
.avedit svg, .qchip svg { stroke-width: 2.2; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Ajustements après comparaison PDF */
.hello { grid-template-columns: minmax(0, 47%) minmax(0, 1fr); gap: 4px; }
.hello .count { font-size: clamp(21px, 6.2vw, 25px); line-height: 1.08; }
.hello .chips { align-items: flex-start; gap: 8px; }
.hello .qchip { padding: 8px 12px; font-size: 13px; border-radius: 16px; min-height: 36px; width: auto; }
.hero .art { width: 118px; right: 6px; top: -16px; }
.hero .title { max-width: 58%; }
.hero.light .big { font-size: 50px; }
.hero.light .art { width: 128px; top: -22px; }
