/* =========================================================================
   Mes Premières Histoires — feuille de style unique
   Design « doux et épuré » : pas de bordures dures, cartes blanches arrondies,
   ombres légères, une seule police ronde (Nunito), couleurs pastel.
   Les valeurs reprennent l'échelle Tailwind (slate, emerald, indigo, rounded-2xl…).
   1. Jetons  2. Base  3. Composants  4. Mise en page  5. Checklist
   6. Authentification  7. Réglages & administration  8. Utilitaires
   ========================================================================= */

/* 1. Jetons ---------------------------------------------------------------- */
:root {
  --paper: #F8FAFC;          /* slate-50 */
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;      /* champs, survols */
  --surface-3: #F1F5F9;      /* slate-100 */
  --ink: #1E293B;            /* slate-800 */
  --ink-soft: #475569;       /* slate-600 : titres non cochés */
  --muted: #475569;          /* slate-600 : textes secondaires (7,6:1) */
  --faint: #64748B;          /* slate-500 : textes discrets, encore lisibles (4,8:1) */
  --deco: #CBD5E1;           /* slate-300 : décor seulement, jamais du texte */
  --control: #8592A6;        /* bord des cases à cocher (3,2:1, seuil WCAG des contrôles) */
  --accent: #6366F1;         /* indigo-500 */
  --accent-strong: #4F46E5;  /* indigo-600 */
  --accent-ink: #FFFFFF;
  --accent-soft: #EEF2FF;    /* indigo-50 */
  --accent-line: #C7D2FE;    /* indigo-200 */
  --have: #34D399;           /* emerald-400 : progression */
  --have-box: #059669;       /* emerald-600 : case cochée (coche blanche à 3,8:1) */
  --have-box-ink: #FFFFFF;
  --have-ink: #047857;       /* emerald-700 : texte sur fond vert */
  --have-soft: #ECFDF5;      /* emerald-50 : ligne acquise */
  --track: #F1F5F9;          /* fond des barres */
  --new: #C2410C; --new-soft: #FFF7ED;
  --danger: #E11D48; --danger-soft: #FFF1F2;
  --hairline: rgba(15, 23, 42, .06);   /* séparateur quasi invisible, à la place des bordures */
  --ring: rgba(99, 102, 241, .35);
  --shadow: 0 2px 10px rgba(15, 23, 42, .05);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --radius: 20px;            /* rounded-2xl et un peu plus */
  --radius-md: 14px;         /* rounded-xl */
  --radius-sm: 12px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tap: 46px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F172A; --surface: #1E293B; --surface-2: #273449; --surface-3: #334155;
    --ink: #F1F5F9; --ink-soft: #CBD5E1; --muted: #CBD5E1; --faint: #A3B1C4; --deco: #475569; --control: #7C8BA1;
    --accent: #A5B4FC; --accent-strong: #C7D2FE; --accent-ink: #1E1B4B; --accent-soft: rgba(165, 180, 252, .14); --accent-line: rgba(165, 180, 252, .3);
    --have: #6EE7B7; --have-ink: #A7F3D0; --have-box: #34D399; --have-box-ink: #064E3B; --have-box: #34D399; --have-box-ink: #064E3B; --have-soft: rgba(110, 231, 183, .09); --track: #334155;
    --new: #FDBA74; --new-soft: rgba(253, 186, 116, .12);
    --danger: #FDA4AF; --danger-soft: rgba(253, 164, 175, .12);
    --hairline: rgba(255, 255, 255, .06); --ring: rgba(165, 180, 252, .45);
    --shadow: 0 2px 10px rgba(0, 0, 0, .25); --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F172A; --surface: #1E293B; --surface-2: #273449; --surface-3: #334155;
  --ink: #F1F5F9; --ink-soft: #CBD5E1; --muted: #CBD5E1; --faint: #A3B1C4; --deco: #475569; --control: #7C8BA1;
  --accent: #A5B4FC; --accent-strong: #C7D2FE; --accent-ink: #1E1B4B; --accent-soft: rgba(165, 180, 252, .14); --accent-line: rgba(165, 180, 252, .3);
  --have: #6EE7B7; --have-ink: #A7F3D0; --have-soft: rgba(110, 231, 183, .09); --track: #334155;
  --new: #FDBA74; --new-soft: rgba(253, 186, 116, .12);
  --danger: #FDA4AF; --danger-soft: rgba(253, 164, 175, .12);
  --hairline: rgba(255, 255, 255, .06); --ring: rgba(165, 180, 252, .45);
  --shadow: 0 2px 10px rgba(0, 0, 0, .25); --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15.5px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-family: var(--font); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
::selection { background: var(--accent-soft); }
.boot { padding: 56px 20px; text-align: center; color: var(--muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.svg-icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* 3. Composants ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--surface-3); color: var(--ink);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .1s, color .15s;
}
.btn:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--faint)); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent-strong); color: var(--accent-ink); box-shadow: 0 4px 14px -4px var(--ring); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger-soft) 80%, var(--danger)); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.small { min-height: 34px; padding: 5px 13px; font-size: 13px; }
.btn.icon { padding: 0; width: 42px; }
.btn.icon.small { width: 34px; }
.btn.block { width: 100%; }

