/* PÉPITES — design system */
:root {
  --serif: 'Fraunces', 'Noto Serif', Georgia, serif;
  --sans: 'Inter', Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gold: #E8B44C; --gold2: #D4901C;
  --r: 20px; --r-s: 14px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --fs: 1;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root, [data-theme="dark"] {
  --bg: #0D0E13; --bg2: #12141B; --card: #181A22; --card2: #1F222C; --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.14);
  --tx: #F3F1EC; --tx2: #C9C8CF; --mut: #8E909C; --shadow: 0 10px 30px rgba(0,0,0,.35); --glass: rgba(18,20,27,.78);
  --hm0: #1D2029;
}
[data-theme="light"] {
  --bg: #F7F4EE; --bg2: #EFEBE3; --card: #FFFFFF; --card2: #F6F3ED; --line: rgba(20,20,30,.08); --line2: rgba(20,20,30,.14);
  --tx: #1A1B21; --tx2: #3D3F48; --mut: #6E707B; --shadow: 0 8px 24px rgba(40,30,10,.08); --glass: rgba(247,244,238,.82);
  --hm0: #E6E1D7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 400 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; min-height: 100svh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#app { max-width: 600px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
body.in-reader #app { padding: 0; max-width: none; }
.view { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Utilitaires ---------- */
.row { display: flex; align-items: center; } .gap { gap: 10px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .center { text-align: center; justify-content: center; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 14px; } .full { width: 100%; }
.muted { color: var(--mut); } .small { font-size: 13px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { display: block; height: 6px; border-radius: 6px; background: var(--line2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFE29A, var(--gold2)); transition: width .6s var(--ease); }
.bar.big { height: 10px; margin: 10px 0 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 15px; transition: transform .15s, background .2s; }
.btn:active { transform: scale(.97); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(135deg, #F6CF7A, var(--gold2)); color: #20160A; box-shadow: 0 6px 20px rgba(232,180,76,.25); }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); }
.btn.danger { background: #C2413A; color: #fff; }
.btn.danger.ghost { background: transparent; color: #E5675F; border-color: rgba(229,103,95,.35); }
.btn.light { background: rgba(255,255,255,.95); color: #15161B; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--card2); border: 1px solid var(--line); transition: transform .15s, background .2s, color .2s; flex: none; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.light { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(6px); }
.icon-btn.light.on { background: #fff; color: #15161B; }
.pop { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } }
.back { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--card2); flex: none; }
.back.light { background: rgba(0,0,0,.2); color: #fff; position: absolute; top: 14px; left: 14px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; color: var(--tx2); transition: background .2s, color .2s; }
.chip.small { height: 30px; font-size: 13px; padding: 0 12px; }
.chip.on { background: var(--tx); color: var(--bg); border-color: transparent; }
.chips { display: flex; gap: 8px; margin: 12px 0; }
.chips.scroll { overflow-x: auto; margin: 14px -16px 4px; padding: 0 16px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; }
.chip-cat { font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cc) 22%, transparent); color: var(--cc); }
.chip-cat.light { background: rgba(255,255,255,.2); color: #fff; }

.meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--mut); margin-top: 8px; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ic { width: 14px; height: 14px; }
.meta.light { color: rgba(255,255,255,.8); }
.fav-dot { color: #F0679A; } .fav-dot .ic { fill: currentColor; }
.read-mark { color: #3DD9A4; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.sec-head h2 { font: 600 20px/1.2 var(--serif); }
.sec-head a { font-size: 13.5px; color: var(--gold); font-weight: 600; }
.stack { display: grid; gap: 10px; }
.page-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; flex-wrap: wrap; }
.page-head h1 { font: 600 30px/1.1 var(--serif); }
.page-head h1.grow { font-size: 24px; }
.page-head > p { flex-basis: 100%; }
.page-head .icon-btn { margin-left: auto; }
.mini-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--mut); margin: 18px 0 10px; font-weight: 600; }

/* ---------- Cartes ---------- */
.card { display: block; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); transition: transform .2s var(--ease), border-color .2s; position: relative; overflow: hidden; }
.card:active { transform: scale(.985); }
.row-card { display: flex; gap: 14px; padding: 14px; }
.rc-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--c2) 35%, transparent); }
.rc-icon .ic { width: 22px; height: 22px; }
.rc-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--cc); font-weight: 600; }
.rc-title { font: 600 16.5px/1.3 var(--serif); margin-top: 3px; }
.rc-lead { font-size: 13.5px; color: var(--mut); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-card.is-read .rc-title { color: var(--tx2); }

.h-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.tile-card { flex: none; width: 74%; max-width: 280px; scroll-snap-align: start; }
.tile-art { height: 120px; background: radial-gradient(circle at 80% 10%, var(--c1), var(--c2)); position: relative; display: flex; align-items: flex-end; padding: 12px; }
.tile-art .chip-cat { background: rgba(0,0,0,.25); color: #fff; backdrop-filter: blur(4px); }
.tile-ic { position: absolute; right: -10px; top: -8px; width: 120px; height: 120px; color: rgba(255,255,255,.2); stroke-width: 1.2; }
.tile-body { padding: 12px 14px 14px; }
.tile-title { font: 600 16px/1.3 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em; }

/* ---------- Aujourd'hui ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; margin: 10px 0 18px; }
.hello .date { color: var(--mut); font-size: 13px; text-transform: capitalize; }
.hello h1 { font: 600 30px/1.1 var(--serif); margin-top: 2px; }
.streak { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--mut); font-weight: 700; }
.streak.lit { color: #FF9F43; background: rgba(255,159,67,.12); border-color: rgba(255,159,67,.3); }
.streak.lit .ic { fill: currentColor; fill-opacity: .25; }

.hero { position: relative; border-radius: 28px; padding: 20px; color: #fff; overflow: hidden; min-height: 330px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 100% 0%, var(--c1) 0%, var(--c2) 55%, #121319 120%); box-shadow: 0 18px 40px color-mix(in srgb, var(--c2) 35%, transparent); transition: opacity .22s, transform .22s; }
.hero.swap { opacity: 0; transform: scale(.97) translateY(6px); }
.hero-art { position: absolute; inset: 0; pointer-events: none; }
.hero-ic { position: absolute; right: -30px; top: -20px; width: 220px; height: 220px; color: rgba(255,255,255,.16); stroke-width: 1; animation: float 9s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(10px) rotate(4deg); } }
.orb { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .55; }
.o1 { width: 180px; height: 180px; background: rgba(255,255,255,.25); left: -60px; bottom: -70px; }
.o2 { width: 120px; height: 120px; background: rgba(0,0,0,.25); right: 30%; top: 40%; }
.hero-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; opacity: .9; }
.eyebrow .ic { width: 16px; height: 16px; }
.hero-text { position: relative; margin-top: auto; padding-top: 40px; }
.hero-text h2 { font: 600 27px/1.18 var(--serif); text-wrap: balance; }
.hero-text p { margin-top: 10px; font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.88); }
.hero-actions { position: relative; display: flex; gap: 8px; margin-top: 18px; }
.hero-actions .btn { flex: 1; height: 44px; }

.stat-strip { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 8px; margin-top: 14px; }
.ss { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; display: flex; flex-direction: column; justify-content: center; min-height: 68px; }
.ss b { font-size: 17px; line-height: 1.2; }
.ss span { font-size: 12px; color: var(--mut); }
.ring-wrap { flex-direction: row; align-items: center; gap: 8px; }
.ring-wrap div { display: flex; flex-direction: column; min-width: 0; }
.ring { flex: none; } .ring-bg { fill: none; stroke: var(--line2); } .ring-fg { fill: none; stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }

.banner { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; margin-top: 14px; padding: 14px; border-radius: var(--r-s); background: color-mix(in srgb, var(--gold) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.banner .ic { color: var(--gold); width: 24px; height: 24px; }
.banner b { display: block; } .banner span { font-size: 13px; color: var(--mut); }
.banner.warn { background: color-mix(in srgb, #4FB3FF 10%, var(--card)); border-color: color-mix(in srgb, #4FB3FF 30%, transparent); }
.banner.warn .ic { color: #4FB3FF; }

.continue { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.continue::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(var(--c1, var(--gold)), var(--c2, var(--gold2))); }
.continue > .ic:first-child { color: var(--cc, var(--gold)); }
.continue div { flex: 1; min-width: 0; }
.continue small { display: block; font-size: 12px; color: var(--mut); }
.continue b { display: block; font: 600 15.5px/1.3 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta-feed { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 18px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 20%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.cta-feed .ic:first-child { color: var(--gold); width: 28px; height: 28px; }
.cta-feed div { flex: 1; } .cta-feed b { display: block; font: 600 17px var(--serif); } .cta-feed span { font-size: 13px; color: var(--mut); }
.link-more { display: block; text-align: center; margin-top: 18px; color: var(--mut); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Explorer ---------- */
.search-fake, .search-box { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--mut); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.cat-tile { position: relative; overflow: hidden; border-radius: var(--r); padding: 14px; min-height: 104px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  background: radial-gradient(130% 120% at 100% 0%, var(--c1), var(--c2)); transition: transform .2s; }
.cat-tile:active { transform: scale(.97); }
.ct-ic { position: absolute; right: -8px; top: -8px; width: 76px; height: 76px; color: rgba(255,255,255,.28); stroke-width: 1.4; }
.cat-tile b { font-size: 15.5px; line-height: 1.2; } .cat-tile span { font-size: 12px; opacity: .85; }
.ct-bar { display: block; height: 4px; background: rgba(255,255,255,.25); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.ct-bar > i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.ct-bar.big { height: 6px; margin-top: 14px; }

.cat-hero { position: relative; margin: -12px -16px 4px; padding: calc(var(--safe-t) + 64px) 20px 24px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 100% at 100% 0%, var(--c1), var(--c2) 60%, color-mix(in srgb, var(--c2) 60%, #000)); border-radius: 0 0 30px 30px; }
.cat-hero-ic { position: absolute; right: -20px; top: 10px; width: 170px; height: 170px; color: rgba(255,255,255,.18); stroke-width: 1.1; }
.cat-hero h1 { font: 600 28px/1.15 var(--serif); position: relative; max-width: 85%; }
.cat-hero p { color: rgba(255,255,255,.85); margin-top: 6px; position: relative; }
.cat-hero .btn { position: relative; }

.par-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.par-tile { flex: none; width: 62%; max-width: 230px; scroll-snap-align: start; padding: 14px; display: flex; flex-direction: column; min-height: 150px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c1) 22%, var(--card)), var(--card)); }
.par-grid .par-tile { width: auto; max-width: none; }
.pt-top { display: flex; justify-content: space-between; color: var(--cc); }
.pt-ic { width: 26px; height: 26px; }
.done-badge { width: 24px; height: 24px; border-radius: 50%; background: #3DD9A4; color: #08261C; display: grid; place-items: center; } .done-badge .ic { width: 14px; height: 14px; stroke-width: 3; }
.par-tile b { font: 600 15px/1.3 var(--serif); margin-top: auto; padding-top: 18px; }
.par-tile > span { font-size: 12px; color: var(--mut); margin-top: 4px; }
.par-tile .ct-bar { background: var(--line2); } .par-tile .ct-bar > i { background: var(--cc); }

.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 2px; position: relative; }
.steps li a { display: flex; gap: 14px; align-items: center; padding: 12px 4px; }
.step-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); border: 1px solid var(--line2); font-weight: 700; font-size: 14px; flex: none; }
.steps li.done .step-n { background: #3DD9A4; color: #08261C; border-color: transparent; } .steps li.done .step-n .ic { width: 16px; height: 16px; stroke-width: 3; }
.steps li.current .step-n { background: var(--gold); color: #20160A; border-color: transparent; box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 25%, transparent); }
.steps b { display: block; font: 600 15.5px/1.3 var(--serif); } .steps small { color: var(--mut); font-size: 12.5px; }
.steps li.done b { color: var(--tx2); }

/* ---------- Recherche ---------- */
.search-head { display: flex; gap: 10px; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; margin-top: -8px; }
.search-box { flex: 1; }
.search-box input { flex: 1; background: none; border: 0; outline: 0; color: var(--tx); font: inherit; font-size: 16px; min-width: 0; }
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 6px -16px 14px; padding: 0 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.select { height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--tx2); padding: 0 12px; font: inherit; font-size: 13.5px; flex: none; }
.res-count { margin-bottom: 10px; }
.hit-note { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--gold); } .hit-note .ic { width: 14px; height: 14px; }

/* ---------- Lecteur ---------- */
.reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); animation: none; z-index: 10; }
.r-top { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 8px; background: var(--glass); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: transform .3s var(--ease), opacity .3s; z-index: 2; }
.r-top .icon-btn { width: 40px; height: 40px; background: transparent; border: 0; }
.r-prog { flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; min-width: 0; }
.r-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-count { font-size: 12.5px; color: var(--mut); }
.r-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line2); overflow: hidden; display: block; }
.r-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #FFE29A, var(--gold2)); transition: width .4s var(--ease); }
.feed { flex: 1; overflow-y: auto; scroll-snap-type: y proximity; overscroll-behavior: contain; padding: 14px 0 calc(90px + var(--safe-b)); }
.pcard { scroll-snap-align: start; scroll-margin-top: 8px; min-height: 70svh; max-width: 640px; margin: 0 auto 18px; padding: 0 14px; }
.pcard:not([data-filled]) { min-height: 90svh; }
.pc-band { height: 118px; border-radius: 24px 24px 0 0; position: relative; overflow: hidden; background: radial-gradient(140% 140% at 100% 0%, var(--c1), var(--c2)); }
.pc-band-ic { position: absolute; right: 8px; top: -16px; width: 150px; height: 150px; color: rgba(255,255,255,.22); stroke-width: 1; }
.pc-body { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 24px 24px; padding: 20px 20px 26px; margin-top: -1px; }
.pc-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.pc-title { font: 600 calc(27px * var(--fs))/1.18 var(--serif); margin-top: 8px; text-wrap: balance; }
.pc-lead { font: 500 calc(17.5px * var(--fs))/1.5 var(--serif); color: var(--tx2); margin-top: 12px; font-style: italic; }
.pc-text { margin-top: 16px; font-size: calc(16.5px * var(--fs)); line-height: 1.7; color: var(--tx); }
.pc-text p + p { margin-top: 14px; }
.box { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-s); background: color-mix(in srgb, var(--cc, var(--gold)) 9%, var(--card2)); border-left: 3px solid var(--cc, var(--gold)); font-size: calc(15.5px * var(--fs)); line-height: 1.6; }
.box p + p { margin-top: 8px; }
.box-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--cc, var(--gold)); margin-bottom: 6px; }
.box-h .ic { width: 15px; height: 15px; }
.box.qu { --cc: var(--gold); background: transparent; border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); }
.box .q { font: 500 calc(16.5px * var(--fs))/1.5 var(--serif); font-style: italic; }
.source { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: 13.5px; color: var(--mut); }
.source .ic { width: 16px; height: 16px; margin-top: 2px; }
.tags { margin: 14px 0 0; }
.pc-notes { display: flex; gap: 6px; align-items: center; margin-top: 12px; color: var(--gold); font-size: 13px; } .pc-notes .ic { width: 16px; height: 16px; }
.pc-end { height: 1px; }
.feed-end { text-align: center; padding: 50px 24px 30px; color: var(--mut); }
.feed-end h3 { color: var(--tx); font: 600 22px var(--serif); margin: 10px 0 6px; }
.feed-end .row { margin-top: 18px; }
.r-actions { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); display: flex; gap: 2px; padding: 6px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line2); box-shadow: var(--shadow); transition: transform .3s var(--ease), opacity .3s; z-index: 3; }
.r-actions button { width: 64px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 16px; color: var(--tx2); font-size: 10.5px; font-weight: 600; transition: background .2s, color .2s; }
.r-actions button:active { background: var(--line); }
.r-actions button.on { color: var(--gold); }
.r-actions button.fav { color: #F0679A; } .r-actions button.fav .ic, .r-actions button.on[data-a="save"] .ic { fill: currentColor; fill-opacity: .9; }
.r-actions span { white-space: nowrap; }
body.focus .r-top { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.focus .r-actions { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.focus-exit { position: fixed; top: calc(var(--safe-t) + 12px); right: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--glass); border: 1px solid var(--line2); display: none; place-items: center; z-index: 4; }
body.focus .focus-exit.show { display: grid; }
.heart-burst { position: fixed; z-index: 50; color: #F0679A; pointer-events: none; transform: translate(-50%, -50%); animation: burst .9s var(--ease) forwards; }
.heart-burst .ic { width: 90px; height: 90px; fill: currentColor; stroke: none; filter: drop-shadow(0 6px 20px rgba(240,103,154,.5)); }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -90%) scale(1); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: translateX(40px) rotate(720deg); } }

