/* Cadeaux — thème : neige / épicéa / ruban. Clair par défaut, sombre selon le système. */
:root {
  --bg: #f3f5f1; --surface: #ffffff; --surface-2: #e9ede6; --fg: #16251e; --muted: #5f6f66; --line: #d3dad3;
  --accent: #c0392b; --accent-ink: #ffffff; --accent-soft: #fbe9e6; --gold: #a9771f; --gold-soft: #f6ecd6;
  --ok: #2f7a4e; --ok-soft: #e1f2e7; --warn: #b26a00; --warn-soft: #fdf0d8; --danger: #b3261e;
  --shadow: 0 1px 2px rgba(22,37,30,.06), 0 8px 24px -12px rgba(22,37,30,.18);
  --display: "Gloock", "Iowan Old Style", Georgia, serif; --body: "Nunito Sans", "Segoe UI", system-ui, sans-serif; --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a15; --surface: #182620; --surface-2: #20302a; --fg: #ecefe8; --muted: #9fb0a6; --line: #2d3f36;
    --accent: #e4594c; --accent-ink: #1a0b09; --accent-soft: #3a1f1c; --gold: #d9a545; --gold-soft: #3a2f16;
    --ok: #5fc08a; --ok-soft: #1c3528; --warn: #e0a24a; --warn-soft: #3b2d14; --danger: #ff7b6e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 18px; height: 18px; flex: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 2rem; line-height: 1.1; } h2 { font-size: 1.45rem; line-height: 1.15; } h3 { font-size: 1.1rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; margin: 0; }
.eyebrow.light, .hint.light { color: inherit; opacity: .65; }
.muted { color: var(--muted); } .num { font-variant-numeric: tabular-nums; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
ul.plain { padding-left: 1.2em; }

/* ---- coquille ---- */
.app { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; background: var(--surface); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.side-list { padding: 10px; border-radius: 8px; background: var(--surface-2); font-size: .9rem; }
.me { margin-top: auto; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.me a { text-decoration: none; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font-size: .8rem; }
.linklike:hover { text-decoration: underline; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem; background: var(--surface-2); border-left: 3px solid var(--muted); }
.flash.success { background: var(--ok-soft); border-color: var(--ok); } .flash.error { background: var(--accent-soft); border-color: var(--accent); } .flash.info { background: var(--gold-soft); border-color: var(--gold); }
.notice { border-left: 3px solid var(--gold); background: var(--gold-soft); padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: .88rem; margin: 0; }
.notice.warn { margin-bottom: 14px; }

/* ---- composants ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 9px 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; line-height: 1.2; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: .82rem; } .btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); display: inline-flex; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn.tiny { padding: 2px; } .icon-btn.tiny svg { width: 14px; height: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; flex: none; background: var(--c, var(--muted)); }
.avatar.lg { width: 40px; height: 40px; font-size: .95rem; } .avatar.xs { width: 20px; height: 20px; font-size: .6rem; }
.avatars { display: flex; } .avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; } .avatars .avatar:first-child { margin-left: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 9px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.pill.gold { background: var(--gold-soft); color: var(--gold); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.accent { background: var(--accent-soft); color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: .82rem; font-weight: 700; color: var(--muted); } .field.grow { flex: 1 1 240px; }
.input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.small { width: 90px; flex: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .row.tight { gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.form-inline { padding: 18px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; } .form-inline .full { flex-basis: 100%; }
.empty-state { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); } .empty-state svg { width: 36px; height: 36px; opacity: .5; } .empty-state .btn { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- connexion ---- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.auth-art { background: #16251e; color: #f3f5f1; padding: 48px clamp(20px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; position: relative; overflow: hidden; }
.auth-art .brand { font-size: 1.6rem; color: inherit; } .auth-art .brand svg { color: #e4594c; }
.auth-art h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); max-width: 14ch; margin-top: 8px; } .auth-art p { max-width: 42ch; margin: 14px 0 0; }
.auth-art .wire { position: absolute; right: -40px; bottom: -40px; width: 55%; height: auto; max-width: 420px; opacity: .3; }
.auth-form { padding: 48px clamp(16px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 520px; width: 100%; margin: 0 auto; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.tabs a { flex: 1; text-align: center; text-decoration: none; border-radius: 7px; padding: 8px; font-weight: 600; color: var(--muted); }
.tabs a[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* ---- mes listes ---- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.list-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; transition: transform .15s, box-shadow .15s; position: relative; }
.list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.list-card .ribbon { position: absolute; top: 0; left: 18px; width: 14px; height: 26px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.list-card h3 { padding-top: 8px; }
.list-card .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card .stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; font-size: .8rem; color: var(--muted); } .list-card .stats b { display: block; font-size: 1.1rem; color: var(--fg); }

/* ---- tableau ---- */
.board-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.board-tools .search { flex: 1 1 220px; max-width: 320px; position: relative; } .board-tools .search input { padding-left: 34px; }
.board-tools .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.budget { margin-left: auto; font-size: .88rem; color: var(--muted); } .budget b { color: var(--fg); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 300px); gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; align-items: start; }
.col { background: var(--surface-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; min-width: 0; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 2px; }
.col-head .name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .col-head .count { font-size: .78rem; color: var(--muted); }
.wish-btn { position: relative; } .wish-btn .dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-2); }
.gift { background: var(--surface); border-radius: 9px; padding: 10px 12px; border: 1px solid transparent; box-shadow: 0 1px 0 rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 8px; scroll-margin: 20px; }
.gift:hover, .gift:focus-within { border-color: var(--line); }
.gift.flash-in { animation: flashin 1.6s ease-out; } @keyframes flashin { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 1px 0 rgba(0,0,0,.04); } }
.gift .top { display: flex; gap: 8px; align-items: flex-start; }
.gift .title { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; } .gift .title a { color: var(--muted); display: inline-flex; vertical-align: middle; } .gift .title a svg { width: 14px; height: 14px; }
.gift .note { font-weight: 400; font-size: .83rem; color: var(--muted); }
.gift .actions { display: flex; opacity: 0; transition: opacity .15s; } .gift:hover .actions, .gift:focus-within .actions { opacity: 1; }
@media (hover: none) { .gift .actions { opacity: 1; } }
.gift .bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .gift .price { margin-left: auto; font-weight: 700; font-size: .9rem; }
.gift .givers { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); } .gift .givers form { display: inline-flex; }
.status { border: 0; border-radius: 999px; padding: 3px 24px 3px 9px; font-size: .75rem; font-weight: 700; appearance: none; -webkit-appearance: none; background: var(--surface-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 3.5l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.5'/></svg>") no-repeat right 8px center; color: var(--muted); cursor: pointer; }
.status[data-s="commande"] { background-color: var(--warn-soft); color: var(--warn); } .status[data-s="recu"] { background-color: var(--ok-soft); color: var(--ok); } .status[data-s="emballe"] { background-color: var(--accent-soft); color: var(--accent); }
.wish-tag { font-size: .72rem; color: var(--gold); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; } .wish-tag svg { width: 12px; height: 12px; }
.col .add { border: 1px dashed var(--line); background: transparent; border-radius: 9px; padding: 10px; color: var(--muted); font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: center; } .col .add:hover { background: var(--surface); color: var(--fg); } .col .add svg { width: 16px; height: 16px; }
.me-col { background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, transparent 10px 20px); border: 1px dashed var(--line); align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 24px 16px; gap: 6px; min-height: 180px; }
.me-col svg { width: 36px; height: 36px; opacity: .6; } .me-col .btn { margin-top: 10px; }
.empty { text-align: center; color: var(--muted); font-size: .88rem; padding: 18px 10px; }
.quick-add, .edit-form { background: var(--surface); border-radius: 9px; padding: 10px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--accent); }
.quick-add .input, .edit-form .input { padding: 8px 10px; }

