:root {
  --pink: #ff4f9a;
  --pink-deep: #e0307f;
  --pink-soft: #ffd6e8;
  --pink-bg: #fff2f8;
  --lilac: #b884ff;
  --ink: #5a2347;
  --ink-soft: #9a5c82;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 8px 24px rgba(224, 48, 127, .18);
  --font: "Fredoka", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #fff 0 1.5px, transparent 2px) 0 0 / 46px 46px,
    radial-gradient(circle at 70% 60%, #ffe9f4 0 1px, transparent 1.6px) 0 0 / 31px 31px,
    linear-gradient(160deg, #ffe3f1 0%, #ffd0e9 45%, #f1dcff 100%) fixed;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Paillettes ---------- */
.sparkles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sparkles i {
  position: absolute; font-style: normal; color: #fff;
  text-shadow: 0 0 6px #ff9cc9, 0 0 12px #fff;
  animation: twinkle 2.8s ease-in-out infinite;
  opacity: 0;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); }
  50% { opacity: .95; transform: scale(1) rotate(25deg); }
}

/* ---------- En-tête ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 6px;
  max-width: 1200px; margin: 0 auto;
}
h1 { margin: 0; line-height: 1; display: flex; flex-direction: column; }
.t-small { font-size: 15px; font-weight: 600; color: var(--ink-soft); letter-spacing: .3px; margin-left: 4px; }
.t-name {
  font-family: "Pacifico", cursive; font-weight: 400;
  font-size: clamp(38px, 9vw, 56px); line-height: 1.25;
  background: linear-gradient(100deg, #ff3d8f 0%, #ff6fb0 20%, #ffd0e6 30%, #ff6fb0 40%, #c86bff 60%, #ff3d8f 80%, #ff8fc4 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 4.5s linear infinite;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 3px 6px rgba(224, 48, 127, .35));
  padding-right: 6px;
}
@keyframes shimmer { to { background-position: -250% 0; } }
.subtitle { margin: 2px 0 0 4px; font-weight: 500; color: var(--ink-soft); font-size: 15px; }

.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: var(--shadow); font-size: 20px; flex: none;
}

/* ---------- Jours ---------- */
.days {
  position: relative; z-index: 2;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px 16px 12px; max-width: 1200px; margin: 0 auto;
  scroll-snap-type: x proximity;
}
.days::-webkit-scrollbar { display: none; }
.day {
  --c: var(--pink);
  flex: none; scroll-snap-align: center;
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid #fff; background: rgba(255, 255, 255, .7);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px;
  text-transform: capitalize; color: var(--ink);
  transition: transform .15s, background .15s;
}
.day i {
  font-style: normal; font-size: 12px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--c); color: #fff; display: grid; place-items: center;
}
.day.on { background: var(--c); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 45%, transparent); transform: translateY(-1px); }
.day.on i { background: #fff; color: var(--c); }

/* ---------- Mise en page ---------- */
.layout {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: grid; gap: 16px;
}
.layout > * { min-width: 0; }
.map-card {
  position: relative;
  border-radius: 28px; overflow: hidden;
  border: 4px solid #fff;
  box-shadow: var(--shadow), 0 0 0 2px var(--pink-soft);
}
#map { height: 46vh; min-height: 280px; background: #fde7f1; }

.pick-hint {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 1000;
  background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 10px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow);
}
.pick-hint button { border: 0; border-radius: 999px; padding: 6px 12px; background: #fff; color: var(--ink); font-weight: 600; }
.pick-hint[hidden] { display: none; }
body.picking #map { cursor: crosshair; }

@media (min-width: 900px) {
  .layout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .map-card { position: sticky; top: 16px; }
  #map { height: calc(100vh - 200px); }
}

/* ---------- Épingles ---------- */
.pin-wrap { background: none; border: 0; }
.pin {
  --c: var(--pink);
  width: 40px; height: 40px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--c); border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(90, 35, 71, .35);
  display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); font-size: 19px; line-height: 1; }
.pin-n {
  position: absolute; top: -8px; right: -8px;
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px;
  background: #fff; color: var(--c); border: 2px solid var(--c);
  font: 700 12px/18px var(--font); text-align: center;
}

/* ---------- Liste ---------- */
.list h2 { margin: 4px 4px 10px; font-size: 22px; text-transform: none; }
.day-sep {
  --c: var(--pink);
  margin: 18px 4px 8px; font-size: 16px; color: var(--c);
  display: flex; align-items: center; gap: 8px;
}
.day-sep::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--c), transparent); }

.vcard {
  --c: var(--pink);
  width: 100%; text-align: left; position: relative;
  display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: var(--radius); background: var(--card);
  padding: 10px 14px 10px 10px; margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(224, 48, 127, .12);
  border-left: 6px solid var(--c);
  transition: transform .12s;
}
.vcard:active { transform: scale(.98); }
.vnum {
  position: absolute; top: -6px; left: -8px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff;
  font-size: 13px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.vthumb { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; flex: none; }
.vthumb-emoji { display: grid; place-items: center; font-size: 30px; background: var(--pink-bg); }
.vbody { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.vbody strong { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbody small { color: var(--ink-soft); font-size: 14px; }
.vmeta { font-size: 15px; min-height: 1em; }
.badge { font-style: normal; font-size: 12px; font-weight: 600; color: var(--c); background: var(--pink-bg); border-radius: 999px; padding: 2px 8px; }

.empty {
  text-align: center; background: rgba(255, 255, 255, .75); border-radius: var(--radius);
  padding: 26px 18px; border: 2px dashed #ffb3d4;
}
.empty-emoji { font-size: 52px; animation: hop 1.6s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) rotate(-6deg); } }
.empty p { margin: 6px 0; }

/* ---------- Bouton + ---------- */
.fab {
  position: fixed; z-index: 1100; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  border: 3px solid #fff; border-radius: 999px;
  padding: 14px 26px; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--pink) 0%, #ff7eb8 45%, var(--lilac) 100%);
  box-shadow: 0 10px 26px rgba(224, 48, 127, .45);
  overflow: hidden; white-space: nowrap;
}
.fab span { font-size: 22px; vertical-align: -2px; }
.fab::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }

/* ---------- Feuilles (dialogues) ---------- */
dialog { color: var(--ink); }
.sheet {
  border: 0; padding: 0; border-radius: 28px;
  width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 24px);
  background: #fff; box-shadow: 0 20px 60px rgba(90, 35, 71, .35);
}
.sheet::backdrop { background: rgba(255, 120, 180, .35); backdrop-filter: blur(3px); }
.sheet[open] { animation: pop .22s ease-out; }
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.sheet-in {
  padding: 18px 18px 20px;
  background:
    radial-gradient(circle at 92% 6%, #ffe0ef 0 60px, transparent 61px),
    #fff;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sheet-head h2 { margin: 0; font-size: 24px; }
.close {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--pink-bg); font-size: 18px; font-weight: 700; color: var(--pink-deep);
}

.label { display: block; margin: 12px 2px 6px; font-weight: 600; font-size: 15px; color: var(--ink-soft); }
.field { display: block; }
.field input, .field select, .when select, .when input, textarea {
  width: 100%; border: 2px solid var(--pink-soft); border-radius: 16px;
  padding: 12px 14px; font-size: 17px; background: var(--pink-bg); outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, textarea:focus, .when select:focus, .when input:focus { border-color: var(--pink); background: #fff; }
.row2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }

.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chips label { position: relative; }
.type-chips input { position: absolute; opacity: 0; pointer-events: none; }
.type-chips span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; background: var(--pink-bg);
  border: 2px solid var(--pink-soft); font-weight: 500; font-size: 15px; cursor: pointer;
}
.type-chips input:checked + span { background: var(--pink); border-color: var(--pink); color: #fff; }
.type-chips input:focus-visible + span { outline: 3px solid var(--lilac); }

.btn-main {
  display: block; width: 100%; margin-top: 18px;
  border: 0; border-radius: 18px; padding: 15px; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--pink), var(--lilac));
  box-shadow: 0 8px 20px rgba(224, 48, 127, .35);
}
.btn-soft {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--pink-soft); background: var(--pink-bg); color: var(--ink);
  border-radius: 16px; padding: 11px 14px; font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn-soft.danger { color: #c2185b; }
.btn-soft.wide { width: 100%; margin-top: 10px; }
.hint { color: var(--ink-soft); margin: 4px 2px 8px; }

.results { margin-top: 14px; display: grid; gap: 8px; }
.results p { margin: 4px 2px; font-weight: 500; }
.res {
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  border: 2px solid var(--pink-soft); background: #fff; border-radius: 16px; padding: 11px 12px; font-size: 15px;
}
.res:hover { border-color: var(--pink); background: var(--pink-bg); }
.res.manual { background: var(--pink-bg); justify-content: center; font-weight: 600; }
.loading { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ---------- Fiche ---------- */
#ficheDlg { --c: var(--pink); }
.fiche-head { align-items: flex-start; }
.f-emoji {
  flex: none; width: 54px; height: 54px; border-radius: 18px; font-size: 30px;
  display: grid; place-items: center; background: var(--c); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 40%, transparent);
}
.f-titles { flex: 1; min-width: 0; }
.f-titles h2 { font-size: 22px; line-height: 1.2; word-wrap: break-word; }
.f-titles p { margin: 3px 0 0; color: var(--ink-soft); font-size: 14px; text-transform: none; }
.approx { background: #fff6d9; border-radius: 14px; padding: 8px 12px; font-size: 14px; margin: 4px 0 8px; }
.when { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin: 4px 0; }
.when select, .when input { padding: 8px 12px; font-size: 15px; }

.block { margin-top: 14px; }
.block h3 { margin: 0 0 8px 2px; font-size: 17px; }
.block h3 small { color: var(--ink-soft); font-weight: 500; }

.thumbs { display: flex; gap: 6px; }
.thumbs button {
  flex: 1; max-width: 64px; aspect-ratio: 1; border-radius: 18px; border: 2px solid var(--pink-soft);
  background: var(--pink-bg); font-size: 26px; filter: grayscale(1); opacity: .45;
  transition: transform .15s, filter .15s, opacity .15s;
}
.thumbs button.on { filter: none; opacity: 1; background: #fff; border-color: var(--pink); transform: scale(1.06); }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button {
  aspect-ratio: 1; border-radius: 14px; border: 2px solid transparent; background: var(--pink-bg);
  font-size: 22px; padding: 0; transition: transform .12s;
}
.emoji-grid button.on { border-color: var(--pink); background: #fff; transform: scale(1.1); box-shadow: 0 4px 10px rgba(224, 48, 127, .25); }
@media (max-width: 380px) { .emoji-grid { grid-template-columns: repeat(6, 1fr); } }

textarea { resize: vertical; min-height: 100px; line-height: 1.4; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(90, 35, 71, .2); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .9); color: #c2185b; font-weight: 700; font-size: 14px;
}
.add-photo {
  aspect-ratio: 1; border-radius: 16px; border: 3px dashed #ffa6cc; background: var(--pink-bg);
  display: grid; place-items: center; text-align: center; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--pink-deep);
}
.add-photo b { display: block; font-size: 28px; }

.fiche-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.fiche-actions .btn-soft { flex: 1; }

/* ---------- Visionneuse ---------- */
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.viewer::backdrop { background: rgba(40, 10, 30, .85); }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 18px; border: 4px solid #fff; display: block; }

/* ---------- Toast & confettis ---------- */
.toast {
  position: fixed; z-index: 3000; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 500;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; z-index: 4000; pointer-events: none; font-size: 22px; left: 50%; top: 45%; animation: fly 1.1s ease-out forwards; }
@keyframes fly {
  from { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1) rotate(var(--r)); opacity: 0; }
}

