:root {
  /* Identité : violet, pêche et blanc. */
  --violet: #6A4BDB;
  --violet-deep: #4B2FB8;
  --violet-soft: #EEE8FF;
  --hero2: #7D62E6;
  --chipline: #A894F2;
  --night: #241A5C;
  --night2: #34287F;
  --sun: #FFB997;
  --sun-soft: #FFE6D9;
  --coral: #FF8FB1;
  --mint: #BDEBD8;
  --ink: #1B2430;
  --muted: #5B6573;
  --ground: #FAF7FF;
  --card: #FFFFFF;
  --line: #E3E0F0;
  --display: 'Fraunces', Georgia, serif;
  --round: 'Quicksand', 'Nunito', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
  --body: 'Nunito', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: #ECE6FB; font-family: var(--body); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; font-weight: 700; letter-spacing: -0.01em; font-variation-settings: 'SOFT' 100; }
.small, .pill, .chip, .btn, .label, .field > label, .nav button, .link, .seg button, .stat span { font-family: var(--round); }
.small { font-weight: 600; letter-spacing: .01em; }
.hand { font-family: var(--hand); font-weight: 700; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.app { position: relative; max-width: 430px; height: 100%; margin: 0 auto; background: var(--ground); display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 500px) { body { padding: 20px 0; } .app { height: calc(100% - 0px); border-radius: 32px; box-shadow: 0 20px 60px rgba(68, 41, 184, .18); } }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.pad { padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.hero { position: relative; overflow: hidden; background: var(--violet); color: #fff; padding: 18px 20px 22px; border-radius: 0 0 30px 30px; display: flex; flex-direction: column; gap: 12px; }
.hero.sun { background: var(--sun); color: var(--ink); }
.hero.coral { background: var(--coral); color: var(--ink); }
.hero .blob { position: absolute; border-radius: 50%; pointer-events: none; }
.hero > *:not(.blob) { position: relative; }
.hero h1 { font-size: 31px; font-weight: 800; line-height: 1.05; }
.hero p { margin: 0; font-size: 14px; line-height: 1.45; opacity: .92; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.iconbtn { width: 44px; height: 44px; border: none; background: transparent; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; color: inherit; flex: none; }
.iconbtn:hover { background: rgba(255,255,255,.18); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 6px 11px; border-radius: 999px; background: var(--sun); color: #3A2A00; align-self: flex-start; }
.pill.soft { background: var(--violet-soft); color: var(--violet-deep); }
.pill.mint { background: var(--mint); color: #0E4A35; }
.pill.grey { background: #E6E9EE; color: #3A4452; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.chip { flex: none; height: 40px; padding: 0 14px; border: 1.5px solid #D3D9E0; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 700; }
.btn { height: 52px; border: none; border-radius: 16px; padding: 0 18px; font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-deep); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.sun { background: var(--sun); color: #3A2A00; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--ink); }
.btn.soft { background: var(--violet-soft); color: var(--violet-deep); }
.btn.small { height: 44px; font-size: 14px; border-radius: 12px; padding: 0 14px; }
.btn[disabled] { background: #E6E9EE; color: #4A5462; cursor: not-allowed; }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; }
.row > .btn { flex: 1; }
.card { background: var(--card); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.tap { border: none; text-align: left; width: 100%; color: inherit; }
.card.tap:hover { box-shadow: 0 6px 20px rgba(68,41,184,.12); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.section-title h2 { font-size: 19px; }
.link { background: none; border: none; color: var(--violet-deep); font-weight: 800; font-size: 13px; padding: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bar { height: 3px; border-radius: 2px; background: rgba(27, 36, 48, .07); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 2px; background: var(--violet); opacity: .55; }
.avatar { flex: none; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--violet); }
.person { display: flex; align-items: center; gap: 12px; }
.person .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person .who b { font-size: 15px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 8px 20px 10px; scrollbar-width: none; }
.pcard { flex: none; width: 168px; background: var(--card); border-radius: 22px; padding: 16px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pcard b { font-size: 15px; }
.story p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }
.story p:last-child { margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label { font-family: var(--display); font-size: 16px; font-weight: 600; }
.input, textarea, select { width: 100%; border: 2px solid #D9D2FF; border-radius: 14px; padding: 12px 14px; background: var(--card); font-size: 15px; }
textarea { min-height: 200px; resize: vertical; line-height: 1.55; border-radius: 20px; }
.input:focus, textarea:focus, select:focus { outline: none; border-color: var(--violet); }
.note { background: var(--sun-soft); color: #3A2A00; border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.nav { flex: none; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); }
.nav button { letter-spacing: -.01em; font-size: 10.5px !important; height: 54px; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; border-radius: 14px; }
.nav button[aria-current="page"] { color: var(--violet); font-weight: 800; }
.nav button[aria-current="page"]::before { content: ""; position: absolute; top: 2px; width: 28px; height: 4px; border-radius: 2px; background: var(--violet); }
.dot { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #2A1206; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.seg { display: flex; background: var(--violet-deep); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 42px; border: none; border-radius: 10px; background: transparent; color: #fff; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--violet-deep); font-weight: 800; }
.bubble-row { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.bubble-row.me { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.me .bubble { background: var(--violet); color: #fff; border-radius: 18px 18px 6px 18px; }
.chatbar { flex: none; background: var(--card); border-top: 1px solid var(--line); padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.chatbar .input { border-radius: 24px; height: 48px; }
.send { width: 48px; height: 48px; border: none; border-radius: 24px; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.banner { flex: none; background: var(--sun-soft); color: #3A2A00; padding: 10px 16px; font-size: 12px; line-height: 1.4; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .art { width: 84px; height: 84px; border-radius: 42px; background: var(--sun); display: flex; align-items: center; justify-content: center; color: #3A2A00; }
.overlay { position: absolute; inset: 0; background: rgba(27, 36, 48, .45); display: flex; align-items: flex-end; z-index: 20; }
.sheet { width: 100%; background: var(--card); border-radius: 30px 30px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 92%; overflow-y: auto; }
.sheet h2 { font-size: 26px; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 30; max-width: 88%; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: pop .25s ease-out; }
@keyframes pop { from { transform: translate(-50%, 10px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 3px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.typing { align-self: flex-start; background: var(--card); padding: 10px 14px; border-radius: 18px 18px 18px 6px; font-size: 13px; color: var(--muted); }
.tipcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tipcard h3 { font-size: 18px; line-height: 1.25; }
.photo-pick { position: relative; width: 112px; height: 112px; border-radius: 56px; border: 2.5px dashed #9B8BE8; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--violet); overflow: hidden; flex: none; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.statgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.convrow { display: flex; gap: 12px; align-items: center; background: var(--card); border: none; border-radius: 18px; padding: 12px 14px; width: 100%; text-align: left; }
.convrow .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.convrow .prev { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chathead { flex: none; background: var(--violet); color: #fff; padding: 10px 6px 14px; display: flex; align-items: center; gap: 8px; border-radius: 0 0 24px 24px; position: relative; z-index: 2; }
.chathead .iconbtn:hover { background: rgba(255,255,255,.16); }
.chatbg { background-color: var(--ground); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.05' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M20 24c0-5 7-7 9-2 2-5 9-3 9 2 0 6-9 11-9 11s-9-5-9-11z'/%3E%3Cpath d='M86 20l3 7 7 3-7 3-3 7-3-7-7-3 7-3z'/%3E%3Ccircle cx='30' cy='88' r='7'/%3E%3Cpath d='M80 84c4-6 14-6 18 0'/%3E%3Cpath d='M58 58l2 4 4 2-4 2-2 4-2-4-4-2 4-2z'/%3E%3C/g%3E%3C/svg%3E"); margin-top: -18px; padding-top: 30px !important; }
.bubble { box-shadow: 0 2px 8px rgba(27, 36, 48, .07); }
.daysep { align-self: center; font-family: var(--round); font-size: 12px; font-weight: 600; color: var(--muted); background: #fff; padding: 4px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.dots span { display: inline-block; width: 7px; height: 7px; border-radius: 4px; background: var(--muted); margin: 0 2px; animation: dot 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .2s; } .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.panel-tabs { display: flex; gap: 6px; }
.panel-tabs button { flex: 1; height: 38px; border: none; border-radius: 12px; background: var(--ground); font-family: var(--round); font-weight: 700; color: var(--muted); }
.panel-tabs button[aria-pressed="true"] { background: var(--violet); color: #fff; }
.gif { position: relative; width: 200px; height: 130px; border-radius: 20px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.gif .cap { position: absolute; left: 10px; bottom: 8px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.gif .tag { position: absolute; right: 8px; top: 8px; font-family: var(--round); font-size: 10px; font-weight: 800; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 2px 5px; }
.g-beat { animation: beat 1s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.18); } 60% { transform: scale(.96); } }
.g-steam { animation: steam 2s ease-in-out infinite; opacity: 0; }
@keyframes steam { 0% { transform: translateY(8px); opacity: 0; } 40% { opacity: .9; } 100% { transform: translateY(-14px); opacity: 0; } }
.g-float { animation: floatz 2.4s ease-in-out infinite; opacity: 0; }
@keyframes floatz { 0% { transform: translate(0, 10px) scale(.7); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(14px, -26px) scale(1.1); opacity: 0; } }
.g-spin { animation: spin 6s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-pop { animation: pop2 1.4s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pop2 { 0% { transform: scale(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.g-hugl { animation: hugl 1.6s ease-in-out infinite; } .g-hugr { animation: hugr 1.6s ease-in-out infinite; }
@keyframes hugl { 0%, 100% { transform: translateX(-14px); } 50% { transform: translateX(4px); } }
@keyframes hugr { 0%, 100% { transform: translateX(14px); } 50% { transform: translateX(-4px); } }
.g-rise { animation: rise 3s ease-in-out infinite alternate; }
@keyframes rise { from { transform: translateY(22px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .g-beat, .g-steam, .g-float, .g-spin, .g-pop, .g-hugl, .g-hugr, .g-rise, .dots span { animation: none; opacity: 1; } }
.trybtn { border: none; background: var(--sun); color: #4A1F0A; border-radius: 999px; padding: 9px 15px; font-family: var(--round); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.msgline { display: flex; gap: 8px; align-items: flex-end; }
.msgline.me { justify-content: flex-end; }
.msgline .bubble-row { max-width: 78%; }
.msgline.pop { animation: msgin .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes msgin { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.bubble { cursor: pointer; user-select: none; -webkit-user-select: none; }
.rbadge { position: absolute; bottom: -14px; background: #fff; border-radius: 12px; padding: 1px 7px; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.16); }
.burst { position: absolute; left: 50%; top: 50%; font-size: 44px; transform: translate(-50%, -50%); animation: burst .8s ease-out forwards; pointer-events: none; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 40% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; } 100% { transform: translate(-50%, -110%) scale(1); opacity: 0; } }
.quote { border-radius: 10px; padding: 6px 9px; margin-bottom: 6px; font-size: 13px; background: rgba(0,0,0,.06); border-left: 3px solid currentColor; opacity: .85; }
.me .quote { background: rgba(255,255,255,.18); }
@media (prefers-reduced-motion: reduce) { .msgline.pop, .burst { animation: none; } }
@media (prefers-reduced-motion: reduce) { .toast, .confetti i { animation: none; } .confetti { display: none; } }

.loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-family: var(--round); font-weight: 700; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--violet-soft); border-top-color: var(--violet); animation: spin .9s linear infinite; }
.err { background: #FFE1D9; color: #7A1F05; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.beta { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; font-family: var(--round); font-weight: 700; font-size: 10px; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; opacity: .75; pointer-events: none; }
.hero select, .hero .input { color: var(--ink); }