/* ---- tiroir ---- */
.scrim { position: fixed; inset: 0; background: rgba(10,20,15,.45); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); z-index: 70; box-shadow: var(--shadow); overflow: auto; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; position: sticky; top: 0; background: var(--surface); }
.drawer-head .close { margin-left: auto; } .drawer-head .back { display: none; }
.drawer-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.main > .drawer-head { border: 0; padding: 0 0 18px; position: static; background: transparent; } .main > .drawer-head .close { display: none; } .main > .drawer-head .back { display: inline-flex; margin-left: auto; }
.main > .drawer-body { padding: 0; max-width: 560px; }
.wish { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.wish .prio { width: 6px; align-self: stretch; border-radius: 3px; background: var(--line); flex: none; } .wish .prio.high { background: var(--accent); } .wish .prio.mid { background: var(--gold); }
.wish .txt { flex: 1; min-width: 0; } .wish .txt .t { font-weight: 700; overflow-wrap: anywhere; } .wish .txt .d { font-size: .85rem; color: var(--muted); }
.wish .ico { width: 14px; height: 14px; vertical-align: middle; color: var(--muted); }
.wish.taken { opacity: .7; } .wish.taken .t { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.legend { font-size: .82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--line); } .legend .h::before { background: var(--accent); } .legend .m::before { background: var(--gold); }

/* ---- mes voeux / profil ---- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 22px; align-items: start; }
.wish-form { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 20px; } .wish-form.static { position: static; }
.wish-list { display: flex; flex-direction: column; gap: 10px; } .wish-list .icon-btn { flex: none; }

/* ---- membres ---- */
.members { display: flex; flex-direction: column; }
.member { display: grid; grid-template-columns: 40px minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); } .member:first-child { border-top: 0; }
.member .who b { display: block; } .member .who span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; margin: 0; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle input:checked { background: var(--gold); } .toggle input:checked::after { left: 16px; }

/* ---- mobile ---- */
.bottom-nav { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; } .side { display: none; }
  .main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 40; justify-content: space-around; }
  .bottom-nav a { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); } .bottom-nav svg { width: 22px; height: 22px; }
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 32px 20px; } .auth-art .wire { display: none; }
  .two-col { grid-template-columns: 1fr; } .wish-form { position: static; }
  .member { grid-template-columns: 40px minmax(0,1fr); } .member .ctl { grid-column: 2; }
  .board { grid-auto-columns: 86vw; scroll-snap-type: x mandatory; } .budget { margin-left: 0; flex-basis: 100%; }
  h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
