:root {
    --bg: #171318;
    --bg-soft: #211a21;
    --card: #fffaf7;
    --ink: #292127;
    --muted: #786d75;
    --cream: #f5eee9;
    --rose: #d98793;
    --rose-dark: #a95362;
    --gold: #cda76c;
    --danger: #ad3647;
    --shadow: 0 20px 50px rgba(24, 12, 20, .2);
    --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--cream);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-bottom: 96px;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.hero {
    position: relative;
    overflow: hidden;
    min-height: 390px;
    padding: 60px 24px 38px;
    background:
        radial-gradient(circle at 15% 20%, rgba(217, 135, 147, .23), transparent 32%),
        radial-gradient(circle at 88% 38%, rgba(205, 167, 108, .17), transparent 28%),
        linear-gradient(145deg, #130f13, #281c25 70%, #1b141a);
    color: white;
    border-radius: 0 0 38px 38px;
}
.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -130px;
    height: 230px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    transform: rotate(-8deg);
}
.hero__glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    right: -60px;
    top: 20px;
    background: rgba(217,135,147,.14);
    filter: blur(18px);
}
.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .22em;
    text-transform: uppercase;
}
.hero h1 {
    position: relative;
    margin: 0;
    max-width: 420px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 14vw, 5.3rem);
    line-height: .86;
    letter-spacing: -.055em;
}
.hero h1 em {
    color: #e7a5ae;
    font-weight: 400;
}
.hero__subtitle {
    margin: 24px 0 30px;
    color: rgba(255,255,255,.72);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    font-style: italic;
}
.wink-stage {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    min-height: 46px;
    padding: 11px 17px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    backdrop-filter: blur(8px);
    color: #fff7f1;
}
.wink-stage__symbol { color: var(--gold); font-size: .72rem; }
#random-wink { min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; transition: opacity .25s, transform .25s; }
#random-wink.is-changing { opacity: 0; transform: translateY(5px); }

main { max-width: 900px; margin: 0 auto; }
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 26px 20px 18px;
}
.toolbar__label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .14em;
}
.toolbar strong { font-family: Georgia, serif; font-size: 1.25rem; }
.button {
    min-height: 44px;
    padding: 10px 17px;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
}
.button--primary {
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
    color: white;
    box-shadow: 0 9px 23px rgba(169,83,98,.25);
}
.button--ghost { background: #eee7e3; color: var(--ink); }

.timeline { position: relative; padding: 2px 16px 24px 30px; }
.timeline::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 0;
    left: 17px;
    width: 1px;
    background: linear-gradient(var(--rose), rgba(217,135,147,.08));
}
.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.timeline-item__marker {
    position: relative;
    z-index: 2;
    padding-top: 26px;
}
.timeline-item__marker span {
    display: block;
    width: 13px;
    height: 13px;
    border: 3px solid var(--cream);
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 0 2px rgba(217,135,147,.35);
}
.memory-card {
    overflow: hidden;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}
