@font-face {
  font-family: Fraunces; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/fraunces-600-latin.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;
}
:root {
  color-scheme: light;
  --cream: #FBF5EA; --cranberry: #A3262E; --ink: #2A1D1A; --gold: #C9962F; --fir: #1F4D3A;
  --wine: #7F1D24; --sand: #F3E6D0; --line: #E8DCC8;
  --bg: var(--cream); --surface: #fff; --text: var(--ink); --muted: #6B5A55;
  --primary: var(--cranberry); --on-primary: #fff; --accent: var(--gold); --ok: var(--fir);
  --r-s: 12px; --r-m: 20px; --r-l: 28px; --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px;
  --font-title: Fraunces, Georgia, 'Times New Roman', serif;
  --font-text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar-h: 76px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 16px/1.5 var(--font-text); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 600; color: var(--wine); line-height: 1.15; margin: 0 0 var(--s3); }
h1 { font-size: 2rem; } h2 { font-size: 1.3rem; }
p { margin: 0 0 var(--s3); }
.muted { color: var(--muted); }
.kicker { margin: 0 0 var(--s1); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
main { max-width: 640px; margin: 0 auto; padding: var(--s5) 20px calc(var(--tabbar-h) + var(--s5)); outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; } /* focus programmatique après navigation, pas un contrôle */
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.banner { background: var(--accent); color: var(--ink); text-align: center; padding: var(--s2) var(--s3); font-size: .9rem; font-weight: 700; }

.tabbar {
  position: fixed; inset: auto 0 0 0; height: var(--tabbar-h); display: flex; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; margin-bottom: var(--s3); }
.card h2 { font-size: 1.15rem; margin-bottom: var(--s2); }
.note { background: var(--sand); border-radius: var(--s3); padding: 14px var(--s3); font-size: .95rem; line-height: 1.45; margin-bottom: var(--s3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 56px; padding: 0 var(--s4);
  border-radius: var(--r-pill); border: 2px solid var(--primary); background: var(--primary); color: var(--on-primary);
  font: 700 1.1rem var(--font-text); cursor: pointer; text-decoration: none;
}
.btn.small { min-height: 44px; padding: 0 var(--s3); font-size: .95rem; }
.btn.secondary { background: transparent; color: var(--primary); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.dashed { background: transparent; color: var(--wine); border: 2px dashed var(--primary); border-radius: var(--s3); min-height: 48px; font-size: 1rem; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.link { border: 0; background: none; color: var(--wine); text-decoration: underline; min-height: 44px; padding: 0 var(--s2); font-weight: 700; font-size: .95rem; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--s3); }

label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
input[type=text], input[type=date], input[type=number], select {
  width: 100%; min-height: 50px; padding: 0 var(--s3); border: 2px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
}
input[type=text]:focus, input[type=date]:focus, input[type=number]:focus, select:focus { border-color: var(--primary); outline: none; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 48px; font-weight: 500; }
.check input { width: 24px; height: 24px; accent-color: var(--primary); }
.amount { display: flex; align-items: center; gap: 10px; }
.amount input { width: 110px; font-size: 1.25rem; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s2); }
.chip { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); border: 2px solid var(--fir); background: var(--fir); color: #fff; font: 700 1rem var(--font-text); cursor: pointer; }
.chip.todo { background: transparent; color: var(--ink); border: 2px dashed var(--muted); font-weight: 500; }
.chip.person { cursor: default; }
.chipw { display: inline-flex; align-items: center; }
.chipw .x { width: 36px; height: 44px; margin-left: 2px; border: 0; background: none; color: var(--wine); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.excl { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 var(--s3); margin-bottom: var(--s2); border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.excl button { width: 44px; height: 44px; border: 0; background: none; color: var(--wine); font-size: 1.5rem; cursor: pointer; }

.countdown { background: var(--fir); color: var(--cream); border-radius: var(--r-l); padding: var(--s4); margin-bottom: var(--s3); }
.countdown .kicker { color: #E8C170; }
.countdown .units { display: flex; gap: 12px; margin: var(--s3) 0; }
.countdown .unit { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 12px 8px; border-radius: var(--s3); background: rgba(255,255,255,.12); }
.countdown .unit b { font: 600 2.4rem/1 var(--font-title); font-variant-numeric: tabular-nums; }
.countdown .unit span { font-size: .85rem; }
.countdown .joy { font: 600 1.8rem var(--font-title); }
.countdown .meta { margin: 0; font-weight: 500; }

.badge { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: .8rem; font-weight: 700; border: 1px solid currentColor; }
.badge.ok { color: var(--ok); }
.banner-secret { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: #fff; background: var(--primary); border: 0; border-radius: var(--r-m); padding: 18px 20px; }
.banner-secret strong { display: block; font-size: 1.1rem; font-weight: 700; }
.banner-secret .sub { font-size: .95rem; opacity: .92; }
.banner-secret svg.i { width: 36px; height: 36px; stroke-width: 1.6; }
.shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shortcuts a { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.shortcuts a svg.i { color: var(--wine); width: 28px; height: 28px; }
.shortcuts strong { font-size: 1.05rem; font-weight: 700; }
.shortcuts span { font-size: .9rem; color: var(--muted); }

.pin { display: flex; gap: 12px; justify-content: center; margin: var(--s3) 0; }
.pin input { width: 60px; height: 68px; text-align: center; font: 600 1.7rem var(--font-title); border: 2px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--text); }
.pin input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--accent); }
.error { color: var(--primary); font-weight: 700; }

.reveal { text-align: center; padding: var(--s5) var(--s3) var(--s4); color: var(--cream); border-radius: var(--r-l); background: radial-gradient(90% 60% at 50% 48%, color-mix(in srgb, var(--gold) 30%, var(--cranberry)), var(--cranberry)); }
.reveal .kicker { color: #E8C170; }
.reveal .lead { font-size: 1.2rem; margin-bottom: var(--s4); text-wrap: balance; }
.reveal .who { background: var(--cream); color: var(--ink); border-radius: var(--r-l); padding: var(--s4) var(--s3); display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--ink); color: var(--cream); display: grid; place-items: center; font: 600 2.6rem var(--font-title); }
.reveal .name { font: 600 3rem/1.05 var(--font-title); color: var(--cranberry); }
.reveal .budget { color: var(--muted); margin: 0; }
.reveal .lock { display: flex; gap: 10px; align-items: flex-start; text-align: left; margin: var(--s3) 0 0; padding: 14px var(--s3); border-radius: 14px; background: rgba(255,255,255,.12); font-size: .95rem; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(42,29,26,.45); display: flex; align-items: flex-end; z-index: 10; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; margin: 0 auto; border-radius: var(--r-l) var(--r-l) 0 0; padding: var(--s4) 20px calc(var(--s4) + env(safe-area-inset-bottom)); }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--s3)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px var(--s3); border-radius: var(--s3); opacity: 0; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }

.code-box { display: flex; align-items: center; min-height: 52px; padding: 0 var(--s3); border-radius: var(--r-s); background: var(--sand); font: 700 1.2rem var(--font-text); letter-spacing: .12em; }
.pair-list { list-style: none; padding: 0; margin: 0; }
.pair-list li { display: flex; justify-content: space-between; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