/* ---------- Collection ---------- */
.seg { display: flex; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 18px; }
.seg > * { flex: 1; text-align: center; padding: 9px 4px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--mut); transition: background .2s, color .2s; }
.seg > .on { background: var(--tx); color: var(--bg); }
.seg.small { margin: 6px 0 14px; }
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.col-card { display: flex; flex-direction: column; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-align: left; min-height: 170px; }
.col-card b { font: 600 15.5px/1.25 var(--serif); margin-top: 10px; } .col-card > span { font-size: 12px; color: var(--mut); }
.col-stack { position: relative; height: 96px; }
.col-stack i { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(135deg, var(--c1), var(--c2)); transform: translate(calc(var(--i) * 6px), calc(var(--i) * -5px)) scale(calc(1 - var(--i) * .06)); opacity: calc(1 - var(--i) * .3); z-index: calc(3 - var(--i)); }
.col-stack i.none { background: var(--card2); border: 1px dashed var(--line2); }
.col-emoji { position: absolute; left: 10px; bottom: 8px; font-size: 26px; z-index: 5; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.col-card.add { align-items: center; justify-content: center; border-style: dashed; color: var(--mut); }
.col-card.add .ic { width: 30px; height: 30px; } .col-card.add b { font-family: var(--sans); font-size: 14px; }
.note-card { display: block; padding: 14px 16px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); }
.note-card small { font-weight: 700; font-size: 12.5px; } .note-card p { margin: 6px 0; font: 500 15px/1.5 var(--serif); font-style: italic; }
.swipe-row { position: relative; }
.swipe-row .rm { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); color: var(--mut); z-index: 2; }
.swipe-row .rm .ic { width: 16px; height: 16px; }
.swipe-row .row-card { padding-right: 46px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 12px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 12px; font-size: 22px; background: var(--card2); border: 2px solid transparent; }
.emoji-grid button.on { border-color: var(--gold); }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--tx2); }
.form label small { font-weight: 400; color: var(--mut); }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-s); border: 1px solid var(--line2); background: var(--card); color: var(--tx); font: inherit; font-size: 16px; outline: 0; transition: border-color .2s; resize: vertical; }
.input:focus { border-color: var(--gold); }
textarea.input { line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.col-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.col-pick legend { font-size: 13.5px; font-weight: 600; color: var(--tx2); margin-bottom: 8px; padding: 0; }
.chip-check input { display: none; }
.chip-check span { display: inline-flex; height: 36px; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line2); font-weight: 500; }
.chip-check input:checked + span { background: color-mix(in srgb, var(--gold) 18%, var(--card)); border-color: var(--gold); color: var(--tx); }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.file-btn { cursor: pointer; }

