/* La Hotte — "Nuit de Noël": La Malle's quiet surfaces and hairlines, in midnight blue, with gold
   as the one accent and a string of lights under the top bar. The kit at /kit shows every
   component; copy its markup. No inline styles anywhere (strict CSP): classes only. */

@font-face {
  font-family: "Geist";
  src: url("/static/geist.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens: light, then dark (system, chosen, or forced on a [data-tone] block in the kit) ---- */
:root, [data-tone="light"] {
  --bg: #f3f6fb; --surface: #ffffff; --surface-2: #eaeff7; --surface-3: #dfe6f1;
  --line: rgb(15 23 40 / .09); --line-2: rgb(15 23 40 / .16);
  --text: #0f1728; --text-2: #465069; --text-3: #5f6a85;
  --ink: #0f1728; --ink-text: #f3f6fb;
  --accent: #d9a521; --accent-strong: #c4921a; --accent-ink: #1f1500; --accent-text: #8a6200;
  --accent-soft: rgb(217 165 33 / .15); --accent-softer: rgb(217 165 33 / .07);
  --pine: #1f6b4a; --pine-2: #17523a; --berry: #c2313b; --gold: #c8962e; --snow: #ffffff;
  --danger: #b42318; --danger-soft: rgb(180 35 24 / .08);
  --hover: rgb(15 23 40 / .04);
  --glow: rgb(217 165 33 / .14);
  --dots: rgb(15 23 40 / .08);
  --thumb: #ffffff;
  --shadow-sm: 0 1px 2px rgb(15 23 40 / .06);
  --shadow: 0 1px 2px rgb(15 23 40 / .05), 0 6px 20px -6px rgb(15 23 40 / .12);
  --shadow-lg: 0 2px 4px rgb(15 23 40 / .06), 0 24px 48px -12px rgb(15 23 40 / .25);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14; --surface: #0d1320; --surface-2: #141c2c; --surface-3: #1d273b;
    --line: rgb(190 210 255 / .09); --line-2: rgb(190 210 255 / .16);
    --text: #e8ecf5; --text-2: #a3adc4; --text-3: #8490aa;
    --ink: #eef2fa; --ink-text: #0d1320;
    --accent: #f2c45a; --accent-strong: #f7d57f; --accent-ink: #1f1500; --accent-text: #f6d37e;
    --accent-soft: rgb(242 196 90 / .14); --accent-softer: rgb(242 196 90 / .06);
    --pine: #2f8f66; --pine-2: #1f6b4a; --berry: #f0626a; --gold: #f2c45a; --snow: #e9eef5;
    --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
    --hover: rgb(190 210 255 / .05);
    --glow: rgb(242 196 90 / .10);
    --dots: rgb(190 210 255 / .07);
    --thumb: #26314a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], [data-tone="dark"] {
  --bg: #070b14; --surface: #0d1320; --surface-2: #141c2c; --surface-3: #1d273b;
  --line: rgb(190 210 255 / .09); --line-2: rgb(190 210 255 / .16);
  --text: #e8ecf5; --text-2: #a3adc4; --text-3: #8490aa;
  --ink: #eef2fa; --ink-text: #0d1320;
  --accent: #f2c45a; --accent-strong: #f7d57f; --accent-ink: #1f1500; --accent-text: #f6d37e;
  --accent-soft: rgb(242 196 90 / .14); --accent-softer: rgb(242 196 90 / .06);
  --pine: #2f8f66; --pine-2: #1f6b4a; --berry: #f0626a; --gold: #f2c45a; --snow: #e9eef5;
  --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
  --hover: rgb(190 210 255 / .05);
  --glow: rgb(242 196 90 / .10);
  --dots: rgb(190 210 255 / .07);
  --thumb: #26314a;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 15px/1.5 "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.link { font-weight: 550; color: var(--accent-text); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font: 500 .88em ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; } /* minmax(0,…): long no-wrap titles shrink, never widen the page */
.mt-16 { margin-top: 16px; }

/* ---- logo: a gift in the rounded square ------------------------------------------------------ */
.logo { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo-bg { fill: var(--ink); }
.logo-fg { fill: var(--ink-text); }
.logo-ribbon { fill: var(--accent); }
.logo-bow { transform-box: view-box; transform-origin: 16px 12px; transition: transform .45s cubic-bezier(.3,1.6,.5,1); }
.logo-gift { transform-box: view-box; transform-origin: 16px 26px; transition: transform .38s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .logo-gift { transform: rotate(-6deg); }
.brand:hover .logo-bow { transform: scale(1.18); }
.logo-spark { fill: var(--accent); opacity: 0; }
.brand:hover .logo-spark-1 { animation: spark 1s .1s ease-out; }
.brand:hover .logo-spark-2 { animation: spark 1s .3s ease-out; }

/* ---- buttons ------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: -.005em; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover { box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 6px 18px -8px var(--accent), inset 0 1px 0 rgb(255 255 255 / .3); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-quiet { border-color: var(--line-2); background: var(--surface); color: var(--text); }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--surface); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-sm .ico { width: 16px; height: 16px; }
.btn-block { width: 100%; height: 46px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ico { width: 19px; height: 19px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-row form { display: contents; }

/* ---- theme toggle (Comme l'appareil / Clair / Sombre) ----------------------------------------------- */
.theme-toggle { --seg: 32px; position: relative; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.theme-toggle button { position: relative; z-index: 1; display: grid; place-items: center; width: var(--seg); height: calc(var(--seg) - 4px); padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); transition: color .2s ease; }
.theme-toggle button:hover, .theme-toggle button[aria-pressed="true"] { color: var(--text); }
.theme-toggle .ico { width: 16px; height: 16px; }
.theme-thumb { position: absolute; top: 2px; left: 2px; width: var(--seg); height: calc(var(--seg) - 4px); border-radius: 999px; background: var(--thumb); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform .32s cubic-bezier(.3,1.3,.5,1); }
:root[data-theme-pref="light"] .theme-thumb { transform: translateX(var(--seg)); }
:root[data-theme-pref="dark"] .theme-thumb { transform: translateX(calc(var(--seg) * 2)); }
@media (pointer: coarse) { .theme-toggle { --seg: 40px; } }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-old(root) { z-index: 1; }
html.theme-vt::view-transition-new(root) { z-index: 2; }

/* ---- top bar, its string of lights, the tab bar ------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 650; font-size: 15px; letter-spacing: -.015em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav a { position: relative; padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 520; color: var(--text-2); transition: color .15s ease, background-color .15s ease; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: -9px; height: 2px; border-radius: 2px; background: var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.who { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 12px 3px 3px; border-radius: 999px; font-size: 14px; font-weight: 550; color: var(--text-2); transition: background-color .15s ease; }
.who:hover { background: var(--hover); color: var(--text); }
.who-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the string of lights: a hairline wire and bulbs that twinkle (gold, berry, pine, accent) */
.garland {
  display: flex; justify-content: space-between; align-items: flex-start; height: 13px;
  max-width: 1120px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  background: linear-gradient(var(--line-2), var(--line-2)) 0 0 / 100% 1px no-repeat;
}
.garland i { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 7px 0 var(--gold); }
.garland i:nth-child(4n+2) { background: var(--berry); box-shadow: 0 0 7px 0 var(--berry); margin-top: 5px; }
.garland i:nth-child(4n+3) { background: var(--pine); box-shadow: 0 0 7px 0 var(--pine); }
.garland i:nth-child(4n+4) { background: var(--snow); box-shadow: 0 0 7px 0 var(--accent); margin-top: 5px; }
@media (prefers-reduced-motion: no-preference) {
  .garland i { animation: twinkle 3.2s ease-in-out infinite; }
  .garland i:nth-child(3n+1) { animation-delay: -1.1s; }
  .garland i:nth-child(3n+2) { animation-delay: -2.2s; }
}
@media (max-width: 719px) { .garland i:nth-child(n+21) { display: none; } }

.tabbar { display: none; }
@media (max-width: 719px) {
  .nav, .topbar-end .theme-toggle, .who-name { display: none; }
  .who { padding: 3px; }
  .topbar-inner { height: 54px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .garland { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .tabbar {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; border-radius: 12px; font-size: 11.5px; font-weight: 550; color: var(--text-3); }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] .ico { color: var(--accent-text); stroke-width: 2; }
}

/* ---- page, hero, sections ----------------------------------------------------------------------------- */
.page { max-width: 880px; margin: 0 auto; padding: 36px max(24px, env(safe-area-inset-right)) 96px max(24px, env(safe-area-inset-left)); }
.page-narrow { max-width: 680px; }
.page-wide { max-width: 1280px; }
@media (max-width: 719px) {
  .page { padding: 22px max(16px, env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}
.hero { margin-bottom: 22px; animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; font-weight: 550; color: var(--text-3); }
.eyebrow .ico { width: 16px; height: 16px; }
.hello { font-size: clamp(27px, 4.4vw, 36px); line-height: 1.12; font-weight: 650; letter-spacing: -.032em; text-wrap: balance; overflow-wrap: anywhere; }
.hero-sub { margin-top: 10px; max-width: 60ch; color: var(--text-3); font-size: 14.5px; }
.countdown { color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown.is-today { animation: nudge 1.6s ease-in-out infinite; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px -8px; padding: 4px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--text-3); }
.back:hover { color: var(--text); background: var(--hover); }
.back .ico { width: 16px; height: 16px; }

/* ---- cards and rows ------------------------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.card-head > .ico { color: var(--text-3); width: 18px; height: 18px; }
.card-rows { padding: 0; } /* no overflow:hidden – row menus open over the card's edge */
.card-rows > .row:first-child { border-radius: 15px 15px 0 0; }
.card-rows > .row:last-child { border-radius: 0 0 15px 15px; }
.card-rows > .row:only-child { border-radius: 15px; }
.card-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; transition: background-color .15s ease, border-color .15s ease; }
.card-link:hover { border-color: var(--line-2); background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.card-link > .ico { color: var(--text-3); }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-link { transition: background-color .15s ease; }
.row-link:hover { background: var(--hover); }
.row-link > .ico { color: var(--text-3); width: 18px; height: 18px; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.t { display: flex; align-items: center; gap: 6px; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s .link { font-weight: 500; }
.new { color: var(--berry); font-weight: 600; }
.pinned { display: inline-flex; color: var(--accent-text); }
.pinned .ico { width: 14px; height: 14px; }
.row.is-gone .t { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.row form { display: contents; }
.ini { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 650; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.ini-me { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.ini-child { border-style: dashed; border-color: var(--line-2); }
.who .ini { width: 32px; height: 32px; }
.tile { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }
.tile .ico { width: 19px; height: 19px; }
.tile.t-a { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.tile.t-p { background: color-mix(in srgb, var(--pine) 14%, transparent); color: var(--pine); border-color: transparent; }
.tile.t-g { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); border-color: transparent; }
.tile.t-s { background: transparent; border-style: dashed; border-color: var(--line-2); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-3); font-size: 12px; }
.kv { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.card-head + .kv { border-top: 0; padding-top: 0; }
.kv .k { color: var(--text-2); font-size: 14px; }
.kv .muted { max-width: 46ch; font-size: 13.5px; }

/* ---- chips: the states of a gift ----------------------------------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 550; line-height: 1.1; white-space: nowrap; }
.chip .ico { width: 13px; height: 13px; stroke-width: 2; }
.chip.c-me { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }            /* mine: Réservé par toi */
.chip.c-team { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: transparent; color: var(--text); } /* shared: Cadeau commun */
.chip.c-done { background: color-mix(in srgb, var(--pine) 14%, transparent); border-color: transparent; color: var(--pine); } /* done (milestone B: Acheté) */
.chip.c-secret { border-style: dashed; }                                                                      /* Idée secrète */
.chip.c-new { background: color-mix(in srgb, var(--berry) 13%, transparent); border-color: transparent; color: var(--berry); } /* Nouveau */
.chip.c-changed { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--text); }           /* Modifiée depuis ta réservation */
.chip.c-gone { background: var(--surface-2); border-color: transparent; color: var(--text-3); }                 /* Retirée de sa liste */
.chip.c-fav { border-color: transparent; background: transparent; color: var(--berry); padding-inline: 2px; }     /* Coup de cœur */
.t .chip { padding: 3px 7px; font-size: 11px; }

/* ---- forms --------------------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-short { max-width: 14rem; }
.label { font-size: 13.5px; font-weight: 550; color: var(--text-2); padding: 0; }
.hint { font-weight: 400; color: var(--text-3); }
.label .hint::before { content: "· "; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--text);
  font-size: 16px; /* no zoom-in on iPhone */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; font-weight: 520; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.input-suffix > span { position: absolute; right: 12px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14.5px; cursor: pointer; }
.check > span { display: inline-flex; align-items: center; gap: 6px; }
.check .ico { width: 17px; height: 17px; color: var(--berry); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 1px; }
.switch-row b { font-weight: 550; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 42px; height: 26px; margin: 0; border-radius: 26px; background: var(--surface-3); border: 1px solid var(--line-2); cursor: pointer; transition: background-color .2s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3,1.3,.5,1); }
.switch:checked { background: var(--pine); border-color: var(--pine); }
.switch:checked::after { transform: translateX(16px); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.disclose { margin-top: 6px; }
.disclose summary { display: inline-flex; padding: 6px 0; cursor: pointer; font-size: 14px; font-weight: 550; color: var(--accent-text); list-style: none; }
.disclose summary::-webkit-details-marker { display: none; }
.disclose[open] summary { margin-bottom: 10px; }

/* ---- messages: alerts and the note box ----------------------------------------------------------- */
.alert { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; padding: 11px 13px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 520; }
.alert .ico { width: 18px; height: 18px; margin-top: 1px; }
.alert-ok { background: color-mix(in srgb, var(--pine) 12%, transparent); color: var(--pine); }
.alert-info { background: var(--surface-2); color: var(--text-2); }
.note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; }
.note .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--text-3); }

/* ---- empty states --------------------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px 56px; text-align: center; border: 1px dashed var(--line-2); border-radius: 20px; background: radial-gradient(ellipse 55% 65% at 50% 0%, var(--accent-softer), transparent); }
.empty-sm { padding: 26px 20px 28px; gap: 8px; }
.empty h1, .empty h2, .empty h3 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.empty p { max-width: 36ch; color: var(--text-3); font-size: 14.5px; }
.empty .btn { margin-top: 10px; }
.empty-art { width: 150px; height: 112px; overflow: visible; }
.ea-shadow { fill: var(--text); opacity: .07; }
.ea-box { fill: var(--ink); }
.ea-ribbon { fill: var(--accent); }
.ea-lid { transform-box: view-box; transform-origin: 44px 58px; animation: lid 3.4s ease-in-out infinite; }
.ea-spark { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.ea-spark-2 { animation-delay: .8s; } .ea-spark-3 { animation-delay: 1.5s; }

/* ---- dialogs: the confirmation, and sheets (bottom sheet on phones, centred on wide screens) ------ */
dialog { color: var(--text); }
dialog::backdrop { background: rgb(7 11 20 / .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); }
.dialog[open] { animation: rise .2s cubic-bezier(.2,.8,.2,1); }
.dialog-body { padding: 22px 20px 18px; }
.dialog-text { font-size: 16px; font-weight: 550; line-height: 1.4; text-wrap: pretty; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sheet { width: min(480px, calc(100% - 32px)); max-height: 88dvh; padding: 10px 18px 20px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: auto; }
.sheet[open] { animation: rise .22s cubic-bezier(.2,.8,.2,1); }
.sheet-grab { display: block; width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 4px; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
@media (max-width: 719px) {
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sheet[open] { animation: slide-up .26s cubic-bezier(.2,.8,.2,1); }
}

/* ---- row menu (<details class="menu">) ------------------------------------------------------------- */
.menu { position: relative; flex: none; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--hover); color: var(--text); }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: grid; min-width: 200px; padding: 6px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: rise .14s ease-out; }
.menu-list.up { top: auto; bottom: calc(100% + 4px); }
.menu-list form { display: contents; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 10px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 520; color: var(--text); text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--hover); }
.menu-list .ico { width: 17px; height: 17px; color: var(--text-3); }
.menu-list .danger, .menu-list .danger .ico { color: var(--danger); }

/* ---- sign-in -------------------------------------------------------------------------------------- */
.login-page { display: grid; place-items: center; align-content: center; gap: 18px; padding: 80px 16px 40px; position: relative; overflow-x: hidden; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 22px 22px; -webkit-mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); }
.login-page::after { content: ""; position: fixed; z-index: -1; pointer-events: none; width: 520px; height: 520px; left: 50%; top: 42%; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); filter: blur(10px); }
.login-corner { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 34px 30px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.login-mark { margin-bottom: 20px; }
.login-mark .logo { width: 46px; height: 46px; }
.login-mark .logo-bow { animation: bow 1.2s .35s cubic-bezier(.3,1.4,.5,1) both; }
.login-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.login-lede { margin-top: 6px; color: var(--text-3); font-size: 14.5px; }
.login-card .garland { margin: 18px 0 4px; padding: 0; }
.login-form { display: grid; gap: 14px; margin-top: 18px; }
.login-form .btn-block { margin-top: 6px; }
.login-foot { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 719px) { .login-card { padding: 28px 22px 24px; border-radius: 20px; } }

/* ---- the lists: gift rows and their actions, the adder, family rows, the dev bar ------------------- */
.row.gift { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.row.gift .tile { margin-top: 1px; }
.row.gift .s { white-space: normal; overflow-wrap: anywhere; } /* a giver reads the précisions in full */
.row .chip-row { margin-top: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.row-actions form { display: contents; }
.adder { margin-top: 14px; }
.adder > summary { list-style: none; width: fit-content; }
.adder > summary::-webkit-details-marker { display: none; }
.adder[open] > summary { margin-bottom: 12px; }
.adder > .card { padding: 18px; }
.list-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pin-toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-text); }
.family-row { gap: 2px; padding: 0 8px 0 0; }
.row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; align-self: stretch; padding: 10px 6px 10px 14px; border-radius: inherit; transition: background-color .15s ease; }
.row-main:hover { background: var(--hover); }
.row-main .grow { gap: 2px; }
.gives { white-space: normal; }
.pin-btn { color: var(--text-3); }
.pin-btn .ico { width: 18px; height: 18px; }
.pin-btn[aria-pressed="true"] { color: var(--accent-text); }
.pin-btn[aria-pressed="true"] .ico { fill: var(--accent-soft); }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.link-btn { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.note .link { font-weight: 550; }
.devbar { position: fixed; z-index: 40; left: 50%; bottom: 14px; translate: -50% 0; display: flex; align-items: center; gap: 2px; max-width: calc(100% - 24px); overflow-x: auto; padding: 4px; border: 1px dashed var(--accent); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 12.5px; scrollbar-width: none; }
.devbar-k { padding: 0 8px; color: var(--text-3); font-weight: 550; white-space: nowrap; }
.devbar form { display: contents; }
.devbar button { padding: 6px 10px; border: 0; border-radius: 999px; background: none; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.devbar button:hover { background: var(--hover); }
.devbar button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); }
body:has(.devbar) .page { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
@media (max-width: 719px) { .devbar { bottom: calc(70px + env(safe-area-inset-bottom)); } }

/* ---- the tree on Accueil (sapin.js mounts into it; hidden without JavaScript) ------------------------ */
.sapin-stage { height: 300px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(120% 90% at 50% 100%, var(--surface-2), var(--surface) 70%); overflow: hidden; }
@media (min-width: 720px) { .sapin-stage { height: 380px; } }

/* ---- photos: thumbnails in rows, the photo field, the viewer -------------------------------------------- */
.thumb { flex: none; display: block; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row.gift .thumb { margin-top: 1px; }
.photo-field input[type=file] { min-height: 0; padding: 8px; font-size: 14px; background: var(--surface); }
.photo-current { display: flex; align-items: center; gap: 12px; }
.photo-current img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.photo-preview { width: 96px; height: 96px; border-radius: 12px; border: 1px solid var(--line); }
.viewer { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 90vh; overflow: visible; }
.viewer::backdrop { background: rgb(0 0 0 / .78); }
.viewer img { display: block; max-width: min(94vw, 1600px); max-height: 86vh; border-radius: 14px; object-fit: contain; background: var(--surface-2); }
.viewer form { position: absolute; top: -48px; right: 0; }
.viewer-close { color: #fff; background: rgb(0 0 0 / .35); }
.viewer-close:hover { background: rgb(0 0 0 / .55); color: #fff; }

/* ---- money: what was paid, buying, the bill ----------------------------------------------------------- */
.paid { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--pine); font-variant-numeric: tabular-nums; }
.paid .ico { width: 15px; height: 15px; stroke-width: 2; }
.buy { display: contents; }
.buy > summary { list-style: none; }
.buy > summary::-webkit-details-marker { display: none; }
.buy[open] > summary { background: var(--surface-2); }
.buy-form { flex-basis: 100%; display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.buy-form .field { flex: 1; min-width: 9rem; max-width: 14rem; }
.amount { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amount.big { font-size: 22px; letter-spacing: -.02em; }
.amount.owe { color: var(--accent-text); }
.amount.get { color: var(--pine); }
.bill-top { padding: 6px 18px; }
.bill-pair { padding: 4px 16px 14px; }
.bill-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bill-net { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; font-size: 15px; }
.bill-tick { margin-top: 8px; }
.bill-tick .is-on { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 45%, transparent); }

/* ---- the kit (/kit) ------------------------------------------------------------------------------------ */
.kit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1099px) { .kit { grid-template-columns: minmax(0, 1fr); } }
.kit-panel { min-width: 0; padding: 20px; border: 1px solid var(--line-2); border-radius: 20px; background: var(--bg); color: var(--text); }
.kit-tone { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.kit-tone .ico { width: 15px; height: 15px; }
.kit-sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.kit-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.kit-h { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.kit-note { font-size: 13px; color: var(--text-3); }
.kit-sec .garland { padding: 0; margin: 4px 0 0; }

/* ---- keyframes, reduced motion ----------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes slide-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spark { 0% { opacity: 0; transform: translateY(1px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes bow { 0%, 100% { transform: none; } 40% { transform: scale(1.25) rotate(-6deg); } 70% { transform: scale(.95) rotate(3deg); } }
@keyframes lid { 0%, 60%, 100% { transform: none; } 75% { transform: translateY(-7px) rotate(-7deg); } 85% { transform: translateY(-3px) rotate(-3deg); } }
@keyframes nudge { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}