/* Filtres en pilules : actif = fond doux coloré, inactif = transparent, gris au survol. */
.chip {
  min-height: 36px; padding: 6px 15px; border-radius: 999px; cursor: pointer;
  border: 0; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--surface-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.chip .n { font-variant-numeric: tabular-nums; font-size: 12.5px; opacity: .75; }
.chip:disabled { opacity: .4; cursor: default; background: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-strong);
}
.badge.new { background: var(--new-soft); color: var(--new); }
.badge.ok { background: var(--have-soft); color: var(--have-ink); }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field > label, .field > .label { font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.field .hint { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 11px 14px; border-radius: var(--radius-sm);
  border: 0; background: var(--surface-3); color: var(--ink);
  transition: background .15s, box-shadow .15s;
}
.input::placeholder { color: var(--faint); }
.input:hover { background: color-mix(in srgb, var(--surface-3) 85%, var(--faint)); }
.input:focus-visible, .input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--ring); }
.input:disabled { opacity: .6; }
textarea.input { min-height: 150px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 50px; }
.password-wrap .btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.strength i { height: 5px; border-radius: 999px; background: var(--track); }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #FDBA74; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--have); }
.strength[data-score="4"] i { background: var(--have); }

.alert {
  padding: 14px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--ink);
}
.alert.error { background: var(--danger-soft); }
.alert.ok { background: var(--have-soft); }

.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 28px; }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.card .lead { color: var(--muted); margin: 6px 0 22px; font-size: 14.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

dialog.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  border: 0; border-radius: 24px; padding: 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(15, 23, 42, .35); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: pop .2s ease-out; }
.modal-head { padding: 24px 24px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 20px; font-weight: 800; flex: 1; }
.modal-body { padding: 16px 24px 4px; }
.modal-foot { padding: 14px 24px 24px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts {
  position: fixed; z-index: 100; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 16px; min-height: 52px;
  background: #1E293B; color: #F8FAFC; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
  animation: toast-in .2s ease-out;
}
.toast.error { background: #BE123C; color: #fff; }
.toast .msg { flex: 1; }
.toast .btn { background: rgba(255, 255, 255, .12); color: inherit; }
.toast .btn:hover { background: rgba(255, 255, 255, .2); }
.toast.leaving { animation: toast-out .18s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

.codes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0;
  padding: 16px; border-radius: var(--radius-md); background: var(--surface-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .06em;
}
.codes span { text-align: center; padding: 4px; }
.linkbox { display: flex; gap: 8px; }
.linkbox .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* 4. Mise en page ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
}
.topbar-in {
  max-width: 920px; margin: 0 auto; padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand span { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 14px;
  border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; font-size: 13px; text-decoration: none;
}
.page { max-width: 920px; margin: 0 auto; padding: 0 20px 110px; }
@media (max-width: 560px) {
  .page { padding: 0 14px 100px; }
  .topbar-in { padding-left: 14px; padding-right: 14px; }
  .nav .label { display: none; }
  .brand span { display: none; }
}

/* 5. Checklist ------------------------------------------------------------- */
.mast { padding: 40px 4px 8px; }
.kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin: 0 0 12px; }
.mast h1 { font-size: clamp(28px, 5.2vw, 42px); font-weight: 800; line-height: 1.1; letter-spacing: -.025em; }
.mast h1 em { font-style: normal; font-weight: 800; color: var(--accent); }

.recent { margin-top: 22px; display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); align-self: center; white-space: nowrap; padding-right: 4px; }
.recent-item {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow); font-size: 14px; max-width: 250px;
}
.recent-item b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item span { color: var(--muted); font-size: 12.5px; }

