/* Famille Jacob — direction : « minuit & agrumes ».
   Fond clair et net, une carte nuit avec des lueurs mandarine et soleil pour le compte à rebours,
   typo large (Unbounded) réservée aux chiffres et aux titres, corps en Plus Jakarta Sans. */
:root {
  --bg: #F2F3F7;
  --card: #FFFFFF;
  --card-2: #E9EAF1;
  --ink: #12121F;
  --muted: #6B6E80;
  --line: #E2E3EB;
  --night: #15142A;
  --night-ink: #F6F5FF;
  --tang: #FF7A1A;
  --sun: #FFC83D;
  --mint: #1FBF8A;
  --sky: #4C8DFF;
  --rose: #FF4F7B;
  --danger: #E5383B;
  --glass: rgba(255, 255, 255, .78);
  --shadow-sm: 0 1px 2px rgba(18, 18, 31, .05), 0 2px 8px rgba(18, 18, 31, .05);
  --shadow: 0 2px 6px rgba(18, 18, 31, .05), 0 14px 34px rgba(18, 18, 31, .09);
  --f-display: "Unbounded", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --r: 22px;
  --gutter: max(18px, env(safe-area-inset-left, 0px));
  --gutter-r: max(18px, env(safe-area-inset-right, 0px));
  --tabbar-h: 74px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0A12; --card: #15151F; --card-2: #1E1E2C; --ink: #F2F2F7; --muted: #9A9CAE; --line: #26263A;
    --night: #1B1A35; --glass: rgba(21, 21, 31, .78);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 6px rgba(0,0,0,.3), 0 16px 40px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--tang); outline-offset: 2px; border-radius: 12px; }
svg { display: block; }
.tab svg, .round svg, .tab-add svg, .ico {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
h1, h2, h3 { text-wrap: balance; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--tang); }

/* ------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 14px 20px; min-height: 52px;
  font-weight: 800; font-size: 16px; background: var(--ink); color: var(--bg);
  transition: transform .15s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.big { width: 100%; min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn.tang { background: linear-gradient(135deg, var(--tang), #FF9A3D); color: #1A0E02; }
.btn.soft { background: var(--card-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.danger.solid { background: var(--danger); color: #fff; box-shadow: none; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ico { width: 20px; height: 20px; }
.linkbtn { border: 0; background: none; color: var(--tang); font-weight: 700; font-size: 14px; padding: 8px 4px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: var(--ink); }
.round svg { width: 20px; height: 20px; stroke-width: 2.4; }

/* ------------------------------------------------ Connexion */
.login {
  position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--night); color: var(--night-ink);
  display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 24px) var(--gutter);
}
.aurora { position: absolute; inset: 0; filter: blur(60px); opacity: .85; }
.aurora i { position: absolute; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 70vmax; height: 70vmax; left: -25vmax; top: -30vmax; background: radial-gradient(circle, var(--tang), transparent 65%); }
.aurora i:nth-child(2) { width: 60vmax; height: 60vmax; right: -25vmax; bottom: -25vmax; background: radial-gradient(circle, var(--rose), transparent 65%); animation-delay: -6s; }
.aurora i:nth-child(3) { width: 40vmax; height: 40vmax; right: -5vmax; top: 10vmax; background: radial-gradient(circle, var(--sun), transparent 65%); opacity: .6; animation-delay: -11s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.12); } }
.login-inner { position: relative; width: 100%; max-width: 400px; }
.logo-mark {
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: 28px;
  background: url("/icons/icon-192.png") center / cover; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.login-eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
.login-title { margin: 0 0 34px; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 13vw, 64px); line-height: .95; letter-spacing: -.03em; }
.login-title span { background: linear-gradient(90deg, var(--sun), var(--tang) 60%, var(--rose)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-form { display: grid; gap: 12px; }
.login-label { font-size: 14px; font-weight: 700; opacity: .8; }
.login-input {
  width: 100%; min-height: 58px; border-radius: 18px; border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff; padding: 0 18px; font-size: 18px; font-weight: 600;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.login-input::placeholder { color: rgba(255,255,255,.45); font-weight: 500; font-size: 16px; }
.login-input:focus { outline: none; border-color: var(--sun); }
.login .btn { background: #fff; color: var(--night); margin-top: 6px; }
.login-err { margin: 0; color: #FFD0D6; font-weight: 700; font-size: 14px; }
.login-foot { margin: 22px 0 0; font-size: 13px; opacity: .6; }

/* ------------------------------------------------ Qui suis-je */
.whoami {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto; background: var(--bg);
  padding: calc(env(safe-area-inset-top, 0px) + 40px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 32px) var(--gutter);
}
.who-inner { max-width: 520px; margin: 0 auto; }
.who-title { margin: 8px 0 8px; font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 8vw, 40px); letter-spacing: -.02em; line-height: 1.05; }
.who-sub { margin: 0 0 26px; color: var(--muted); }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.who-card {
  border: 0; background: var(--card); border-radius: var(--r); padding: 18px 12px 16px; box-shadow: var(--shadow-sm);
  display: grid; justify-items: center; gap: 10px; font-weight: 800; font-size: 16px; transition: transform .15s;
}
.who-card:active { transform: scale(.96); }
.who-card.add { background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }

/* ------------------------------------------------ Structure appli */
.app { min-height: 100%; }
.views { max-width: 720px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 36px) var(--gutter); }
.view { animation: viewIn .35s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 18px; }
.hello { min-width: 0; }
.hello-date { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: capitalize; }
.hello-name { margin: 2px 0 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 7vw, 34px); letter-spacing: -.02em; line-height: 1.1; text-transform: capitalize; overflow-wrap: anywhere; }
.me-btn { border: 0; padding: 0; background: none; border-radius: 50%; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 12px; }
.section-h h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------ Avatars */
.av {
  --c: var(--tang);
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 13px; text-transform: uppercase; overflow: hidden;
  font-family: var(--f-body); letter-spacing: .02em;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xs { width: 22px; height: 22px; font-size: 9px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 56px; height: 56px; font-size: 20px; }
.av.xl { width: 84px; height: 84px; font-size: 30px; }
.av.ring { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); }
.stack { display: flex; align-items: center; }
.stack > .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.stack > .av:first-child { margin-left: 0; }
.stack .more { margin-left: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }

/* ------------------------------------------------ Carte J-x */
.hero {
  position: relative; overflow: hidden; isolation: isolate; width: 100%; text-align: left; border: 0;
  background: var(--night); color: var(--night-ink); border-radius: 28px; padding: 24px 22px 22px;
  box-shadow: 0 20px 50px rgba(21, 20, 42, .28); display: block;
}
.hero .glow { position: absolute; z-index: -1; border-radius: 50%; filter: blur(34px); }
.hero .glow.a { width: 240px; height: 240px; right: -70px; top: -90px; background: var(--tang); opacity: .75; animation: drift 14s ease-in-out infinite alternate; }
.hero .glow.b { width: 180px; height: 180px; right: 40px; bottom: -110px; background: var(--rose); opacity: .5; animation: drift 17s ease-in-out infinite alternate-reverse; }
.hero .glow.c { width: 120px; height: 120px; left: -40px; top: 40%; background: var(--sun); opacity: .25; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-tag .ico { width: 16px; height: 16px; }
.hero-j { font-family: var(--f-display); font-weight: 800; font-size: clamp(76px, 25vw, 128px); line-height: .82; letter-spacing: -.05em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #FFFFFF 10%, #FFE2C2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-j small { font-size: .32em; letter-spacing: -.02em; margin-left: .1em; }
.hero-title { margin: 14px 0 4px; font-family: var(--f-display); font-weight: 700; font-size: clamp(20px, 5.6vw, 26px); line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-when { margin: 0; font-weight: 600; opacity: .78; font-size: 15px; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.hero .stack > .av { box-shadow: 0 0 0 2px var(--night); }
.hero-cta { font-size: 13px; font-weight: 800; opacity: .7; }
.hero.empty .hero-title { font-size: 24px; margin-top: 4px; }

/* ------------------------------------------------ Ruban des jours */
.ribbon-wrap { margin-inline: calc(-1 * var(--gutter)) calc(-1 * var(--gutter-r)); }
.ribbon-wrap .section-h { padding-inline: var(--gutter) var(--gutter-r); }
.ribbon {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px var(--gutter-r) 10px var(--gutter); scroll-padding-inline: var(--gutter);
}
.ribbon::-webkit-scrollbar { display: none; }
.rday {
  flex: none; width: 62px; scroll-snap-align: start; border: 0; border-radius: 20px; padding: 12px 0 10px;
  background: var(--card); box-shadow: var(--shadow-sm); display: grid; justify-items: center; gap: 4px; transition: transform .15s, background .2s;
}
.rday:active { transform: scale(.95); }
.rday .dn { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rday .dd { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rday .dots { display: flex; gap: 3px; height: 6px; }
.rday .dots i { width: 6px; height: 6px; border-radius: 50%; }
.rday.today .dn { color: var(--tang); }
.rday[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.rday[aria-selected="true"] .dn { color: inherit; opacity: .7; }
.day-block { margin-top: 8px; }
.day-title { margin: 6px 0 10px; font-size: 15px; font-weight: 800; color: var(--muted); text-transform: capitalize; }

/* ------------------------------------------------ Liste d'événements */
.list { display: grid; gap: 10px; }
.group { margin-bottom: 20px; }
.group-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px 4px; }
.group-h b { font-weight: 800; font-size: 15px; text-transform: capitalize; }
.group-h .rel { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--tang); }
.ev {
  position: relative; width: 100%; border: 0; text-align: left; background: var(--card); border-radius: 20px;
  box-shadow: var(--shadow-sm); padding: 14px 14px 14px 12px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  transition: transform .15s ease;
}
.ev:active { transform: scale(.98); }
.tile { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; }
.tile .ico { width: 24px; height: 24px; stroke-width: 2.1; }
.ev-main { min-width: 0; }
.ev-title { display: block; font-weight: 800; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.ev-sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-time { font-variant-numeric: tabular-nums; }
.ev.holiday { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.ev.holiday .tile { background: var(--card-2) !important; color: var(--muted); }
.empty {
  background: var(--card); border-radius: var(--r); padding: 26px 22px; text-align: center; box-shadow: var(--shadow-sm);
  color: var(--muted); font-weight: 500;
}
.empty b { display: block; color: var(--ink); font-family: var(--f-display); font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.empty.slim { padding: 18px; }

/* ------------------------------------------------ Anniversaires */
.bday-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)) calc(-1 * var(--gutter-r)); padding: 4px var(--gutter-r) 10px var(--gutter); scroll-snap-type: x mandatory; }
.bday-row::-webkit-scrollbar { display: none; }
.bday {
  flex: none; width: 150px; scroll-snap-align: start; border: 0; text-align: left; border-radius: var(--r); padding: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--card)), var(--card) 70%); box-shadow: var(--shadow-sm);
  display: grid; gap: 10px;
}
.bday .bd-name { font-weight: 800; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.bday .bd-when { font-size: 13px; color: var(--muted); font-weight: 600; }
.bday .bd-age { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1; }
.bday .bd-age small { font-family: var(--f-body); font-size: 13px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------ Calendrier mensuel */
.cal-nav { display: flex; gap: 8px; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter-r)) 14px calc(-1 * var(--gutter)); padding: 2px var(--gutter-r) 4px var(--gutter); }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 6px 14px 6px 6px;
  background: var(--card); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 700; min-height: 40px;
}
.chip.noav { padding-left: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.month { padding: 14px 10px 10px; touch-action: pan-y; }
.dows { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mday {
  border: 0; background: transparent; border-radius: 14px; aspect-ratio: 1 / 1.08; min-width: 0; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding-top: 5px;
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); transition: background .15s;
}
.mday .n { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.mday.out { opacity: .3; }
.mday.we:not(.today) .n { color: var(--muted); }
.mday.today .n { background: var(--tang); color: #fff; }
.mday.hol .n { box-shadow: inset 0 0 0 1.5px var(--muted); }
.mday.sel { background: var(--card-2); }
.mday .dots { display: flex; gap: 3px; height: 6px; }
.mday .dots i { width: 6px; height: 6px; border-radius: 50%; }
.pill-today { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--tang); font-weight: 800; font-size: 14px; padding: 8px 12px; }
.month.slide-l { animation: slideL .3s ease; }
.month.slide-r { animation: slideR .3s ease; }
@keyframes slideL { from { opacity: .3; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: .3; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------ Famille */
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fam-card {
  position: relative; overflow: hidden; border: 0; text-align: left; border-radius: 24px; padding: 18px 16px 16px; min-height: 186px;
  background: var(--card); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
}
.fam-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 64px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); opacity: .9; }
.fam-card .av { position: relative; box-shadow: 0 0 0 4px var(--card); margin-top: 14px; }
.fam-card .fc-name { font-family: var(--f-display); font-weight: 700; font-size: 18px; line-height: 1.15; overflow-wrap: anywhere; }
.fam-card .fc-meta { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.fam-card .me-tag { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.9); color: #12121F; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; }
.fam-card.add { background: transparent; box-shadow: inset 0 0 0 2px var(--line); align-items: center; justify-content: center; color: var(--muted); font-weight: 800; text-align: center; }
.fam-card.add::before { display: none; }
.fam-card.add .plus { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--ink); }
.fam-card.add .plus .ico { width: 26px; height: 26px; }

/* ------------------------------------------------ Réglages */
.settings { display: grid; gap: 14px; }
.set-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 18px; }
.set-card h3 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 700; font-size: 17px; }
.set-card p { margin: 0; color: var(--muted); font-size: 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.set-card .btn { margin-top: 14px; }
.steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink); font-size: 15px; display: grid; gap: 6px; }
.steps b { font-weight: 800; }

/* ------------------------------------------------ Barre d'onglets */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  width: min(460px, calc(100% - 24px)); height: var(--tabbar-h); border-radius: 26px;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 10px 40px rgba(18,18,31,.16), inset 0 0 0 1px rgba(255,255,255,.08);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 6px;
}
.tab { border: 0; background: none; display: grid; justify-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 800; padding: 8px 0; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { stroke-width: 2.4; }
.tab-add {
  justify-self: center; width: 58px; height: 58px; border-radius: 20px; border: 0; color: #1A0E02;
  background: linear-gradient(135deg, var(--sun), var(--tang) 70%); box-shadow: 0 8px 22px rgba(255, 122, 26, .45);
  display: grid; place-items: center; transition: transform .15s;
}
.tab-add:active { transform: scale(.92) rotate(90deg); }
.tab-add svg { width: 28px; height: 28px; stroke-width: 2.8; }

/* ------------------------------------------------ Feuilles */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(8, 8, 18, .5); opacity: 0; transition: opacity .25s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: calc(100% - env(safe-area-inset-top, 0px) - 24px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--card); border-radius: 30px 30px 0 0; transform: translateY(105%); transition: transform .38s cubic-bezier(.2, .9, .2, 1);
  padding: 10px var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 26px) var(--gutter);
}
.sheet.on { transform: none; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 580px; max-height: 88%; border-radius: 30px; padding: 12px 30px 30px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .25s ease, opacity .25s ease; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; }
}
.grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet-title { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card-2); display: grid; place-items: center; color: var(--ink); flex: none; }
.close .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.lbl { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.lbl em { font-style: normal; font-weight: 600; opacity: .8; }
.input {
  width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--card-2); padding: 14px 16px; font-size: 16px; font-weight: 600;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tang); }