.leaflet-container { font-family: var(--font); }
.leaflet-tile-pane { filter: saturate(.8) brightness(1.04) hue-rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .sparkles i { opacity: .6; }
}

/* ---------- Nuage / connexion / vue famille ---------- */
.sync { margin: 4px 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); min-height: 1em; }
.sync[data-state="ok"] { color: #2e9e6a; }
.sync[data-state="error"] { color: #c2185b; }

.login {
  position: fixed; inset: 0; z-index: 5000;
  display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, #ffe3f1 0%, #ffd0e9 45%, #f1dcff 100%);
}
.login[hidden] { display: none; }
.login-card {
  width: min(420px, 100%); background: #fff; border-radius: 28px; padding: 26px 22px;
  box-shadow: var(--shadow); text-align: center; border: 4px solid #fff;
  outline: 2px solid var(--pink-soft);
}
.login-card form { text-align: left; }
.login-emoji { font-size: 46px; animation: hop 1.6s ease-in-out infinite; }
.login-card h2 { margin: 6px 0 4px; font-family: "Pacifico", cursive; font-weight: 400; color: var(--pink); font-size: 30px; }
.login-card > p { margin: 0 0 8px; color: var(--ink-soft); }
.login-err { min-height: 1.3em; margin: 10px 2px 0; font-weight: 600; color: #c2185b; text-align: center; }

.share-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.share-box[hidden] { display: none; }
.share-box input { min-width: 0; border: 2px solid var(--pink-soft); border-radius: 14px; padding: 10px; font-size: 13px; background: var(--pink-bg); }
.share-box .hint { grid-column: 1 / -1; font-size: 13px; margin: 0 2px; }
.btn-soft.subtle { background: #fff; color: var(--ink-soft); font-weight: 500; }

.nothing { text-align: center; color: var(--ink-soft); background: var(--pink-bg); border-radius: 16px; padding: 14px; }
.only-read { display: none; }
body.readonly .only-read { display: inline; }
body.readonly .only-edit { display: none; }
body.readonly .fab,
body.readonly #menuBtn,
body.readonly .when,
body.readonly .fiche-actions,
body.readonly .emoji-grid button:not(.on),
body.readonly .thumbs button:not(.on) { display: none; }
body.readonly .thumbs button, body.readonly .emoji-grid button { pointer-events: none; }
body.readonly .emoji-grid { display: flex; flex-wrap: wrap; }
body.readonly .emoji-grid button { width: 46px; }
body.readonly textarea { background: #fff; border-style: dashed; resize: none; }
body.readonly { padding-bottom: 24px; }

/* ---------- Fil de messages (fiche) ---------- */
.thread { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; margin-bottom: 10px; }
.thread-empty { margin: 4px 2px; color: var(--ink-soft); }
.msg {
  border-radius: 18px; padding: 8px 12px 10px; max-width: 92%;
  background: var(--pink-bg); border: 2px solid var(--pink-soft);
}
.msg.note { justify-self: start; border-bottom-left-radius: 6px; }
.msg.family { justify-self: end; background: #f3eaff; border-color: #e1cfff; border-bottom-right-radius: 6px; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.msg-head b { color: var(--pink-deep); }
.msg.family .msg-head b { color: #7b3fd0; }
.msg-head time { color: var(--ink-soft); flex: 1; }
.msg-del { border: 0; background: none; color: var(--ink-soft); font-size: 13px; padding: 2px 4px; border-radius: 8px; }
.msg-del:hover { background: #fff; color: #c2185b; }
.msg p { margin: 4px 0 0; white-space: pre-wrap; word-wrap: break-word; line-height: 1.35; }

.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.composer textarea { min-height: 52px; font-size: 16px; }
.btn-post {
  border: 0; border-radius: 16px; padding: 13px 14px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(120deg, var(--pink), var(--lilac)); box-shadow: 0 6px 14px rgba(224, 48, 127, .3);
}
.btn-post:disabled { opacity: .5; }
body.readonly #fNew { border-style: solid; background: var(--pink-bg); resize: vertical; }

.likes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.likes[hidden] { display: none; }
.like-btn {
  border: 2px solid var(--pink-soft); background: #fff; border-radius: 999px; padding: 7px 14px;
  font-weight: 700; color: var(--pink-deep); transition: transform .12s;
}
.like-btn.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.like-btn:active { transform: scale(.94); }

/* ---------- Onglets Étapes / Fil d'actualités ---------- */
.view-tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .6); padding: 4px; border-radius: 999px; margin: 0 0 10px; width: fit-content; max-width: 100%; }
.view-tabs button { border: 0; background: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 15px; color: var(--ink-soft); }
.view-tabs button.on { background: #fff; color: var(--pink-deep); box-shadow: 0 3px 10px rgba(224, 48, 127, .18); }

/* ---------- Fil d'actualités ---------- */
.feed-item {
  --c: var(--pink);
  display: block; width: 100%; text-align: left; border: 0; margin-bottom: 10px;
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 4px 14px rgba(224, 48, 127, .12); border-top: 5px solid var(--c);
}
.feed-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.feed-place { font-weight: 600; font-size: 15px; color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-head time { font-size: 12px; color: var(--ink-soft); flex: none; }
.feed-who { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.feed-text { margin: 6px 0 0; white-space: pre-wrap; word-wrap: break-word; line-height: 1.35; }
.feed-text.family { background: #f3eaff; border-radius: 12px; padding: 6px 10px; }
.feed-text.family b { color: #7b3fd0; }
.feed-text.like { color: var(--ink-soft); }
.feed-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-top: 8px; }
.feed-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

/* ---------- Légendes des photos ---------- */
.photo-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px;
  font-size: 11px; font-weight: 500; color: #fff; line-height: 1.2;
  background: linear-gradient(transparent, rgba(40, 10, 30, .75));
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  pointer-events: none;
}
.caption-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 2px solid var(--pink-soft); border-radius: 999px; padding: 4px 4px 4px 14px;
}
.caption-box input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 16px; padding: 8px 0; }
.caption-box:focus-within { border-color: var(--pink); }
.send-round {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; color: #fff; font-weight: 700; font-size: 18px;
  background: linear-gradient(120deg, var(--pink), var(--lilac));
}

.photo-preview { display: grid; gap: 14px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.preview-item { display: grid; gap: 8px; }
.preview-item img { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 18px; background: #2a0f22; }

/* Photo en grand */
.viewer { max-width: 100vw; max-height: 100dvh; overflow: visible; }
.viewer-fig { margin: 0; display: grid; gap: 10px; justify-items: center; }
.viewer img { max-width: 94vw; max-height: 74dvh; }
.viewer figcaption { width: min(94vw, 560px); }
.viewer-cap { margin: 0; color: #fff; font-size: 17px; text-align: center; white-space: pre-wrap; line-height: 1.35; }
.viewer-cap[hidden], .caption-box[hidden] { display: none; }
.viewer-close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92);
  color: var(--pink-deep); font-size: 18px; font-weight: 700;
}
.feed-cap { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.feed-cap::before { content: "📸 "; }

/* ---------- Choix de la langue ---------- */
.top-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.lang-switch { display: inline-flex; background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 3px; box-shadow: 0 3px 10px rgba(224, 48, 127, .15); }
.lang-switch button {
  border: 0; background: none; border-radius: 999px; padding: 6px 10px;
  font-weight: 700; font-size: 13px; color: var(--ink-soft); white-space: nowrap;
}
.lang-switch button.on { background: var(--pink); color: #fff; }
.login-lang { margin: -6px auto 6px; }
@media (min-width: 600px) { .top-actions { flex-direction: row; align-items: center; } }

/* ---------- Road map : carte façon film d'aventure ---------- */
.view-tabs { overflow-x: auto; scrollbar-width: none; }
.view-tabs button { white-space: nowrap; }
.roadmap-view[hidden] { display: none; }
.rm-frame {
  position: relative; border-radius: 10px; overflow: hidden;
  border: 6px solid #6b4a1f;
  outline: 2px solid #c9a86a; outline-offset: -12px;
  box-shadow: 0 10px 26px rgba(70, 40, 10, .35), inset 0 0 0 2px #e9d29c;
  background: #e8d5a6;
}
#roadmap { height: 62vh; min-height: 340px; background: #e8d5a6; }
#roadmap .leaflet-tile-pane { filter: sepia(.85) saturate(1.25) hue-rotate(-12deg) contrast(.92) brightness(.97); }
.rm-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 450;
  background:
    radial-gradient(ellipse at center, transparent 52%, rgba(110, 66, 18, .28) 80%, rgba(70, 38, 8, .62) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.rm-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 460; pointer-events: none;
  background: linear-gradient(#f3e2b8, #e2c98e); color: #4a2c0c;
  font-family: "IM Fell English SC", Georgia, serif; text-align: center; line-height: 1.05;
  padding: 6px 22px 7px; border: 2px solid #6b4a1f; border-radius: 4px;
  box-shadow: 0 4px 10px rgba(70, 40, 10, .35); white-space: nowrap;
}
.rm-banner::before, .rm-banner::after {
  content: ""; position: absolute; top: 8px; width: 16px; height: 100%; background: #c9a86a; border: 2px solid #6b4a1f; z-index: -1;
}
.rm-banner::before { left: -14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.rm-banner::after { right: -14px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.rm-banner span { display: block; font-size: 19px; }
.rm-banner small { font-size: 12px; opacity: .85; }
.rm-compass { position: absolute; right: 14px; bottom: 26px; width: 74px; height: 74px; z-index: 460; pointer-events: none; opacity: .9; }

.rm-pin { background: none; border: 0; }
.rm-start {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: #f3e2b8; border: 3px solid #6b4a1f; box-shadow: 0 3px 8px rgba(70, 40, 10, .45);
}
.rm-seal {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #d8333b, #8e0d14 70%);
  color: #f6dfa4; font: 700 14px/1 "IM Fell English SC", Georgia, serif;
  border: 2px solid #d4a64a; box-shadow: 0 3px 6px rgba(60, 10, 10, .5), inset 0 0 0 2px rgba(255, 255, 255, .12);
}
.rm-seal.now { animation: seal-pulse 1.8s ease-in-out infinite; }
@keyframes seal-pulse {
  0%, 100% { box-shadow: 0 3px 6px rgba(60, 10, 10, .5), 0 0 0 0 rgba(179, 18, 27, .55); }
  50% { box-shadow: 0 3px 6px rgba(60, 10, 10, .5), 0 0 0 10px rgba(179, 18, 27, 0); }
}
.rm-next {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(243, 226, 184, .85); border: 2px dashed #7a5a2e; color: #7a5a2e; font: 700 12px/1 Georgia, serif;
}
.rm-plane { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(60, 30, 5, .5)); }
.rm-route { filter: drop-shadow(0 0 1px rgba(255, 240, 210, .9)); }
.leaflet-tooltip.rm-label {
  background: rgba(243, 226, 184, .95); border: 1.5px solid #6b4a1f; border-radius: 3px; box-shadow: 0 2px 5px rgba(70, 40, 10, .3);
  color: #4a2c0c; font: 15px/1.1 "IM Fell English SC", Georgia, serif; padding: 3px 7px;
}
.leaflet-tooltip.rm-label::before { display: none; }
#roadmap .leaflet-control-zoom a { background: #f3e2b8; color: #4a2c0c; border-color: #c9a86a; }
#roadmap .leaflet-control-scale-line { background: rgba(243, 226, 184, .85); border-color: #6b4a1f; color: #4a2c0c; font-family: "IM Fell English SC", Georgia, serif; }
#roadmap .leaflet-control-attribution { background: rgba(243, 226, 184, .7); }
.rm-stats {
  margin: 12px 4px 8px; text-align: center; color: #5b3a12; font-size: 16px;
  font-family: "IM Fell English SC", Georgia, serif;
}
.rm-stats b { color: #b3121b; font-size: 19px; }
.rm-zoom { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rm-zoom button {
  border: 2px solid #6b4a1f; background: linear-gradient(#f3e2b8, #e2c98e); color: #4a2c0c; border-radius: 999px;
  padding: 8px 16px; font: 16px/1 "IM Fell English SC", Georgia, serif; box-shadow: 0 3px 8px rgba(70, 40, 10, .25);
}

/* ---------- Road map animée ---------- */
.rm-player { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 12px; }
.rm-play {
  border: 2px solid #6b4a1f; border-radius: 999px; padding: 11px 22px;
  background: linear-gradient(#c62a32, #8e0d14); color: #f6dfa4;
  font: 19px/1 "IM Fell English SC", Georgia, serif; box-shadow: 0 5px 14px rgba(110, 20, 20, .35);
}
.rm-play:active { transform: scale(.97); }
.rm-ctrl {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #6b4a1f;
  background: linear-gradient(#f3e2b8, #e2c98e); color: #4a2c0c; font: 700 15px/1 Georgia, serif;
}
.rm-ctrl[hidden] { display: none; }
.rm-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; z-index: 465; background: rgba(90, 50, 10, .25); pointer-events: none; }
.rm-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8e0d14, #d8333b); }
.roadmap-view:not(.playing) .rm-progress { display: none; }
.roadmap-view.playing .rm-zoom { visibility: hidden; }

/* Carton du jour (comme un titre de film) */
.rm-day {
  position: absolute; left: 50%; top: 32%; z-index: 470; pointer-events: none;
  transform: translate(-50%, -50%) scale(.85); opacity: 0;
  min-width: 230px; max-width: 86%; text-align: center; padding: 14px 26px 16px;
  background: linear-gradient(#f6e8c4, #e6cf98); color: #4a2c0c;
  border: 3px double #6b4a1f; border-radius: 6px; box-shadow: 0 10px 28px rgba(60, 30, 5, .45);
  font-family: "IM Fell English SC", Georgia, serif;
  transition: opacity .35s ease, transform .35s ease;
}
.rm-day.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rm-day b { display: block; font-size: 38px; font-weight: 400; color: #8e0d14; line-height: 1.05; letter-spacing: 1px; }
.rm-day span { display: block; font-size: 18px; margin-top: 2px; }
.rm-day small { display: block; font-size: 15px; margin-top: 6px; opacity: .9; }
.rm-day small b { display: inline; font-size: 17px; }

/* Polaroïd de l'étape */
.rm-card {
  position: absolute; left: 50%; bottom: 24px; z-index: 470; pointer-events: none;
  width: min(240px, 72%); padding: 9px 9px 12px; background: #fffdf6; color: #3a2410;
  border-radius: 3px; box-shadow: 0 12px 26px rgba(40, 20, 5, .45);
  transform: translate(-50%, 30px) rotate(-3deg); opacity: 0;
  transition: opacity .35s ease, transform .35s ease; text-align: center;
}
.rm-card.show { opacity: 1; transform: translate(-50%, 0) rotate(-3deg); }
.rm-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 2px; }
.rm-card-emoji { font-size: 52px; padding: 10px 0 4px; }
.rm-card b { display: block; margin-top: 8px; font: 17px/1.15 "IM Fell English SC", Georgia, serif; }
.rm-card b i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #8e0d14; color: #f6dfa4; font-size: 13px; margin-right: 4px; vertical-align: 2px; }
.rm-card p { margin: 4px 0 0; font: 15px/1.25 "Pacifico", cursive; color: #b3121b; }
.rm-card span { display: block; margin-top: 4px; font-size: 16px; }

/* Véhicule qui avance */
.rm-vehicle { width: 48px; height: 48px; display: grid; place-items: center; filter: drop-shadow(0 6px 4px rgba(40, 20, 5, .45)); }
.rm-veh-in { display: grid; place-items: center; transition: transform .25s; }
.rm-vehicle.bus span { font-size: 36px; line-height: 1; display: block; animation: bus-bump .35s ease-in-out infinite alternate; }
@keyframes bus-bump { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.rm-seal.pop { animation: seal-pop .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes seal-pop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }

/* ========== Road map aux couleurs de l'appli (remplace le style parchemin) ========== */
.rm-frame {
  border-radius: 28px; border: 4px solid #fff; outline: none;
  box-shadow: var(--shadow), 0 0 0 2px var(--pink-soft);
  background: #fde7f1;
}
#roadmap { background: #fde7f1; }
#roadmap .leaflet-tile-pane { filter: saturate(.8) brightness(1.04) hue-rotate(-8deg); }
.rm-banner {
  top: 12px; padding: 6px 18px 7px; border: 3px solid #fff; border-radius: 999px;
  background: linear-gradient(120deg, var(--pink), #ff7eb8 50%, var(--lilac));
  color: #fff; box-shadow: 0 6px 16px rgba(224, 48, 127, .35); font-family: var(--font);
}
.rm-banner::before, .rm-banner::after { display: none; }
.rm-banner span { font: 400 19px/1.2 "Pacifico", cursive; }
.rm-banner small { font: 600 12px/1.2 var(--font); opacity: .95; }

.rm-start { background: #fff; border: 3px solid var(--pink); box-shadow: 0 4px 10px rgba(224, 48, 127, .35); }
.rm-seal {
  background: linear-gradient(135deg, var(--pink), var(--lilac)); color: #fff;
  font: 700 14px/1 var(--font); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(224, 48, 127, .4);
}
@keyframes seal-pulse {
  0%, 100% { box-shadow: 0 4px 10px rgba(224, 48, 127, .4), 0 0 0 0 rgba(255, 79, 154, .55); }
  50% { box-shadow: 0 4px 10px rgba(224, 48, 127, .4), 0 0 0 12px rgba(255, 79, 154, 0); }
}
.rm-next { background: rgba(255, 255, 255, .9); border: 2px dashed var(--lilac); color: var(--lilac); font: 700 12px/1 var(--font); }
.rm-plane { filter: drop-shadow(0 2px 3px rgba(224, 48, 127, .45)); }
.rm-route { filter: none; }
.leaflet-tooltip.rm-label {
  background: #fff; border: 2px solid var(--pink-soft); border-radius: 999px;
  box-shadow: 0 3px 10px rgba(224, 48, 127, .25); color: var(--ink); font: 600 13px/1.2 var(--font); padding: 4px 10px;
}
.leaflet-tooltip.rm-site-tip { border-radius: 14px; max-width: 220px; white-space: normal; font-weight: 500; }
.leaflet-tooltip.rm-site-tip b { color: var(--pink-deep); }
#roadmap .leaflet-control-zoom a { background: #fff; color: var(--pink-deep); border-color: var(--pink-soft); }
#roadmap .leaflet-control-scale-line { background: rgba(255, 255, 255, .85); border-color: var(--pink); color: var(--ink); font-family: var(--font); }
#roadmap .leaflet-control-attribution { background: rgba(255, 255, 255, .75); }

/* Villages traversés et sites clés */
.rm-village-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--lilac); box-shadow: 0 2px 5px rgba(90, 35, 71, .3); }
.leaflet-tooltip.rm-village {
  background: rgba(255, 255, 255, .88); border: 0; border-radius: 8px; box-shadow: none;
  color: #7b3fd0; font: 700 12px/1.1 var(--font); padding: 2px 6px;
}
.leaflet-tooltip.rm-village::before { display: none; }
.rm-site {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 17px;
  background: #fff; border: 2px solid var(--pink); box-shadow: 0 3px 8px rgba(224, 48, 127, .35);
}
.rm-far .rm-village-dot, .rm-far .rm-site, .rm-far .leaflet-tooltip.rm-village { display: none; }

/* Lecteur */
.rm-play {
  border: 3px solid #fff; background: linear-gradient(120deg, var(--pink), #ff7eb8 50%, var(--lilac));
  color: #fff; font: 700 18px/1 var(--font); box-shadow: 0 8px 20px rgba(224, 48, 127, .4);
}
.rm-ctrl { border: 2px solid var(--pink-soft); background: #fff; color: var(--pink-deep); font: 700 15px/1 var(--font); }
.rm-progress { height: 6px; background: rgba(255, 255, 255, .6); }
.rm-progress i { background: linear-gradient(90deg, var(--pink), var(--lilac)); }
.rm-stats { color: var(--ink); font-family: var(--font); font-size: 15px; }
.rm-stats b { color: var(--pink-deep); font-size: 18px; }
.rm-zoom button {
  border: 2px solid var(--pink-soft); background: #fff; color: var(--ink);
  font: 600 15px/1 var(--font); box-shadow: 0 3px 10px rgba(224, 48, 127, .18);
}

/* Cartons et cartes pendant l'animation */
.rm-day {
  background: #fff; color: var(--ink); border: 3px solid var(--pink-soft); border-radius: 24px;
  box-shadow: 0 14px 32px rgba(224, 48, 127, .35); font-family: var(--font);
}
.rm-day b { font: 400 36px/1.2 "Pacifico", cursive; color: var(--pink); letter-spacing: 0; }
.rm-day span { font-weight: 600; font-size: 17px; }
.rm-day small { color: var(--ink-soft); font-weight: 500; }
.rm-day small b { font: 700 17px/1 var(--font); color: var(--pink-deep); }
.rm-card { border-radius: 10px; color: var(--ink); box-shadow: 0 14px 30px rgba(224, 48, 127, .35); }
.rm-card b { font: 700 16px/1.2 var(--font); }
.rm-card b i { background: var(--pink); color: #fff; }
.rm-card p { color: var(--pink-deep); }
.rm-card.site { transform: translate(-50%, 30px) rotate(2deg); border: 3px solid var(--pink-soft); }
.rm-card.site.show { transform: translate(-50%, 0) rotate(2deg); }
.rm-card.site p { font: 500 14px/1.3 var(--font); color: var(--ink-soft); }
.rm-card.site span { font-size: 13px; font-weight: 600; color: #7b3fd0; }
.rm-place {
  position: absolute; left: 50%; top: 74px; z-index: 470; pointer-events: none;
  transform: translate(-50%, -8px); opacity: 0; transition: opacity .25s, transform .25s;
  background: #7b3fd0; color: #fff; border: 3px solid #fff; border-radius: 999px;
  padding: 6px 16px; font: 700 16px/1 var(--font); box-shadow: 0 6px 14px rgba(123, 63, 208, .35); white-space: nowrap;
}
.rm-place.show { opacity: 1; transform: translate(-50%, 0); }
.rm-vehicle { filter: drop-shadow(0 6px 4px rgba(90, 35, 71, .35)); }

/* Pastille de passage (petite, discrète) */
.rm-place { top: auto; bottom: 18px; padding: 5px 12px; font-size: 13px; border-width: 2px; max-width: 86%; overflow: hidden; text-overflow: ellipsis; }
.rm-place small { font-weight: 500; opacity: .85; }

/* ================= Mon livre de voyage ================= */
.book-view[hidden] { display: none; }
.book-tools { margin-bottom: 14px; }
.book-tools .btn-main { margin-top: 0; }
.book-tools .hint { font-size: 13px; text-align: center; margin: 8px 4px 0; }
#printArea { display: none; }

.book { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: center; }
.book-page {
  --c: var(--pink);
  position: relative; width: 100%; max-width: 520px; aspect-ratio: 148 / 210;
  background:
    radial-gradient(circle at 92% 4%, #ffe3f1 0 46px, transparent 47px),
    radial-gradient(circle at 4% 98%, #f3e6ff 0 60px, transparent 61px),
    #fff;
  border-radius: 14px; padding: 22px 20px 34px; overflow: visible;   /* la page s'allonge si le contenu dépasse */
  box-shadow: 0 10px 26px rgba(224, 48, 127, .18), 0 0 0 1px #ffe0ee;
  color: var(--ink); font-family: var(--font);
  display: flex; flex-direction: column; gap: 10px;
}
.book-num {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font: 600 12px/1 var(--font); color: var(--ink-soft);
}
.book-num::before, .book-num::after { content: " ✦ "; color: var(--pink); }
.book-label { display: block; font: 700 12px/1.2 var(--font); text-transform: uppercase; letter-spacing: .6px; color: var(--c); margin-bottom: 4px; }
.book-empty { margin: auto; text-align: center; font-size: 18px; color: var(--ink-soft); }

/* Couverture */
.book-page.cover {
  justify-content: center; align-items: center; text-align: center; gap: 6px;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, .55) 0 2px, transparent 3px) 0 0 / 34px 34px,
    linear-gradient(150deg, #ff4f9a 0%, #ff8fc4 45%, #b884ff 100%);
  color: #fff;
}
.cover-deco { font-size: 22px; letter-spacing: 6px; }
.cover h1 { margin: 6px 0 0; font: 400 clamp(34px, 9vw, 46px)/1.15 "Pacifico", cursive; text-shadow: 0 3px 0 rgba(224, 48, 127, .45); }
.cover-by { margin: 0; font-size: 20px; font-weight: 600; }
.cover-photo {
  margin: 14px 0 10px; width: 68%; padding: 9px 9px 26px; background: #fff; border-radius: 4px;
  transform: rotate(-3deg); box-shadow: 0 12px 24px rgba(90, 35, 71, .35);
}
.cover-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 2px; }
.cover-emoji { font-size: 56px; margin: 18px 0; }
.cover-place { margin: 0; font-size: 18px; font-weight: 700; }
.cover-dates { margin: 0; font-size: 15px; opacity: .95; }

/* Chiffres + sommaire */
.contents h2, .end h2 { margin: 0; font: 400 28px/1.3 "Pacifico", cursive; color: var(--pink); text-align: center; }
.contents h3 { margin: 6px 0 0; font-size: 17px; color: var(--ink); }
.book-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.book-stats div { background: var(--pink-bg); border: 2px solid var(--pink-soft); border-radius: 16px; padding: 8px 4px; text-align: center; }
.book-stats b { display: block; font-size: 24px; color: var(--pink-deep); }
.book-stats span { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.book-toc { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.book-toc li { --c: var(--pink); border-left: 5px solid var(--c); background: #fff; border-radius: 10px; padding: 6px 10px; box-shadow: 0 2px 8px rgba(224, 48, 127, .1); }
.book-toc b { display: block; font-size: 14px; color: var(--c); }
.book-toc span { font-size: 13px; }

/* Page d'un lieu */
.book-day {
  align-self: flex-start; background: var(--c); color: #fff; border-radius: 999px;
  padding: 4px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 35%, transparent);
}
.book-visit-head { display: flex; gap: 10px; align-items: center; }
.book-emoji { flex: none; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: color-mix(in srgb, var(--c) 18%, #fff); }
.book-visit-head h2 { margin: 0; font: 400 24px/1.25 "Pacifico", cursive; color: var(--c); }
.book-visit-head p { margin: 0; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.book-about { margin: 0; font-size: 14px; line-height: 1.4; background: #fff8e8; border-radius: 12px; padding: 8px 10px; }
.book-about .book-label { display: inline; color: #c77700; }

.book-photos { display: grid; gap: 10px; padding: 6px 4px; }
.book-photos.ph-1 { grid-template-columns: 1fr; }
.book-photos.ph-2, .book-photos.ph-3, .book-photos.ph-4 { grid-template-columns: 1fr 1fr; }
.book-photos figure { position: relative; margin: 0; background: #fff; padding: 6px 6px 8px; border-radius: 3px; box-shadow: 0 6px 14px rgba(90, 35, 71, .22); transform: rotate(-1.5deg); }
.book-photos figure:nth-child(even) { transform: rotate(1.8deg); }
.book-photos figure::before {   /* petit bout de scotch rose */
  content: ""; position: absolute; top: -8px; left: 50%; width: 56px; height: 16px; transform: translateX(-50%) rotate(-4deg);
  background: rgba(255, 143, 196, .75); border-radius: 2px;
}
.book-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 2px; }
.book-photos.ph-1 img { aspect-ratio: 4 / 3; max-height: 260px; }
.book-photos figcaption { margin-top: 5px; font: 400 13px/1.3 "Pacifico", cursive; color: var(--pink-deep); text-align: center; }
.book-more { margin: -4px 0 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.book-rating { font-size: 18px; }
.book-rating .book-label { display: inline; margin-right: 6px; }
.book-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.book-notes li {
  padding: 6px 10px 8px; border-radius: 10px; background:
    repeating-linear-gradient(transparent 0 21px, #ffd6e8 21px 22px), #fffdfb;
  border: 1px solid #ffe0ee;
}
.book-notes time { font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.book-notes p { margin: 2px 0 0; font-size: 15px; line-height: 22px; white-space: pre-wrap; }
.book-family { background: #f3eaff; border-radius: 12px; padding: 8px 10px; font-size: 14px; }
.book-family .book-label { color: #7b3fd0; }
.book-family p { margin: 3px 0; }
.book-family b { color: #7b3fd0; }

/* Fin */
.book-page.end { justify-content: center; text-align: center; }
.end h2 { font-size: 44px; }
.end-deco { font-size: 26px; letter-spacing: 6px; margin: 0; }
.end-hearts { font-weight: 700; color: var(--pink-deep); margin: 0; }
.book-memory { text-align: left; margin-top: 18px; }
.book-memory i { display: block; height: 30px; border-bottom: 2px dashed var(--pink-soft); }

/* ---------- Impression : livre photo A5 ---------- */
@media print {
  @page { size: A5 portrait; margin: 0; }
  body.print-book { background: #fff !important; padding: 0 !important; min-height: 0; }
  body.print-book > *:not(#printArea) { display: none !important; }
  body.print-book #printArea { display: block !important; }
  body.print-book * { -webkit-print-color-adjust: exact; print-color-adjust: exact; animation: none !important; }
  #printArea .book-page {
    width: 148mm; max-width: none; min-height: 210mm; aspect-ratio: auto; margin: 0;
    border-radius: 0; box-shadow: none; padding: 12mm 11mm 15mm;
    break-after: page; page-break-after: always;
  }
  #printArea .book-page:last-child { break-after: auto; page-break-after: auto; }
  #printArea .book-photos figure, #printArea .book-notes li, #printArea .book-family, #printArea .book-about { break-inside: avoid; }
}

/* Onglets : passent à la ligne au lieu d'être coupés (4 onglets) */
.view-tabs { flex-wrap: wrap; overflow: visible; width: auto; border-radius: 22px; }
.view-tabs button { flex: 1 1 auto; }

/* Pages « road map » du livre */
.map-page h2 { margin: 0; font: 400 28px/1.3 "Pacifico", cursive; color: var(--pink); text-align: center; }
.book-map { margin: 0; background: #fff; padding: 6px 6px 8px; border-radius: 6px; box-shadow: 0 6px 16px rgba(90, 35, 71, .2); }
.book-map img {
  display: block; width: 100%; aspect-ratio: 520 / 300; object-fit: cover; border-radius: 4px;
  background: linear-gradient(110deg, #fde7f1 30%, #fff 50%, #fde7f1 70%) 0 0 / 300% 100%;
  animation: map-loading 1.4s linear infinite;
}
.book-map img[src] { animation: none; background: none; }
.book-map.square img { aspect-ratio: 1; }
@keyframes map-loading { to { background-position: -300% 0; } }
.book-map figcaption { margin-top: 5px; text-align: center; font: 600 13px/1.3 var(--font); color: var(--pink-deep); }
.book-legend { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 10px; font-size: 12px; }
.book-legend li { break-inside: avoid; margin-bottom: 4px; display: flex; gap: 4px; align-items: baseline; }
.book-legend i {
  flex: none; font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--lilac)); color: #fff; font-weight: 700; font-size: 10px;
}
.book-legend small { color: var(--ink-soft); }
@media print { #printArea .book-map { break-inside: avoid; } }

/* ================= Emploi du temps ================= */
.tt-view[hidden] { display: none; }
.tt-source { margin: 0 4px 8px; color: var(--ink-soft); font-size: 14px; }
.tt-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tt-legend span { background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.tt-day {
  --c: var(--pink);
  background: #fff; border-radius: var(--radius); margin-bottom: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(224, 48, 127, .12); border: 2px solid transparent;
}
.tt-day.today { border-color: var(--c); box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 30%, transparent); }
.tt-day header {
  background: var(--c); color: #fff; padding: 10px 14px; font-weight: 600; font-size: 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tt-day header b { font: 400 18px/1.2 "Pacifico", cursive; }
.tt-day header em { margin-left: auto; font-style: normal; background: #fff; color: var(--c); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
.tt-day ol { list-style: none; margin: 0; padding: 6px 10px 10px; display: grid; gap: 6px; }
.tt-slot { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 14px; }
.tt-slot time { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding-top: 2px; white-space: nowrap; }
.tt-slot strong { display: block; font-size: 15px; font-weight: 600; }
.tt-slot small { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.tt-slot.meal { background: #fff8e3; }
.tt-slot.study { background: #e9f8ef; }
.tt-slot.activity { background: color-mix(in srgb, var(--c) 12%, #fff); }
.tt-slot.travel, .tt-slot.flight { background: #eef4ff; }
.tt-slot.linked { cursor: pointer; transition: transform .12s; }
.tt-slot.linked:active { transform: scale(.98); }
.tt-slot.linked:focus-visible { outline: 3px solid var(--lilac); }
.tt-open { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--c); }
@media (max-width: 380px) { .tt-slot { grid-template-columns: 78px 1fr; } }

/* « … et la classe de CM1/CM2 de l'école primaire de Fajà, Kouaoua » (visible seulement pour Madeleine et la famille) */
.t-class { display: block; margin: -2px 0 2px 4px; font: 600 clamp(15px, 3.6vw, 19px)/1.25 var(--font); color: #a2378d; max-width: 34em; }
.t-class[hidden] { display: none; }
.cover-class { margin: 2px 12px 0; font-size: 15px; font-weight: 600; line-height: 1.3; opacity: .95; }

/* ---------- Bannière (photo de la classe, privée) ---------- */
.banner {
  position: relative; z-index: 2;
  max-width: 1200px; margin: 6px auto 4px; width: calc(100% - 32px);
  border-radius: 28px; overflow: hidden;
  border: 4px solid #fff; box-shadow: var(--shadow), 0 0 0 2px var(--pink-soft);
  background: var(--pink-bg);
}
.banner[hidden] { display: none; }
.banner img { display: block; width: 100%; aspect-ratio: 1600 / 731; max-height: 300px; object-fit: cover; object-position: center 35%; }
.banner::after {   /* voile rose et paillettes, aux couleurs de l'appli */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, .9) 0 1.5px, transparent 2.5px) 0 0 / 38px 38px,
    linear-gradient(180deg, rgba(255, 79, 154, .10) 0%, transparent 35%, transparent 70%, rgba(184, 132, 255, .28) 100%);
}
.banner-shine {
  position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: banner-shine 6s ease-in-out infinite;
}
@keyframes banner-shine { 0%, 70% { left: -40%; } 100% { left: 120%; } }
@media print { .banner { display: none !important; } }