/* ---------- Profil ---------- */
.level-card { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 22%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.lv-badge { width: 64px; height: 64px; flex: none; display: grid; place-items: center; clip-path: polygon(25% 0, 75% 0, 100% 40%, 50% 100%, 0 40%); background: linear-gradient(135deg, #FFE29A, var(--gold2)); }
.lv-badge span { font: 700 24px var(--serif); color: #20160A; margin-top: -6px; }
.level-card small { display: block; font-size: 12px; color: var(--mut); } .level-card b { font: 600 22px var(--serif); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; }
.kpis b { display: block; font: 600 21px/1.2 var(--serif); } .kpis span { font-size: 12px; color: var(--mut); display: inline-flex; gap: 3px; align-items: center; } .kpis .ic { width: 13px; height: 13px; color: #FF9F43; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.weeks { display: flex; gap: 8px; align-items: flex-end; height: 130px; margin-top: 14px; position: relative; }
.wk { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.wk i { display: block; width: 100%; max-width: 28px; min-height: 4px; max-height: 78%; border-radius: 8px 8px 4px 4px; background: var(--line2); transition: height .6s var(--ease); }
.wk i.hit { background: color-mix(in srgb, var(--gold) 55%, var(--card2)); } .wk i.now { background: linear-gradient(#FFE29A, var(--gold2)); }
.wk span { font-size: 10.5px; color: var(--mut); }
.goal-line { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--gold) 60%, transparent); }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; }
.hm { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--hm0); }
.hm.l1 { background: color-mix(in srgb, var(--gold) 30%, var(--hm0)); } .hm.l2 { background: color-mix(in srgb, var(--gold) 55%, var(--hm0)); }
.hm.l3 { background: color-mix(in srgb, var(--gold) 80%, var(--hm0)); } .hm.l4 { background: #FFD670; } .hm.fut { opacity: .3; }
.heat-legend { display: flex; gap: 4px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: var(--mut); }
.heat-legend .hm { width: 12px; }
.cbar { display: grid; grid-template-columns: 112px 1fr 46px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13px; }
.cb-l { display: flex; gap: 6px; align-items: center; color: var(--tx2); white-space: nowrap; overflow: hidden; } .cb-l .ic { width: 16px; height: 16px; color: var(--mut); }
.cb-t { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; } .cb-t i { display: block; height: 100%; border-radius: inherit; min-width: 3px; }
.cb-n { text-align: right; font-weight: 700; } .cb-n small { color: var(--mut); font-weight: 400; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { padding: 12px 10px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.b-ic { font-size: 28px; filter: grayscale(1); opacity: .35; margin-bottom: 4px; }
.badge.got { border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--card)), var(--card)); }
.badge.got .b-ic { filter: none; opacity: 1; animation: pop .6s var(--ease); }
.badge b { font-size: 12.5px; line-height: 1.25; } .badge small { font-size: 11px; color: var(--mut); line-height: 1.3; }
.badge .bar { width: 100%; height: 4px; } .b-date { color: var(--gold) !important; }

/* ---------- Réglages ---------- */
.settings .panel + .sec-head { margin-top: 26px; }
.settings .panel .btn { width: 100%; }
.info { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--tx2); margin-bottom: 12px; }
.info .ic { color: #3DD9A4; width: 22px; height: 22px; margin-top: 2px; }

/* ---------- Vide ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--mut); }
.empty-ic { width: 44px; height: 44px; color: var(--gold); stroke-width: 1.4; }
.empty h3 { font: 600 19px var(--serif); color: var(--tx); margin: 10px 0 6px; }
.empty .btn { margin-top: 16px; }

/* ---------- Navigation ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px 6px calc(6px + var(--safe-b)); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav a { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 10.5px; font-weight: 600; color: var(--mut); position: relative; transition: color .2s; }
.nav a .ic { width: 23px; height: 23px; transition: transform .25s var(--ease); }
.nav a.on { color: var(--tx); }
.nav a.on .ic { transform: translateY(-1px); color: var(--gold); }
.nav a.on::before { content: ''; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
body.in-reader .nav, body.in-reader .fab { display: none; }
.fab { position: fixed; right: max(18px, calc(50% - 282px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); width: 56px; height: 56px; border-radius: 18px; z-index: 19; display: grid; place-items: center;
  background: linear-gradient(135deg, #F6CF7A, var(--gold2)); color: #20160A; box-shadow: 0 10px 26px rgba(232,180,76,.35); transition: transform .2s; }
.fab:active { transform: scale(.92); } .fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }
.fab[hidden] { display: none; }

/* ---------- Feuilles ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .28s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto; max-height: 82svh; overflow-y: auto; background: var(--bg2); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  transform: translateY(100%); transition: transform .32s var(--ease); border: 1px solid var(--line); border-bottom: 0; }
.sheet.tall { min-height: 60svh; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; } .sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line2); margin: 0 auto 14px; }
.sheet-title { font: 600 21px var(--serif); margin-bottom: 8px; }
.list { display: grid; gap: 6px; margin-top: 8px; }
.list-btn { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); min-height: 56px; }
.list-btn small { display: block; color: var(--mut); font-size: 12px; }
.list-btn .emoji { font-size: 22px; }
.list-btn .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line2); display: grid; place-items: center; color: transparent; transition: all .2s; }
.list-btn .tick .ic { width: 15px; height: 15px; stroke-width: 3; }
.list-btn.on .tick { background: var(--gold); border-color: var(--gold); color: #20160A; }
.list-btn.danger { color: #E5675F; }
.stars { display: flex; gap: 4px; margin: 12px 0; }
.star { color: var(--line2); } .star .ic { width: 30px; height: 30px; } .star.on { color: var(--gold); } .star.on .ic { fill: currentColor; }
.notes { display: grid; gap: 8px; }
.note { padding: 12px 14px; border-radius: var(--r-s); background: var(--card); border: 1px solid var(--line); }
.note p { font: 500 15px/1.5 var(--serif); }
.note-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--mut); }
.note-meta .ic { width: 16px; height: 16px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 70; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 16px; background: #23252F; color: #F3F1EC; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.35); transition: all .3s var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.badge { background: linear-gradient(135deg, #3A2E12, #23252F); border: 1px solid rgba(232,180,76,.5); }
.toast button { color: var(--gold); font-weight: 700; white-space: nowrap; }
body.in-reader .toast { bottom: calc(86px + var(--safe-b)); }

/* ---------- Écran de lancement ---------- */
#splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: #0D0E13; transition: opacity .5s; }
[data-theme="light"] #splash { background: #F7F4EE; }
#splash.out { opacity: 0; pointer-events: none; }
.splash-gem { width: 76px; height: 76px; animation: gem 1.6s var(--ease) infinite alternate; filter: drop-shadow(0 10px 30px rgba(232,180,76,.45)); }
@keyframes gem { from { transform: translateY(4px) rotate(-4deg); } to { transform: translateY(-4px) rotate(4deg); } }
.splash-name { font: 700 18px var(--sans); letter-spacing: .32em; color: var(--tx); padding-left: .32em; }

/* ---------- Transitions de page ---------- */
::view-transition-old(root) { animation: .18s ease both vtOut; }
::view-transition-new(root) { animation: .28s var(--ease) both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }
[data-dir="back"]::view-transition-new(root) { animation-name: vtInBack; }
@keyframes vtInBack { from { opacity: 0; transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (min-width: 520px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } .badges { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 360px) { .r-actions button { width: 56px; } .stat-strip { grid-template-columns: 1fr 1fr; } .stat-strip .ss:last-child { grid-column: 1 / -1; } }