.input.title-in { font-size: 20px; font-weight: 800; min-height: 60px; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.4; }
input[type="date"].input, input[type="time"].input { min-height: 52px; display: block; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cat { border: 0; border-radius: 16px; padding: 12px 4px 10px; background: var(--card-2); display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); transition: transform .12s; }
.cat .tile { width: 36px; height: 36px; border-radius: 12px; }
.cat .tile .ico { width: 19px; height: 19px; }
.cat[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.cat:active { transform: scale(.95); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; font-weight: 700; border-top: 1px solid var(--line); }
.toggle-row:last-of-type { border-bottom: 1px solid var(--line); }
.toggle-row small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .22s cubic-bezier(.3,1.4,.6,1); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--tang); outline-offset: 2px; }
.people { display: flex; flex-wrap: wrap; gap: 10px; }
.person { border: 0; background: none; padding: 4px; display: grid; justify-items: center; gap: 6px; width: 70px; font-size: 12px; font-weight: 700; color: var(--muted); }
.person .av { opacity: .35; filter: grayscale(.6); transition: opacity .15s, filter .15s, transform .15s; }
.person[aria-pressed="true"] { color: var(--ink); }
.person[aria-pressed="true"] .av { opacity: 1; filter: none; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.person:active .av { transform: scale(.92); }
.person span.nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.form-err { margin: 0 0 8px; color: var(--danger); font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.actions .btn { flex: 1 1 150px; }

/* Détail */
.det-band { position: relative; overflow: hidden; margin: -10px calc(-1 * var(--gutter-r)) 18px calc(-1 * var(--gutter)); padding: 18px var(--gutter-r) 22px var(--gutter); color: #fff; border-radius: 30px 30px 0 0; }
@media (min-width: 720px) { .det-band { margin: -12px -30px 18px; padding: 22px 30px 24px; } }
.det-band .grab { background: rgba(255,255,255,.5); }
.det-band .close { background: rgba(255,255,255,.22); color: #fff; }
.det-band .big-ico { position: absolute; right: -10px; bottom: -26px; width: 140px; height: 140px; opacity: .18; }
.det-band .big-ico .ico { width: 100%; height: 100%; stroke-width: 1.5; }
.det-rel { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.det-title { margin: 8px 0 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 6.5vw, 30px); letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; position: relative; }
.meta { display: grid; gap: 14px; }
.meta-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; }
.meta-row .mi { width: 40px; height: 40px; border-radius: 13px; background: var(--card-2); display: grid; place-items: center; color: var(--muted); }
.meta-row .mi .ico { width: 20px; height: 20px; }
.meta-row b { display: block; font-weight: 800; }
.meta-row span { color: var(--muted); font-size: 14px; font-weight: 600; }
.meta-row .note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-weight: 500; font-size: 15px; }
.going { margin-top: 18px; background: var(--card-2); border-radius: 20px; padding: 16px; }
.going h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.going .people .person { width: 62px; }
.going .btn { width: 100%; margin-top: 12px; }
.confirm { margin-top: 14px; background: var(--card-2); border-radius: 18px; padding: 16px; }
.confirm p { margin: 0 0 4px; font-weight: 700; }
.confirm .actions { margin-top: 12px; }
.byline { margin: 14px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }

/* Membre */
.photo-pick { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.photo-pick .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-pick label.btn, .photo-pick button.btn { min-height: 42px; padding: 10px 14px; font-size: 14px; border-radius: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); transition: transform .12s; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.sw:active { transform: scale(.9); }

/* ------------------------------------------------ Divers */
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tabbar-h) + 26px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s;
  background: var(--ink); color: var(--bg); padding: 13px 18px; border-radius: 16px; font-weight: 700; font-size: 14px;
  max-width: calc(100% - 40px); text-align: center; box-shadow: var(--shadow);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.offline { position: fixed; z-index: 35; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; max-width: calc(100% - 32px); text-align: center; }
.skeleton { height: 76px; border-radius: 20px; background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fade-in > * { animation: viewIn .4s cubic-bezier(.2,.8,.2,1) both; }
.fade-in > *:nth-child(2) { animation-delay: .04s; } .fade-in > *:nth-child(3) { animation-delay: .08s; }
.fade-in > *:nth-child(4) { animation-delay: .12s; } .fade-in > *:nth-child(5) { animation-delay: .16s; }

@media (min-width: 900px) {
  .views { max-width: 760px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