.bar {
  position: sticky; top: 62px; z-index: 20; margin-top: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
}
.tally { display: flex; align-items: baseline; gap: 10px; }
.tally .n { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tally .of { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tally .summary { color: var(--faint); }
.tally .summary::before { content: " · "; }
.sync { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--have); }
.sync[data-state="saving"] i { background: var(--accent); animation: pulse 1s infinite; }
.sync[data-state="offline"] i, .sync[data-state="error"] i { background: #FDBA74; }
@keyframes pulse { 50% { opacity: .3; } }
/* Barres de progression : plus épaisses, totalement arrondies, vert pastel sur gris très clair. */
.meter { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #A7F3D0, var(--have)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 240px; min-width: 0; }
.search .svg-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; padding: 10px 44px 10px 42px; border-radius: 999px;
  border: 0; background: var(--surface-3); transition: background .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 3px var(--ring); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .bar { top: 58px; padding: 14px; gap: 12px; border-radius: 18px; }
  .tally .n { font-size: 24px; }
  .bar .hide-mobile { display: none; }
  .chips { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 24px; mask-image: linear-gradient(90deg, #000 82%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 6px 13px; }
}

.readonly-note { margin-top: 18px; }
@media (max-width: 560px) {
  .mast { padding: 18px 2px 2px; }
  .kicker { display: none; }
  .mast h1 { font-size: 24px; }
  .recent { margin-top: 14px; }
  .bar { margin-top: 12px; }
  .tally .summary { display: block; margin-top: 2px; font-size: 13px; }
  .tally .summary::before { content: none; }
  .tally { flex-wrap: wrap; }
}

section.type { margin-top: 22px; overflow: hidden; }
.type-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 22px 24px 8px; cursor: pointer;
  background: none; border: 0; text-align: left;
}
.type-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.015em; flex: 1 1 auto; }
.type-head .count { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chev { transition: transform .2s; color: var(--faint); }
.type-head:hover .chev, .univers-head:hover .chev { color: var(--ink-soft); }
[aria-expanded="false"] > .chev { transform: rotate(-90deg); }
.type-sub { margin: 0 24px 14px; font-size: 14px; color: var(--muted); }
.type-body { padding: 4px 12px 14px; }
@media (max-width: 560px) {
  .type-head { flex-wrap: wrap; row-gap: 8px; padding: 20px 18px 6px; }
  .type-head h2 { flex-basis: 100%; font-size: 19px; }
  .type-head .count { margin-left: auto; }
  .type-sub { margin: 0 18px 12px; }
  .type-body { padding: 2px 8px 10px; }
}

.univers + .univers { margin-top: 8px; }
.univers-head {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 12px 10px;
  background: none; border: 0; cursor: pointer; text-align: left; border-radius: var(--radius-sm);
}
/* Titres de catégories : petits, majuscules, espacés, gris discret. */
.univers-head h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.univers-head .mini { flex: 1; max-width: 110px; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; margin-left: auto; }
.univers-head .mini i { display: block; height: 100%; border-radius: 999px; background: var(--have); }
.univers-head .count { font-size: 12.5px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.univers.complete .univers-head h3::after { content: " ✓"; color: var(--have); letter-spacing: 0; }

ul.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.item { position: relative; }
.item label {
  display: flex; gap: 14px; align-items: center; min-height: 56px; padding: 10px 14px; cursor: pointer;
  border-radius: var(--radius-md); transition: background .2s;
}
.item label:hover { background: var(--surface-2); }
.item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.item input:disabled + .box { opacity: .55; }
.item input:focus-visible + .box { box-shadow: 0 0 0 3px var(--ring); }
.box {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--control);
  color: #fff; transition: background .2s, box-shadow .2s, transform .15s;
}
.item label:hover .box { box-shadow: inset 0 0 0 2px var(--ink-soft); }
.box .svg-icon { width: 16px; height: 16px; stroke-width: 2.6; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.cover {
  flex: 0 0 auto; width: 40px; height: 42px; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-3); color: var(--faint); font-weight: 800; font-size: 15px;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.t { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.t .name { font-weight: 600; color: var(--ink-soft); }
.t .meta { font-size: 13px; color: var(--faint); }
.t .when { font-size: 12.5px; color: var(--have-ink); font-weight: 600; }
/* Livre acquis : ligne vert d'eau très pâle, case pleine, texte net. */
.item.have label { background: var(--have-soft); }
.item.have label:hover { background: color-mix(in srgb, var(--have-soft) 92%, var(--have)); }
.item.have .box { background: var(--have-box); box-shadow: none; color: var(--have-box-ink); }
.item.have .box .svg-icon { opacity: 1; transform: scale(1); }
.item.have .name { color: var(--ink); }
.item.just .box { animation: bounce .35s ease; }
@keyframes bounce { 40% { transform: scale(1.2); } }

.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 17px; font-weight: 800; margin-bottom: 6px; }

/* Bouton magasin flottant : téléphone uniquement (sur ordinateur, la pilule « En magasin » suffit). */
.fab {
  display: none; position: fixed; z-index: 40; right: 16px; bottom: max(18px, env(safe-area-inset-bottom));
  align-items: center; gap: 9px; min-height: 52px; padding: 0 20px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent-strong); color: var(--accent-ink); font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px -8px var(--ring), var(--shadow-lg);
}
.fab .svg-icon { width: 20px; height: 20px; }
.fab[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 560px) {
  .fab { display: inline-flex; }
  .shop-chip { display: none; }
  .toasts { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 64px); }
}

/* Mode magasin : seulement ce qui manque, en grand. */
.shop-banner {
  margin-top: 22px; padding: 20px 24px; border-radius: var(--radius); display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--accent-soft); color: var(--ink);
}
.shop-banner > .svg-icon { width: 26px; height: 26px; color: var(--accent); }
.shop-banner strong { font-size: 20px; font-weight: 800; }
.shop-banner .small { color: var(--muted); }
.shop-banner .btn { background: var(--surface); margin-left: auto; box-shadow: var(--shadow); }
.shopping .item label { min-height: 66px; font-size: 17px; }
.shopping .box { width: 32px; height: 32px; border-radius: 10px; }
.shopping .cover { width: 48px; height: 52px; }
.shopping .univers-head { pointer-events: none; }
.shopping .univers-head .chev, .shopping .univers-head .mini, .shopping .univers-head .count { display: none; }

.notes { margin-top: 40px; padding: 0 4px; font-size: 13px; color: var(--faint); line-height: 1.75; }
.notes p { margin: 0 0 10px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i {
  position: absolute; width: 8px; height: 12px; border-radius: 3px; opacity: 0;
  animation: confetti 1.1s ease-out forwards;
}
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

/* 6. Authentification ------------------------------------------------------ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.auth-card { width: min(430px, 100%); padding: 36px 30px; border-radius: 28px; }
.auth-logo { width: 54px; height: 54px; margin-bottom: 20px; border-radius: 16px; }
.auth-card h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 26px; }
.auth-links { margin-top: 22px; display: grid; gap: 10px; text-align: center; font-size: 14px; }

/* 7. Réglages & administration --------------------------------------------- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding-top: 32px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: grid; gap: 4px; }
.settings-nav h2 { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 18px 14px 8px; }
.settings-nav h2:first-child { margin-top: 0; }
.settings-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: var(--radius-md);
  color: var(--muted); text-decoration: none; font-weight: 600; transition: background .15s, color .15s;
}
.settings-nav a:hover { background: var(--surface-3); color: var(--ink); }
.settings-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.settings-main { min-width: 0; }
.settings-main > h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 20px; }
@media (max-width: 760px) {
  .settings { grid-template-columns: 1fr; padding-top: 18px; gap: 16px; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding: 2px 2px 6px; scrollbar-width: none; }
  .settings-nav h2 { display: none; }
  .settings-nav a { white-space: nowrap; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; }
}

.list { list-style: none; margin: 0; padding: 8px 12px 12px; display: grid; gap: 4px; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); flex-wrap: wrap; transition: background .15s; }
.list > li:hover { background: var(--surface-2); }
.list .grow { flex: 1 1 200px; min-width: 0; }
.list .title { font-weight: 700; }
.list .sub { color: var(--muted); font-size: 13.5px; }
.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-3); gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Éditeur de catalogue */
.editor-section { padding: 0; overflow: hidden; }
.editor-section > header { padding: 24px 24px 18px; display: grid; gap: 6px; background: var(--surface-2); }
.editor-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.editor-group { padding: 18px 24px 20px; }
.editor-group + .editor-group { box-shadow: inset 0 1px 0 var(--hairline); }
.editor-group > .row { margin-bottom: 10px; }
.editor-item { display: grid; grid-template-columns: 46px 2fr 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.editor-item .input { min-height: 40px; padding: 8px 12px; }
.editor-item .cover { width: 46px; height: 48px; cursor: pointer; border: 0; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--faint) 40%, transparent); }
.editor-item .id { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; padding-left: 4px; }
.editor-item .actions { display: flex; gap: 2px; }
.move { position: relative; }
.move > summary { list-style: none; }
.move > summary::-webkit-details-marker { display: none; }
.move[open] > select { position: absolute; right: 0; top: 100%; z-index: 5; width: min(300px, 80vw); box-shadow: var(--shadow-lg); background: var(--surface); }
.editor-item.checked .title-input { box-shadow: inset 3px 0 0 var(--have); }
@media (max-width: 640px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-item { grid-template-columns: 46px 1fr; }
  .editor-item .meta-input { grid-column: 2; }
  .editor-item .actions { grid-column: 1 / -1; justify-content: flex-end; }
}
.savebar {
  position: sticky; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 25; margin-top: 20px;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-radius: 999px;
  background: #1E293B; color: #F8FAFC; box-shadow: var(--shadow-lg); font-weight: 600;
}
.savebar .btn:not(.primary) { background: rgba(255, 255, 255, .12); color: inherit; }

.journal li { font-size: 14px; }
.journal time { color: var(--faint); font-size: 12.5px; min-width: 120px; font-variant-numeric: tabular-nums; }

/* 8. Utilitaires ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