.memory-card__topline { display: flex; justify-content: space-between; align-items: center; }
.memory-card time {
    color: var(--rose-dark);
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.memory-card h2 {
    margin: 9px 0 7px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    line-height: 1.05;
}
.memory-card__description {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
}
.media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.media-grid:empty { display: none; }
.media-grid__item {
    position: relative;
    overflow: hidden;
    min-height: 140px;
    border-radius: 17px;
    background: #e7dfdc;
}
.media-grid__item:first-child:nth-last-child(1) { grid-column: 1 / -1; min-height: 250px; }
.media-grid img, .media-grid video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-grid video { background: #111; }
.card-menu { position: relative; }
.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.35rem;
}
.card-menu__content {
    position: absolute;
    z-index: 5;
    top: 38px;
    right: 0;
    display: none;
    min-width: 135px;
    padding: 7px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 15px 40px rgba(0,0,0,.15);
}
.card-menu.is-open .card-menu__content { display: grid; }
.card-menu__content button {
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
}
.card-menu__content button:hover { background: #f4eeeb; }
.card-menu__content .danger { color: var(--danger); }

.empty-state {
    margin: 16px;
    padding: 45px 28px;
    border: 1px dashed rgba(169,83,98,.3);
    border-radius: var(--radius);
    text-align: center;
}
.empty-state__heart { color: var(--rose); font-size: 3.4rem; }
.empty-state h2 { font-family: Georgia, serif; }
.empty-state p { color: var(--muted); line-height: 1.5; }

.floating-button {
    position: fixed;
    z-index: 10;
    right: 18px;
    bottom: 86px;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
    color: white;
    box-shadow: 0 14px 34px rgba(98,39,56,.38);
    font-size: 2rem;
}
.bottom-nav {
    position: fixed;
    z-index: 9;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    height: 72px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(41,33,39,.08);
    background: rgba(255,250,247,.94);
    backdrop-filter: blur(14px);
}
.bottom-nav__item {
    display: grid;
    place-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
}
.bottom-nav__item span { text-align: center; font-size: 1.25rem; }
.bottom-nav__item--active { color: var(--rose-dark); }

.modal {
    width: min(94vw, 580px);
    max-height: 92vh;
    padding: 0;
    border: 0;
    border-radius: 28px;
    background: transparent;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.modal::backdrop { background: rgba(17,10,15,.72); backdrop-filter: blur(4px); }
.modal__panel { max-height: 92vh; margin: 0; padding: 23px; background: var(--card); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal__panel--compact { min-height: 350px; }
.modal__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal__header h2 { margin: 0; font-family: Georgia, serif; font-size: 1.9rem; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field span { font-size: .82rem; font-weight: 850; }
.field small { color: var(--muted); font-weight: 500; }
.field input, .field textarea, .inline-form input {
    width: 100%;
    border: 1px solid #e0d6d1;
    border-radius: 15px;
    background: white;
    color: var(--ink);
    outline: none;
}
.field input { min-height: 49px; padding: 0 14px; }
.field textarea { padding: 13px 14px; resize: vertical; }
.field input:focus, .field textarea:focus, .inline-form input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(217,135,147,.15); }
.upload-zone {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 140px;
    padding: 20px;
    border: 1px dashed rgba(169,83,98,.42);
    border-radius: 18px;
    background: #fff5f4;
    text-align: center;
}
.upload-zone input { display: none; }
.upload-zone__icon { color: var(--rose-dark); font-size: 2rem; }
.upload-zone small { color: var(--muted); }
.media-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.media-preview__item { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 13px; background: #eee; }
.media-preview__item img, .media-preview__item video { width: 100%; height: 100%; object-fit: cover; }
.media-preview__remove {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 0;
    border-radius: 50%;
    background: rgba(25,14,20,.78);
    color: white;
}
.form-error { min-height: 20px; color: var(--danger); font-size: .86rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-form input { min-height: 46px; padding: 0 13px; }
.wink-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; margin-top: 20px; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.wink-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 13px;
    border-radius: 999px;
    background: #f0e6e4;
}
.wink-chip button { border: 0; background: transparent; color: var(--danger); font-weight: 900; }

@media (min-width: 700px) {
    .hero { padding-left: max(24px, calc((100vw - 900px) / 2)); }
    .toolbar { padding-left: 30px; padding-right: 30px; }
    .timeline { padding-left: 42px; padding-right: 30px; }
    .timeline::before { left: 29px; }
    .memory-card { padding: 25px; }
    .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .media-grid__item:first-child:nth-last-child(1) { min-height: 380px; }
    .floating-button { display: none; }
}

/* Centrage du clin d'œil et diaporama */
.toolbar__actions { display: flex; align-items: center; gap: 8px; }
.button--slideshow { display: none; }
.media-grid__item { padding: 0; border: 0; cursor: pointer; }
.media-grid__play { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(20,14,19,.7); color: white; }
.bottom-nav { grid-template-columns: repeat(3, 1fr); }

.slideshow { position: fixed; z-index: 100; inset: 0; background: #09070a; color: white; }
.slideshow__stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: #09070a; }
.slideshow__media { position: absolute; inset: 0; display: grid; place-items: center; }
.slideshow__media img, .slideshow__media video { width: 100%; height: 100%; object-fit: contain; background: #09070a; }
.slideshow__gradient { position: absolute; pointer-events: none; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0,0,0,.86)); }
.slideshow__control, .slideshow__arrow { position: absolute; z-index: 3; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.26); background: rgba(15,10,15,.62); color: white; backdrop-filter: blur(10px); }
.slideshow__control { top: max(18px, env(safe-area-inset-top)); width: 46px; height: 46px; border-radius: 50%; font-size: 1.25rem; }
.slideshow__close { left: 16px; font-size: 2rem; }
.slideshow__play { right: 70px; }
.slideshow__shuffle { right: 16px; }
.slideshow__shuffle.is-active { border-color: var(--rose); background: var(--rose-dark); }
.slideshow__arrow { top: 48%; width: 48px; height: 48px; border-radius: 50%; font-size: 2.6rem; line-height: 1; }
.slideshow__arrow--previous { left: 12px; }
.slideshow__arrow--next { right: 12px; }
.slideshow__caption { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.slideshow__caption strong { display: block; font-size: 1.05rem; }
.slideshow__caption time { display: block; margin-top: 5px; color: rgba(255,255,255,.78); font-size: .9rem; }
.slideshow__counter { white-space: nowrap; }
.slideshow__thumbnails { position: absolute; z-index: 2; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 8px; overflow-x: auto; padding: 0 20px; scrollbar-width: none; }
.slideshow__thumbnails::-webkit-scrollbar { display: none; }
.slideshow__thumbnail { flex: 0 0 68px; overflow: hidden; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: #211b21; opacity: .72; }
.slideshow__thumbnail.is-active { border-color: var(--rose); opacity: 1; }
.slideshow__thumbnail img, .slideshow__thumbnail video { width: 100%; height: 100%; object-fit: cover; }
body.slideshow-open { overflow: hidden; }

@media (max-width: 699px) {
    .hero { text-align: center; }
    .hero h1 { margin-inline: auto; }
    .wink-stage { display: flex; width: fit-content; max-width: calc(100vw - 40px); margin-inline: auto; justify-content: center; }
    #random-wink { min-width: 0; text-align: center; }
    .toolbar__actions .button--slideshow { display: none; }
}

@media (min-width: 700px) {
    .button--slideshow { display: inline-flex; align-items: center; gap: 6px; }
    .slideshow__caption { bottom: 112px; }
    .slideshow__thumbnail { flex-basis: 90px; height: 68px; }
}

.photo-date-hint {
    min-height: 1.25rem;
    margin: -0.35rem 0 0.75rem;
    color: var(--accent, #ef8eb3);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: center;
}

.photo-date-hint:empty {
    display: none;
}


@media (max-width: 699px) {
    .modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .modal__panel {
        max-height: calc(100dvh - 20px);
        padding-bottom: calc(23px + env(safe-area-inset-bottom));
    }

    .wink-stage {
        max-width: calc(100vw - 40px);
        overflow: hidden;
    }

    .wink-stage__symbol {
        flex: 0 0 auto;
    }
}

/* Écran de lancement PWA */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
    background:
        radial-gradient(circle at 50% 38%, rgba(236, 127, 169, .16), transparent 34%),
        linear-gradient(155deg, #2f1e28 0%, #171318 72%);
    color: #fff8f2;
    opacity: 1;
    visibility: visible;
    transition: opacity .4s ease, visibility .4s ease;
}
.app-splash::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.04), transparent 65%);
}
.app-splash img {
    width: 104px;
    height: 104px;
    border-radius: 25px;
    box-shadow: 0 18px 45px rgba(0,0,0,.35);
}
.app-splash strong { font-family: Georgia, serif; font-size: 1.42rem; font-weight: 500; }
.app-splash span { color: rgba(255,248,242,.66); font-size: .86rem; letter-spacing: .08em; text-transform: uppercase; }
.app-splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .app-splash { transition: none; }
}

/* =========================================================
   Fabrique à souvenirs 1.0.0 — modales accessibles
   ========================================================= */
.modal {
    color: #f8f2f5;
    box-shadow: 0 34px 100px rgba(0, 0, 0, .58);
}

.modal::backdrop {
    background: rgba(10, 6, 9, .82);
    backdrop-filter: blur(8px) saturate(.72);
}

.modal__panel {
    color: #f8f2f5;
    background:
        radial-gradient(circle at 90% 4%, rgba(217, 135, 147, .09), transparent 28%),
        linear-gradient(155deg, #2b2229, #1d181d 72%);
    border: 1px solid rgba(255, 255, 255, .11);
}

.modal__header {
    position: sticky;
    z-index: 4;
    top: -23px;
    margin: -23px -23px 20px;
    padding: 23px 23px 13px;
    background: linear-gradient(#261f25 74%, rgba(38, 31, 37, 0));
}

.modal__header h2 { color: #fffaf7; }
.modal__header .eyebrow { color: #e0b26e; }

.modal__header > .icon-button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .075);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.modal__header > .icon-button:hover,
.modal__header > .icon-button:focus-visible {
    border-color: rgba(231, 143, 157, .75);
    background: rgba(217, 135, 147, .2);
    outline: 3px solid rgba(217, 135, 147, .2);
}

.field span { color: #f7eef2; }
.field small { color: #d6c8cf; }

.field input,
.field textarea,
.inline-form input {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(8, 6, 8, .30);
    color: #fffaf7;
    caret-color: #efa0ad;
}

.field input::placeholder,
.field textarea::placeholder,
.inline-form input::placeholder { color: #aca0a7; opacity: 1; }

.field input:focus,
.field textarea:focus,
.inline-form input:focus {
    border-color: #e18d9a;
    box-shadow: 0 0 0 3px rgba(217, 135, 147, .22);
}

.upload-zone {
    border-color: rgba(231, 143, 157, .72);
    background: rgba(217, 135, 147, .055);
    color: #fffaf7;
}
.upload-zone:hover { background: rgba(217, 135, 147, .11); }
.upload-zone__icon { color: #efa0ad; }
.upload-zone small { color: #cabec5; }

.modal .button--ghost {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .085);
    color: #fffaf7;
}
.modal .button--ghost:hover { background: rgba(255, 255, 255, .14); }
.modal .button { min-height: 50px; }
.modal .button:active { transform: scale(.98); }

.wink-list {
    max-height: min(52dvh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(231,143,157,.55) rgba(255,255,255,.05);
}

.wink-chip {
    border: 1px solid rgba(255, 255, 255, .095);
    background: rgba(255, 255, 255, .075);
    color: #fffaf7;
}
.wink-chip button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ff91a4;
}
.wink-chip button:hover,
.wink-chip button:focus-visible { background: rgba(255, 145, 164, .14); outline: none; }

.form-error { color: #ff9ead; }
.photo-date-hint { color: #efa0ad; }

@media (hover: hover) and (pointer: fine) {
    .wink-chip button { opacity: .68; transition: opacity .2s, background .2s; }
    .wink-chip:hover button, .wink-chip:focus-within button { opacity: 1; }
}

@media (max-width: 699px) {
    .modal__header {
        top: -18px;
        margin: -18px -18px 18px;
        padding: 18px 18px 12px;
    }
    .modal__panel { padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .modal__actions { position: sticky; bottom: -18px; z-index: 3; margin: 18px -18px -18px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(29,24,29,0), #1d181d 24%); }
    .modal__actions .button { flex: 1; }
    .inline-form { grid-template-columns: 1fr; }
    .inline-form .button { width: 100%; }
    .wink-list { max-height: min(54dvh, 520px); padding-right: 3px; }
}


/* Fabrique à souvenirs 1.0.1 — correctifs formulaire et état de chargement */
.modal__panel,
.modal__panel *,
.field,
.inline-form {
    box-sizing: border-box;
}

.modal__panel {
    width: 100%;
    min-width: 0;
}

.field,
.field input,
.field textarea,
.inline-form,
.inline-form input {
    min-width: 0;
    max-width: 100%;
}

.field input[type="date"] {
    display: block;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.button--loading {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.button__spinner {
    display: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: event-button-spin .72s linear infinite;
}

.button--loading.is-loading .button__spinner { display: inline-block; }
.button--loading:disabled { cursor: wait; opacity: .9; }
.modal [data-close-dialog]:disabled { cursor: wait; opacity: .45; }

@keyframes event-button-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .button__spinner { animation-duration: 1.4s; }
}

/* v1.1.0 — chargement progressif, notifications et clins d’œil plein écran */
.media-placeholder {
    position: relative;
    overflow: hidden;
    background: linear-gradient(110deg, #2a2329 8%, #3a3038 18%, #2a2329 33%);
    background-size: 220% 100%;
    animation: memory-placeholder 1.35s linear infinite;
}
.media-grid__item.media-placeholder { background-color: #eadfdd; background-image: linear-gradient(110deg, #eadfdd 8%, #f5ecea 18%, #eadfdd 33%); }
.media-placeholder img,
.media-placeholder video { opacity: 0; transition: opacity .35s ease; }
.media-placeholder.is-loaded { animation: none; background-image: none; }
.media-placeholder.is-loaded img,
.media-placeholder.is-loaded video { opacity: 1; }
@keyframes memory-placeholder { to { background-position-x: -220%; } }

/* v1.1.1 — le clin d’œil se pose sur le bas de la photo */
.slideshow__wink {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: calc(86px + env(safe-area-inset-bottom));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    min-height: 128px;
    padding: 58px 22px 22px;
    color: #fff8f2;
    text-align: center;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(9, 7, 10, .72));
    transition: opacity .35s ease, transform .35s ease;
}
.slideshow__wink strong {
    max-width: min(78vw, 620px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: Georgia, serif;
    font-size: clamp(1.15rem, 3vw, 1.75rem);
    font-style: italic;
    font-weight: 500;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0,0,0,.85);
}
.slideshow__wink span {
    color: var(--rose);
    padding-bottom: .12em;
    text-shadow: 0 2px 12px rgba(0,0,0,.8);
}
.slideshow__wink.is-changing {
    opacity: 0;
    transform: translateY(8px);
}

/* Le titre et la date restent discrets en haut, sans concurrencer le clin d’œil. */
.slideshow__caption {
    top: max(76px, calc(env(safe-area-inset-top) + 58px));
    bottom: auto;
    align-items: start;
    padding: 10px 13px;
    border-radius: 14px;
    background: rgba(15,10,15,.46);
    backdrop-filter: blur(8px);
    text-shadow: 0 1px 8px rgba(0,0,0,.7);
}

.notification-settings {
    display: grid;
    gap: 13px;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(255,255,255,.055);
}
.notification-settings h3 { margin: 2px 0 5px; font-family: Georgia, serif; font-size: 1.3rem; }
.notification-settings__status { margin: 0; color: rgba(248,242,245,.72); font-size: .88rem; line-height: 1.4; }
.notification-settings__field { margin: 0; }
.notification-settings .field input { background: rgba(255,255,255,.94); }
.notification-settings .button { justify-self: start; }

@media (max-width: 699px) {
    .slideshow__wink {
        bottom: calc(72px + env(safe-area-inset-bottom));
        min-height: 112px;
        padding: 50px 16px 18px;
    }
    .slideshow__wink strong {
        max-width: calc(100vw - 72px);
        font-size: clamp(1.05rem, 5vw, 1.4rem);
    }
    .slideshow__caption {
        left: 72px;
        right: 72px;
        top: max(18px, env(safe-area-inset-top));
        justify-content: center;
        text-align: center;
    }
    .slideshow__counter { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .media-placeholder { animation: none; }
}

/* v1.1.2 — informations regroupées en bas et adaptation paysage */
.slideshow__gradient {
    inset: 34% 0 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(9,7,10,.28) 34%, rgba(9,7,10,.94) 100%);
}

.slideshow__caption {
    top: auto;
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    bottom: calc(150px + env(safe-area-inset-bottom));
    align-items: end;
    padding: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    text-align: left;
    text-shadow: 0 2px 14px rgba(0,0,0,.9);
}

.slideshow__memory {
    min-width: 0;
    max-width: min(78vw, 760px);
}

.slideshow__caption time {
    display: block;
    margin: 0 0 5px;
    color: rgba(255,255,255,.75);
    font-size: clamp(.72rem, 1.8vw, .9rem);
    letter-spacing: .025em;
}

.slideshow__caption strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: clamp(1.05rem, 3.2vw, 1.55rem);
    line-height: 1.15;
    text-overflow: ellipsis;
}

.slideshow__wink {
    bottom: calc(80px + env(safe-area-inset-bottom));
    min-height: 70px;
    padding: 16px 22px 18px;
    background: none;
}

.slideshow__counter {
    flex: 0 0 auto;
    padding-bottom: 2px;
    color: rgba(255,255,255,.76);
    font-size: .85rem;
    white-space: nowrap;
}

@media (max-width: 699px) and (orientation: portrait) {
    .slideshow__caption {
        left: 18px;
        right: 18px;
        bottom: calc(142px + env(safe-area-inset-bottom));
        justify-content: space-between;
        text-align: left;
    }

    .slideshow__memory { max-width: calc(100vw - 36px); }
    .slideshow__counter { display: none; }

    .slideshow__wink {
        bottom: calc(70px + env(safe-area-inset-bottom));
        min-height: 64px;
        padding: 12px 16px 16px;
    }
}

/* Téléphones en paysage : on libère la hauteur utile sans sacrifier les informations. */
@media (orientation: landscape) and (max-height: 540px) {
    .slideshow__control {
        top: max(8px, env(safe-area-inset-top));
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .slideshow__close {
        left: max(8px, env(safe-area-inset-left));
        font-size: 1.65rem;
    }

    .slideshow__play { right: calc(max(8px, env(safe-area-inset-right)) + 44px); }
    .slideshow__shuffle { right: max(8px, env(safe-area-inset-right)); }

    .slideshow__arrow {
        top: 45%;
        width: 38px;
        height: 38px;
        font-size: 2rem;
    }

    .slideshow__arrow--previous { left: max(8px, env(safe-area-inset-left)); }
    .slideshow__arrow--next { right: max(8px, env(safe-area-inset-right)); }

    .slideshow__gradient { inset: 28% 0 0; }

    .slideshow__caption {
        left: max(58px, calc(env(safe-area-inset-left) + 12px));
        right: max(58px, calc(env(safe-area-inset-right) + 12px));
        bottom: calc(86px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .slideshow__memory { max-width: min(68vw, 680px); }
    .slideshow__caption time { margin-bottom: 2px; font-size: .68rem; }
    .slideshow__caption strong { -webkit-line-clamp: 1; font-size: clamp(.92rem, 2.8vw, 1.18rem); }

    .slideshow__wink {
        bottom: calc(43px + env(safe-area-inset-bottom));
        min-height: 40px;
        padding: 5px 58px 8px;
        gap: 7px;
    }

    .slideshow__wink strong {
        max-width: 64vw;
        font-size: clamp(.92rem, 2.8vw, 1.15rem);
    }

    .slideshow__thumbnails {
        bottom: max(5px, env(safe-area-inset-bottom));
        gap: 6px;
        padding-inline: max(54px, calc(env(safe-area-inset-left) + 8px));
    }

    .slideshow__thumbnail {
        flex-basis: 48px;
        height: 34px;
        border-radius: 7px;
    }

    .slideshow__counter { font-size: .72rem; }
}

/* v1.1.3 — notifications dans un onglet dédié */
.bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.bottom-nav__item {
    min-width: 0;
    padding: 6px 3px;
}
.bottom-nav__item small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .68rem;
}

.notification-settings {
    margin-top: 0;
    color: var(--ink);
    border-color: rgba(98,39,56,.12);
    background: rgba(255,255,255,.58);
}
.notification-settings__status {
    color: var(--muted);
}
.notification-settings__help {
    margin: -2px 0 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}
.notification-settings .field select {
    width: 100%;
    min-height: 49px;
    padding: 0 42px 0 14px;
    border: 1px solid #e0d6d1;
    border-radius: 15px;
    background-color: #fff;
    color: #2b2228;
    color-scheme: light;
    font: inherit;
    font-weight: 700;
    outline: none;
    appearance: auto;
    -webkit-appearance: menulist;
}
.notification-settings .field select option {
    background: #fff;
    color: #2b2228;
}
.notification-settings .field select:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(177,94,116,.14);
}

@media (max-width: 390px) {
    .bottom-nav__item small { font-size: .61rem; }
    .bottom-nav__item span { font-size: 1.12rem; }
}


/* v1.1.4 — clin d’œil flottant pendant le défilement de la frise */
.floating-wink {
    position: fixed;
    z-index: 35;
    top: max(10px, env(safe-area-inset-top));
    left: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: max-content;
    max-width: calc(100vw - 32px);
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: rgba(24, 14, 25, .82);
    box-shadow: 0 10px 30px rgba(17, 8, 17, .25);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    color: #fff7f1;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -14px) scale(.96);
    transition: opacity .22s ease, transform .22s ease;
}

.floating-wink.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

#floating-random-wink {
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .25s, transform .25s;
}

#floating-random-wink.is-changing {
    opacity: 0;
    transform: translateY(5px);
}

@media (orientation: landscape) and (max-height: 520px) {
    .floating-wink {
        top: max(6px, env(safe-area-inset-top));
        min-height: 34px;
        padding: 6px 12px;
        font-size: .88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .floating-wink,
    #floating-random-wink {
        transition: none;
    }
}


/* Connexion applicative */
.login-page {
    min-height: 100svh;
    margin: 0;
    background: radial-gradient(circle at 50% 10%, rgba(193, 117, 140, .22), transparent 38%), #171318;
}
.login-shell {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.login-card {
    width: min(100%, 430px);
    padding: 32px 24px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 28px;
    background: rgba(35, 28, 36, .94);
    box-shadow: 0 24px 70px rgba(0,0,0,.38);
    text-align: center;
}
.login-card__icon { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 14px; }
.login-card h1 { margin: 0; font-size: clamp(2rem, 10vw, 3rem); line-height: .98; }
.login-card h1 em { color: #e5a5b8; font-style: italic; }
.login-card__intro { color: rgba(255,255,255,.68); margin: 16px 0 24px; }
.login-card__error { padding: 11px 13px; border-radius: 12px; background: rgba(210,75,90,.15); color: #ffc5cc; text-align: left; }
.login-form { display: grid; gap: 16px; text-align: left; }
.login-form .button { width: 100%; margin-top: 4px; }
.logout-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.logout-form .button { width: 100%; }
.button--danger-soft { color: #ffc1c8; border-color: rgba(255,130,145,.28); }


/* v1.2.1 — contraste renforcé de l'écran de connexion */
.login-page,
.login-page * { color-scheme: dark; }
.login-card { color: #fff8fb; }
.login-card .eyebrow { color: #f1c987; }
.login-card h1 { color: #fffafb; text-shadow: 0 2px 18px rgba(0,0,0,.28); }
.login-card__intro { color: #e6dce1; }
.login-form .field > span { color: #fff7fa; }
.login-form .field input {
    width: 100%;
    min-width: 0;
    color: #fff !important;
    caret-color: #fff;
    background: #302731 !important;
    border: 1px solid #756472 !important;
    -webkit-text-fill-color: #fff;
    opacity: 1;
}
.login-form .field input::placeholder { color: #c9bcc3; opacity: 1; }
.login-form .field input:hover { border-color: #a98f9f !important; }
.login-form .field input:focus {
    border-color: #efaabc !important;
    box-shadow: 0 0 0 4px rgba(239,170,188,.22) !important;
    outline: none;
}
.login-form .field input:-webkit-autofill,
.login-form .field input:-webkit-autofill:hover,
.login-form .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 0 0 1000px #302731 inset !important;
    border-color: #9d8494 !important;
    transition: background-color 9999s ease-out 0s;
}
.login-form .button--primary {
    color: #26161d;
    background: #f0b2c2;
    border-color: #f0b2c2;
    font-weight: 900;
}
.login-form .button--primary:hover { background: #ffc5d3; border-color: #ffc5d3; }
.login-card__error { background: #56242d; color: #ffdbe0; border: 1px solid #a94c5c; }

/* La photo précédente reste visible pendant le fondu de la suivante. */
.slideshow__media img,
.slideshow__media video { transition: opacity .28s ease; }

/* v1.2.2 — centrage fiable des médias du diaporama sur iPhone en portrait */
.slideshow,
.slideshow__stage,
.slideshow__media {
    width: 100%;
    height: 100%;
    height: 100dvh;
}

.slideshow__media img,
.slideshow__media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: 50% 50%;
}

@supports (-webkit-touch-callout: none) {
    @media (orientation: portrait) {
        .slideshow__media img,
        .slideshow__media video {
            position: absolute;
            inset: 0;
            margin: auto;
            object-position: center center;
        }
    }
}


/* v1.3.0 — liens musicaux et vérification de session */
.link-picker { margin: 2px 0 14px; padding: 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 16px; background: rgba(255,255,255,.035); }
.link-picker__heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; color:#f8f1f4; }
.link-picker__heading div { display:grid; gap:2px; }
.link-picker__heading small { color:#cabec5; font-weight:400; }
.link-picker__heading > span { font-size:1.45rem; color:#efa0ad; }
.link-picker__input-row { position:relative; display:flex; align-items:center; }
.link-picker__input-row input { width:100%; min-width:0; padding-right:48px; color:#f9f5f7; background:#2b2229; border-color:rgba(255,255,255,.15); }
.link-picker__input-row input::placeholder { color:#aa9da5; opacity:1; }
.link-picker__input-row .icon-button { position:absolute; right:5px; width:36px; height:36px; }
.link-preview-status { min-height:22px; margin-top:8px; color:#cfc1c8; font-size:.84rem; display:flex; align-items:center; gap:7px; }
.link-preview-status.is-error { color:#ffb0b8; }
.link-preview-status.is-success { color:#b9e8cb; }
.inline-spinner { width:14px; height:14px; border:2px solid rgba(255,255,255,.25); border-top-color:#efa0ad; border-radius:50%; animation:spin .7s linear infinite; flex:0 0 auto; }
.link-preview { display:grid; grid-template-columns:62px minmax(0,1fr) auto; align-items:center; gap:11px; margin-top:7px; padding:9px; border-radius:13px; background:#20191f; border:1px solid rgba(255,255,255,.1); }
.link-preview img { width:62px; height:62px; object-fit:cover; border-radius:9px; }
.link-preview div { display:grid; gap:3px; min-width:0; }
.link-preview small { color:#efa0ad; text-transform:uppercase; letter-spacing:.07em; font-size:.68rem; }
.link-preview strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#fff; }
.link-preview > span { color:#b9e8cb; font-weight:800; }
.media-grid__item--link::after { content:''; position:absolute; inset:35% 0 0; background:linear-gradient(transparent,rgba(5,3,5,.88)); pointer-events:none; }
.media-grid__provider,.media-grid__link-title { position:absolute; z-index:2; left:12px; right:12px; text-align:left; pointer-events:none; }
.media-grid__provider { bottom:39px; color:#ffb0ba; text-transform:uppercase; font-size:.64rem; letter-spacing:.08em; font-weight:800; }
.media-grid__link-title { bottom:12px; color:#fff; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.media-grid__item--link .media-grid__play { z-index:3; top:42%; }
.media-preview__provider { position:absolute; left:5px; bottom:5px; max-width:calc(100% - 10px); padding:3px 6px; border-radius:6px; background:rgba(0,0,0,.72); color:#fff; font-size:.58rem; text-transform:uppercase; }
.slideshow-link { position:absolute; inset:0; display:grid; place-items:center; overflow:hidden; color:#fff; text-decoration:none; background:#09070a; }
.slideshow-link > img { width:100%; height:100%; object-fit:contain; filter:saturate(.95); }
.slideshow-link__shade { position:absolute; inset:0; background:linear-gradient(rgba(0,0,0,.08),rgba(0,0,0,.08) 42%,rgba(0,0,0,.86)); }
.slideshow-link__provider,.slideshow-link > strong,.slideshow-link__button { position:absolute; z-index:2; left:50%; translate:-50% 0; text-align:center; width:min(86%,620px); }
.slideshow-link__provider { bottom:30%; color:#ffc1c9; font-size:.8rem; text-transform:uppercase; letter-spacing:.13em; font-weight:800; }
.slideshow-link > strong { bottom:22%; font-size:clamp(1.2rem,4vw,2.2rem); text-shadow:0 2px 18px #000; }
.slideshow-link__button { top:calc(max(18px, env(safe-area-inset-top)) + 62px); bottom:auto; width:auto; padding:10px 16px; border-radius:999px; background:rgba(255,255,255,.92); color:#21171e; font-weight:800; white-space:nowrap; }
.slideshow__thumbnail--link::after { content:'♫'; position:absolute; inset:auto 3px 3px auto; width:18px; height:18px; display:grid; place-items:center; border-radius:50%; background:#efa0ad; color:#22171e; font-size:.68rem; }
@media (max-width:560px) { .link-preview { grid-template-columns:52px minmax(0,1fr) auto; }.link-preview img{width:52px;height:52px;} }


/* v1.3.2 — carte musicale compacte dans la frise */
.music-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 9px;
    border: 1px solid rgba(54, 35, 47, .10);
    border-radius: 16px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 18%, rgba(207, 139, 172, .24), transparent 34%),
        linear-gradient(135deg, #f6e8ee 0%, #eee5f4 52%, #f8ece8 100%);
    box-shadow: 0 8px 24px rgba(72, 40, 75, .11);
}
.music-card::before {
    content: '♫';
    position: absolute;
    z-index: -1;
    right: 72px;
    top: 50%;
    translate: 0 -52%;
    color: rgba(112, 71, 104, .09);
    font-size: 5.2rem;
    line-height: 1;
    rotate: -8deg;
    pointer-events: none;
}
.music-card--deezer {
    border-color: rgba(151, 91, 161, .23);
    background:
        radial-gradient(circle at 88% 18%, rgba(218, 104, 151, .25), transparent 35%),
        linear-gradient(135deg, #f7e6ec 0%, #eee3f5 56%, #f8ece8 100%);
}
.music-card--spotify {
    border-color: rgba(55, 132, 93, .22);
    background:
        radial-gradient(circle at 88% 18%, rgba(70, 168, 116, .21), transparent 35%),
        linear-gradient(135deg, #edf3e9 0%, #e7efe8 55%, #f7eee8 100%);
}
.music-card--youtube,
.music-card--youtube_music {
    border-color: rgba(177, 71, 75, .20);
    background:
        radial-gradient(circle at 88% 18%, rgba(215, 91, 99, .20), transparent 35%),
        linear-gradient(135deg, #f8e8e8 0%, #f2e5ec 55%, #f8eee9 100%);
}
.music-card.media-placeholder {
    background-color: #eadfdd;
    background-image: linear-gradient(110deg, #eadfdd 8%, #f8f0ee 18%, #eadfdd 33%);
    background-size: 200% 100%;
    animation: placeholder-shimmer 1.35s linear infinite;
}
.music-card.media-placeholder.is-loaded {
    background-color: transparent;
    background-size: auto;
    animation: none;
}
.music-card__artwork {
    position: relative;
    display: block;
    width: 72px;
    height: 72px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 11px;
    background: #201820;
    cursor: pointer;
}
.music-card__artwork img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .25s ease, transform .2s ease;
}
.music-card.is-loaded .music-card__artwork img { opacity: 1; }
.music-card__artwork:active img { transform: scale(.97); }
.music-card__play {
    position: absolute;
    inset: 50% auto auto 50%;
    translate: -50% -50%;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding-left: 2px;
    border-radius: 50%;
    background: rgba(20, 12, 18, .72);
    color: #fff;
    font-size: .72rem;
    backdrop-filter: blur(4px);
}
.music-card__details {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.music-card__provider {
    color: var(--rose-dark);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.music-card__details strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: .94rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.music-card__listen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid rgba(169, 83, 98, .22);
    border-radius: 999px;
    background: #fff;
    color: var(--rose-dark);
    font-size: .78rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}
.music-card__listen:active { transform: scale(.97); }
.music-card__listen:focus-visible,
.music-card__artwork:focus-visible {
    outline: 3px solid rgba(217, 135, 147, .35);
    outline-offset: 2px;
}

@media (max-width: 430px) {
    .music-card {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 9px;
        padding: 8px;
    }
    .music-card__artwork { width: 58px; height: 58px; border-radius: 9px; }
    .music-card__play { width: 26px; height: 26px; font-size: .62rem; }
    .music-card__listen { min-height: 36px; padding: 0 10px; }
    .music-card__listen span:first-child { display: none; }
    .music-card__listen span:last-child { font-size: 1rem; }
}


/* v1.3.3 — identité visuelle des souvenirs musicaux */
@media (max-width: 430px) {
    .music-card::before {
        right: 48px;
        font-size: 4.2rem;
    }
}


/* v1.3.4 — identité musicale appliquée à toute la tuile */
.timeline-item--music .memory-card {
    position: relative;
    isolation: isolate;
    border: 1px solid rgba(155, 91, 143, .16);
    background:
        radial-gradient(circle at 92% 14%, rgba(210, 135, 169, .17), transparent 31%),
        linear-gradient(145deg, rgba(255, 250, 248, .98) 0%, rgba(247, 235, 240, .98) 55%, rgba(241, 231, 242, .98) 100%);
    box-shadow: 0 18px 48px rgba(80, 48, 73, .13);
}
.timeline-item--music .memory-card::before {
    content: '♫';
    position: absolute;
    z-index: -1;
    top: 42px;
    right: 24px;
    color: rgba(114, 72, 105, .055);
    font-size: clamp(5rem, 16vw, 8rem);
    line-height: 1;
    rotate: -9deg;
    pointer-events: none;
}
.timeline-item--music .timeline-item__marker span {
    background: linear-gradient(145deg, #d98793, #aa688f);
    box-shadow: 0 0 0 2px rgba(173, 105, 145, .28), 0 5px 14px rgba(105, 56, 93, .18);
}
.timeline-item--music .memory-card time,
.timeline-item--music .music-card__provider {
    color: #a65269;
}
.timeline-item--music .music-card {
    border-color: rgba(132, 78, 118, .14);
    background: rgba(255, 255, 255, .48);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 22px rgba(72, 40, 75, .08);
    backdrop-filter: blur(7px);
}
.timeline-item--music .music-card::before {
    opacity: .72;
}
.timeline-item--music-deezer .memory-card {
    background:
        radial-gradient(circle at 92% 14%, rgba(210, 111, 160, .18), transparent 31%),
        linear-gradient(145deg, #fffaf8 0%, #f7e9ef 56%, #efe6f4 100%);
}
.timeline-item--music-spotify .memory-card {
    border-color: rgba(69, 135, 99, .14);
    background:
        radial-gradient(circle at 92% 14%, rgba(72, 161, 111, .14), transparent 31%),
        linear-gradient(145deg, #fffaf8 0%, #edf4ea 56%, #f4ece8 100%);
}
.timeline-item--music-youtube .memory-card,
.timeline-item--music-youtube_music .memory-card {
    border-color: rgba(177, 73, 79, .14);
    background:
        radial-gradient(circle at 92% 14%, rgba(215, 91, 99, .14), transparent 31%),
        linear-gradient(145deg, #fffaf8 0%, #f7e9ea 56%, #f2e7ee 100%);
}
@media (max-width: 430px) {
    .timeline-item--music .memory-card::before {
        top: 54px;
        right: 12px;
        font-size: 5.4rem;
    }
}

/* v1.4 · souvenirs à revivre, conversations et réactions */
.memory-today {
    margin: 18px 16px 26px;
    padding: 18px;
    border: 1px solid rgba(217,135,147,.28);
    border-radius: 26px;
    background: linear-gradient(145deg, #2b2029, #181318);
    box-shadow: 0 18px 45px rgba(34,20,30,.22);
    color: white;
}
.memory-today__heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.memory-today__heading > span { color: #e7a5ae; font-size: 2rem; }
.memory-today__heading small { display: block; color: var(--gold); font-size: .68rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.memory-today__heading strong { display: block; margin-top: 2px; font-family: Georgia, serif; font-size: 1.3rem; }
.memory-today__list { display: grid; gap: 9px; }
.memory-today__item { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid rgba(255,255,255,.09); border-radius: 18px; background: rgba(255,255,255,.055); color: white; text-align: left; }
.memory-today__item img, .memory-today__placeholder { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 13px; object-fit: cover; background: rgba(217,135,147,.14); }
.memory-today__literary {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 62px;
    height: 62px;
    overflow: hidden;
    padding: 7px 7px 6px;
    border-radius: 13px;
    background: linear-gradient(145deg, #fffaf6, #eadbd3);
    color: #6f4c55;
    box-shadow: inset 0 0 0 1px rgba(155,101,112,.16);
}
.memory-today__literary b {
    position: absolute;
    top: 4px;
    right: 6px;
    color: #b06f7c;
    font-size: .72rem;
    line-height: 1;
}
.memory-today__literary em {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    white-space: pre-line;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .49rem;
    font-style: italic;
    line-height: 1.22;
}
.memory-today__literary::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 13px;
    background: linear-gradient(to bottom, rgba(234,219,211,0), rgba(234,219,211,.96));
    pointer-events: none;
}
.memory-today__item small { display: block; margin-bottom: 3px; color: #e7a5ae; font-weight: 800; }
.memory-today__item strong { font-family: Georgia, serif; font-size: 1.05rem; }

.memory-social { margin-top: 17px; padding-top: 14px; border-top: 1px solid rgba(120,109,117,.14); }
.reaction-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.reaction-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 39px; height: 38px; padding: 0 10px; border: 1px solid #eadfdb; border-radius: 999px; background: #fff; font-size: 1.15rem; transition: transform .15s, background .15s, border-color .15s; }
.reaction-button:active { transform: scale(.92); }
.reaction-button.is-active { border-color: rgba(217,135,147,.65); background: #fff0f2; box-shadow: 0 5px 14px rgba(169,83,98,.12); }
.reaction-button small { color: var(--rose-dark); font-size: .72rem; font-weight: 900; }
.conversation-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 10px; padding: 10px 4px 3px; border: 0; background: transparent; color: var(--ink); font-weight: 800; text-align: left; }
.conversation-toggle small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.conversation-panel { margin-top: 10px; }
.comment-list { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; padding: 2px; }
.comment-list__empty { margin: 3px 0 8px; color: var(--muted); font-size: .83rem; font-style: italic; }
.comment { position: relative; max-width: 88%; padding: 10px 12px; border-radius: 15px 15px 15px 5px; background: #eee7e3; }
.comment--mine { justify-self: end; border-radius: 15px 15px 5px 15px; background: #f9e2e6; }
.comment > div { display: flex; align-items: baseline; gap: 8px; padding-right: 16px; }
.comment strong { font-size: .76rem; }
.comment time { color: var(--muted); font-size: .64rem; }
.comment p { margin: 4px 0 0; line-height: 1.4; white-space: pre-wrap; }
.comment__delete { position: absolute; top: 4px; right: 5px; width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); font-size: 1rem; }
.comment-form { display: grid; grid-template-columns: 1fr 42px; gap: 7px; margin-top: 10px; }
.comment-form input { min-width: 0; height: 42px; padding: 0 14px; border: 1px solid #ded2ce; border-radius: 999px; background: #fff; color: #342b2d; caret-color: var(--rose-dark); -webkit-text-fill-color: #342b2d; }
.comment-form input::placeholder { color: #8f7f82; opacity: 1; -webkit-text-fill-color: #8f7f82; }
.comment-form input:focus { outline: 2px solid rgba(217,135,147,.28); border-color: var(--rose); }
.comment-form button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--rose), var(--rose-dark)); color: white; font-size: 1.15rem; font-weight: 900; }

@media (min-width: 700px) {
    .memory-today { margin-inline: 30px 16px; }
    .memory-today__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.timeline-item--highlighted .memory-card { animation: memory-highlight 2.2s ease; }
@keyframes memory-highlight {
    0%, 100% { box-shadow: var(--shadow); }
    25%, 70% { box-shadow: 0 0 0 4px rgba(217,135,147,.28), 0 22px 55px rgba(169,83,98,.3); }
}


/* v1.4.1 — diagnostic des notifications */
.notification-diagnostic { padding: 0; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.025); }
.notification-diagnostic > summary { padding: 11px 13px; cursor: pointer; list-style: none; color: rgba(248,242,245,.64); font-size: .78rem; font-weight: 700; user-select: none; }
.notification-diagnostic > summary::-webkit-details-marker { display: none; }
.notification-diagnostic > summary::after { content: '›'; float: right; font-size: 1rem; transform: rotate(90deg); transition: transform .18s ease; }
.notification-diagnostic[open] > summary::after { transform: rotate(-90deg); }
.notification-diagnostic[open] > summary { color: rgba(248,242,245,.86); border-bottom: 1px solid rgba(255,255,255,.08); }
.notification-diagnostic__content { display: grid; gap: 10px; padding: 13px; }
.notification-diagnostic h3 { margin: 0; font-family: Georgia, serif; font-size: 1.05rem; }
.notification-diagnostic__grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: .78rem; }
.notification-diagnostic__grid dt { color: rgba(248,242,245,.68); }
.notification-diagnostic__grid dd { margin: 0; text-align: right; font-weight: 800; }
.notification-diagnostic__grid .is-ok { color: #9ee6b2; }
.notification-diagnostic__grid .is-warning { color: #ffd28c; }
.notification-diagnostic__grid .is-error { color: #ff9da8; }
.notification-diagnostic__message { min-height: 1.2em; margin: 0; color: rgba(248,242,245,.76); font-size: .78rem; line-height: 1.4; }
.notification-diagnostic__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notification-debug-details { margin-top: 4px; font-size: .75rem; }
.notification-debug-details summary { cursor: pointer; color: rgba(248,242,245,.82); font-weight: 700; }
.notification-debug-details pre { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.25); color: #fff; font-size: .68rem; line-height: 1.35; }


/* v1.5.0 — textes et poèmes comme pages-souvenirs */
.literary-field textarea {
    min-height: 180px;
    line-height: 1.6;
    resize: vertical;
}
.field__hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .72rem;
}
.literary-card {
    width: 100%;
    margin: 14px 0 4px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(180, 137, 122, .24);
    border-radius: 17px;
    background:
        linear-gradient(145deg, rgba(255, 250, 246, .98), rgba(244, 232, 225, .96)),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(121, 90, 82, .05) 27px 28px);
    color: #453538;
    text-align: left;
    box-shadow: inset 0 1px rgba(255,255,255,.78);
}
.literary-card__eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #9b6570;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.literary-card__text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    white-space: pre-wrap;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .96rem;
    font-style: italic;
    line-height: 1.58;
}
.literary-card__action {
    display: block;
    margin-top: 12px;
    color: #9b6570;
    font-size: .73rem;
    font-weight: 800;
}
.slideshow-text-page {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: max(86px, calc(env(safe-area-inset-top) + 76px)) 58px max(155px, calc(env(safe-area-inset-bottom) + 132px));
    background:
        radial-gradient(circle at 50% 20%, rgba(126, 83, 98, .18), transparent 38%),
        #0b080b;
}
.slideshow-text-page__inner {
    width: min(760px, 100%);
    margin: auto;
    padding: clamp(25px, 5vw, 54px);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255,250,246,.97), rgba(239,226,219,.96));
    color: #3e3033;
    box-shadow: 0 24px 80px rgba(0,0,0,.42);
}
.slideshow-text-page__mark {
    display: block;
    margin-bottom: 18px;
    color: #a66d78;
    font-size: 1.3rem;
    text-align: center;
}
.slideshow-text-page p {
    margin: 0;
    white-space: pre-wrap;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1rem, 3vw, 1.45rem);
    font-style: italic;
    line-height: 1.75;
    text-align: center;
}

.literary-card__author {
    display: block;
    margin-top: 10px;
    color: #9b6570;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .82rem;
    font-style: italic;
    font-weight: 700;
    text-align: right;
}
.slideshow-text-page__author {
    margin-top: 26px;
    color: #8f626b;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(.88rem, 2.3vw, 1.05rem);
    font-style: italic;
    font-weight: 700;
    text-align: right;
}

.slideshow__thumbnail--text {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f7ebe5, #dfc9c2);
}
.slideshow__thumbnail-text {
    color: #76525b;
    font-size: 1.35rem;
}
@media (max-width: 699px) {
    .slideshow-text-page {
        padding-left: 28px;
        padding-right: 28px;
    }
    .slideshow-text-page__inner {
        padding: 24px 20px;
        border-radius: 19px;
    }
    .slideshow-text-page p {
        font-size: clamp(.94rem, 4.3vw, 1.18rem);
        line-height: 1.65;
    }
}


/* Pull to refresh */
.pull-refresh {
    --pull-distance: 0px;
    position: fixed;
    z-index: 1200;
    top: max(8px, env(safe-area-inset-top));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(31, 24, 30, .9);
    box-shadow: 0 10px 30px rgba(24,12,20,.22);
    color: #fff7f1;
    font-size: .78rem;
    font-weight: 750;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-54px + var(--pull-distance)));
    transition: opacity .12s ease, transform .12s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.pull-refresh--visible { opacity: 1; }
.pull-refresh--ready { border-color: rgba(205,167,108,.65); }
.pull-refresh--refreshing { transition: opacity .18s ease, transform .18s ease; }
.pull-refresh--refreshing .pull-refresh__icon { animation: pull-refresh-spin .8s linear infinite; }
.pull-refresh__icon { color: var(--gold); font-size: 1rem; line-height: 1; }
@keyframes pull-refresh-spin { to { transform: rotate(360deg); } }

/* v1.5.2 — création guidée par type de souvenir */
.event-type-picker {
    display: grid;
    gap: 16px;
    padding: 4px 0 8px;
}
.event-type-picker__intro {
    margin: 0;
    color: #f7eef2;
    font-size: 1rem;
    font-weight: 800;
}
.event-type-picker__grid {
    display: grid;
    gap: 12px;
}
.event-type-card {
    width: 100%;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
    color: #fff;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.event-type-card:active {
    transform: scale(.99);
    background: rgba(217,135,147,.11);
    border-color: rgba(239,160,173,.44);
}
.event-type-card__icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: #fff5f7;
    background: linear-gradient(145deg, rgba(222, 104, 137, .72), rgba(170, 72, 103, .54));
    border: 1px solid rgba(255, 145, 174, .66);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.16),
        0 5px 14px rgba(107, 43, 66, .18);
}
.event-type-card__icon svg {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.event-type-card > span:last-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.event-type-card strong { font-size: 1rem; }
.event-type-card small { color: #cbbdc5; font-size: .78rem; line-height: 1.3; }

.event-form-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.event-type-change {
    align-self: flex-start;
    order: 0;
    margin: -2px 0 13px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #efa0ad;
    font: inherit;
    font-size: .8rem;
    font-weight: 750;
    cursor: pointer;
}
.event-section--date { order: 1; }
.event-section--media,
.event-section--link,
.event-section--literary { order: 2; }
.event-section--title { order: 3; }
.event-section--description { order: 4; }
.event-form-error { order: 5; }
.event-form-content .modal__actions { order: 6; }

/* En modification, conserver la disposition historique et toutes les possibilités. */
.event-form-content[data-event-type="edit"] .event-section--date { order: 1; }
.event-form-content[data-event-type="edit"] .event-section--title { order: 2; }
.event-form-content[data-event-type="edit"] .event-section--description { order: 3; }
.event-form-content[data-event-type="edit"] .event-section--literary { order: 4; }
.event-form-content[data-event-type="edit"] .event-section--link { order: 5; }
.event-form-content[data-event-type="edit"] .event-section--media { order: 6; }
.event-form-content[data-event-type="edit"] .form-error { order: 7; }
.event-form-content[data-event-type="edit"] .modal__actions { order: 8; }

.event-section--media { margin-bottom: 16px; }
.event-section--media .upload-zone { margin-bottom: 8px; }
.event-section--link { margin-bottom: 16px; }

/* iOS centre parfois la valeur d'un input date malgré le reste du formulaire. */
.field input[type="date"] {
    text-align: left;
    text-align-last: left;
}
.field input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    margin: 0;
}

/* v1.5.4 — date : un seul champ natif, compact et stable sur iOS */
.event-section--date .date-field__label {
    display: block;
    margin-bottom: 8px;
}
.date-control {
    position: relative;
    display: block;
    width: 100%;
    height: 54px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 15px;
    background: rgba(16,12,16,.48);
    overflow: hidden;
}
.event-section--date .date-control input[type="date"] {
    display: block;
    width: 100%;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 0 48px 0 16px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 54px;
    text-align: left;
    text-align-last: left;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.event-section--date .date-control input[type="date"]::-webkit-date-and-time-value {
    display: flex;
    align-items: center;
    height: 54px;
    min-height: 54px;
    margin: 0;
    padding: 0;
    text-align: left;
}
.event-section--date .date-control input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}
.date-control__chevron {
    position: absolute;
    z-index: 2;
    right: 19px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 3px solid var(--rose);
    border-bottom: 3px solid var(--rose);
    transform: translateY(-68%) rotate(45deg);
    pointer-events: none;
}
.date-control:focus-within {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(217,135,147,.15);
}

/* v1.5.4 — aperçu des textes : conserver la respiration des vers sans agrandir la frise */
.literary-card {
    position: relative;
    overflow: hidden;
}
.literary-card__text {
    display: block;
    position: relative;
    max-height: 9.5em;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: .96rem;
    font-style: italic;
    line-height: 1.58;
}
.literary-card__text::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.4em;
    background: linear-gradient(to bottom, rgba(244,232,225,0), rgba(244,232,225,.98));
    pointer-events: none;
}
