/*
 * ================================================================
 * FDML — Agenda Ultra
 * Refonte visuelle complète, mobile-first.
 * ================================================================
 */

#main > .inner.agenda-inner {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
}

.icons li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.icons .navbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    padding: 0;
    margin: 0;
}

.newsletter-menu-icon {
    display: block;
    width: 90px;
    height: 90px;
}

#banner.agenda {
    position: relative;
    isolation: isolate;
    min-height: 0;
    padding: 0;
    overflow: visible;
    background: #f5f5f7 !important;
}

#banner.agenda::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 15% 15%, rgba(67, 202, 164, 0.17), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(102, 45, 145, 0.14), transparent 26%),
        radial-gradient(circle at 68% 72%, rgba(242, 169, 28, 0.12), transparent 30%),
        #f5f5f7;
}

.agenda-app {
    width: min(100%, 1880px);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 46px);
}

/* Header compact */
.agenda-topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.agenda-eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: #d00d50;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.agenda-topbar h1 {
    min-height: 0;
    margin: 0;
    color: #18181b;
    font-size: clamp(2.5rem, 5vw, 5.3rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.agenda-topbar p {
    margin: 10px 0 0;
    color: #65656b;
    font-size: clamp(0.98rem, 1.1vw, 1.18rem);
}

.agenda-mobile-filter-button {
    display: none;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: #18181b;
    color: #ffffff;
    font-weight: 800;
}

/* Search bar */
.agenda-searchbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(230px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 20px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    backdrop-filter: blur(14px);
}

.agenda-search-field {
    position: relative;
}

.agenda-search-field svg {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: none;
    stroke: #76767d;
    stroke-width: 2;
}

.agenda-search-field input,
.agenda-house-select {
    width: 100%;
    min-height: 50px;
    border: 1px solid #e3e3e7;
    border-radius: 14px;
    background: #fafafa;
    color: #18181b;
    font-size: 0.95rem;
}

.agenda-search-field input {
    padding: 0 16px 0 46px;
}

.agenda-house-select {
    padding: 0 14px;
}

.agenda-reset-button {
    min-height: 50px;
    padding: 0 20px;
    border: 0 !important;
    border-radius: 14px;
    background: #18181b !important;
    color: #ffffff !important;
    font-weight: 850;
    cursor: pointer;
}

.agenda-reset-button:hover,
.agenda-reset-button:focus {
    background: #d00d50 !important;
}

/* Tabs */
.agenda-tabs {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 5px;
    border-radius: 16px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 8px 24px rgba(0,0,0,0.055);
}

.agenda-tab {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #6b6b72;
    font-weight: 850;
}

.agenda-tab span {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ececef;
    font-size: 0.75rem;
}

.agenda-tab.is-active {
    background: #18181b;
    color: #ffffff;
}

.agenda-tab.is-active span {
    background: rgba(255,255,255,0.16);
}

/* Main layout */
.agenda-layout {
    display: grid;
    grid-template-columns: clamp(340px, 28vw, 520px) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 28px);
    align-items: start;
}

.agenda-list-panel,
.agenda-detail-panel {
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 24px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 18px 48px rgba(0,0,0,0.09);
    backdrop-filter: blur(14px);
}

.agenda-list-panel {
    padding: 16px;
}

.agenda-detail-panel {
    min-height: 640px;
    padding: clamp(18px, 2vw, 28px);
}

.agenda-list-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.agenda-small-label {
    display: block;
    margin-bottom: 2px;
    color: #98989f;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.agenda-list-heading strong {
    color: #18181b;
    font-size: 1.05rem;
}

.agenda-mobile-activity-select {
    display: none;
}

.agenda-list-view {
    display: none;
}

.agenda-list-view.is-active {
    display: block;
}

#u46517,
#u465178 {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

/* Activity cards */
.agenda-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ededf0;
    border-radius: 18px;
    background: #ffffff;
    color: #18181b;
    text-decoration: none !important;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.agenda-item:hover {
    transform: translateY(-2px);
    border-color: rgba(208,13,80,0.35);
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.agenda-item.agenda-active {
    border-color: #d00d50;
    background: #fff8fb;
    box-shadow: 0 12px 28px rgba(208,13,80,0.12);
}

.agenda-item-date {
    display: flex;
    min-height: 68px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(145deg, #662d91, #7f4aad);
    color: #ffffff;
}

.agenda-item.is-public .agenda-item-date {
    background: linear-gradient(145deg, #d00d50, #ec4a84);
}

.agenda-item-date-day {
    font-size: 1.55rem;
    font-weight: 950;
    line-height: 1;
}

.agenda-item-date-month {
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.agenda-item-title {
    display: block;
    color: #18181b;
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.25;
}

.agenda-item-house {
    display: block;
    margin-top: 4px;
    color: #55555c;
    font-size: 0.82rem;
    font-weight: 800;
}

.agenda-item-meta {
    display: block;
    margin-top: 4px;
    color: #8a8a91;
    font-size: 0.78rem;
}

.agenda-empty-list {
    padding: 18px;
    border-radius: 16px;
    background: #f5f5f7;
    color: #68686f;
    font-weight: 800;
}

/* Placeholder */
.agenda-placeholder {
    display: flex;
    min-height: 580px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.agenda-placeholder-symbol {
    display: inline-flex;
    width: 78px;
    height: 78px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border-radius: 24px;
    background: #18181b;
    color: #ffffff;
    font-size: 2rem;
}

.agenda-placeholder h2 {
    min-height: 0;
    margin: 0 0 10px;
    color: #18181b;
    font-size: clamp(1.8rem, 3vw, 3rem);
}

.agenda-placeholder p {
    max-width: 520px;
    margin: 0 auto;
    color: #707077;
    font-size: 1.02rem;
    line-height: 1.7;
}

/* Detail */
.agenda-detail {
    display: none;
}

.agenda-detail.is-visible {
    display: block;
}

.agenda-detail-visual {
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
    gap: 22px;
}

.agenda-image {
    display: block;
    overflow: hidden;
    min-height: 420px;
    border-radius: 22px;
    background: #ececef;
}

.agenda-image img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    display: block;
}

.agenda-image.is-hidden {
    display: none;
}

.agenda-detail-visual.has-no-image {
    grid-template-columns: 1fr;
}

.agenda-detail-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 420px;
    padding: clamp(24px, 3vw, 44px);
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(102,45,145,0.18), transparent 35%),
        #f4eef8;
}

.agenda-detail.is-large-public .agenda-detail-summary {
    background:
        radial-gradient(circle at top right, rgba(208,13,80,0.18), transparent 35%),
        #fff1f6;
}

.agenda-detail-house {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 12px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(102,45,145,0.12);
    color: #662d91;
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.agenda-detail.is-large-public .agenda-detail-house {
    background: rgba(208,13,80,0.12);
    color: #d00d50;
}

.agenda-detail-title {
    min-height: 0;
    margin: 0 0 22px;
    color: #18181b;
    font-size: clamp(2.2rem, 4vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
}

.agenda-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}

.agenda-meta-card {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 15px;
    background: rgba(255,255,255,0.88);
    color: #26262a;
    font-size: 0.9rem;
}

.agenda-detail-content {
    max-width: 1100px;
    padding-top: 28px;
    color: #34343a;
    font-size: 1.05rem;
    line-height: 1.82;
}

.agenda-detail-content p {
    margin-bottom: 1rem;
}

.agenda-detail-extras {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.agenda-extra-item {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f5f5f7;
    color: #38383d;
}

.agenda-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.agenda-primary-action,
.agenda-secondary-action {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    font-weight: 900;
    cursor: pointer;
}

.agenda-primary-action {
    border: 0;
    background: #d00d50;
    color: #ffffff;
}

.agenda-secondary-action {
    border: 1px solid #d7d7dc;
    background: #ffffff;
    color: #18181b;
}

.agenda-loading,
.agenda-error {
    display: none;
    margin-bottom: 14px;
    padding: 13px 16px;
    border-radius: 14px;
    font-weight: 850;
    text-align: center;
}

.agenda-loading.is-visible {
    display: block;
    background: #fff1f6;
    color: #d00d50;
}

.agenda-error.is-visible {
    display: block;
    background: #fff0f0;
    color: #9f1c1c;
}

/* Newsletter */
html {
    scroll-behavior: smooth;
}

.newsletter-section {
    scroll-margin-top: 30px;
    margin: 36px auto 28px;
    width: min(calc(100% - 36px), 1880px);
    padding: 28px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 14px 36px rgba(0,0,0,0.07);
}

.newsletter-section::before,
.newsletter-section::after {
    display: none !important;
}

.newsletter-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.newsletter-intro {
    flex: 1 1 auto;
}

.newsletter-intro h2 {
    min-height: 0;
    margin: 0 0 8px;
    color: #d00d50;
}

.newsletter-intro p {
    margin: 0;
}

.newsletter-action {
    flex: 0 0 320px;
}

.newsletter-button {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #d00d50;
    color: #ffffff !important;
    font-weight: 900;
    text-decoration: none;
}

footer {
    border-top: 0 !important;
}

/* Responsive */
@media (max-width: 1180px) {
    .agenda-layout {
        grid-template-columns: 390px minmax(0,1fr);
    }

    .agenda-detail-visual {
        grid-template-columns: 1fr;
    }

    .agenda-image {
        max-height: 460px;
    }
}

@media (max-width: 900px) {
    .agenda-mobile-filter-button {
        display: inline-flex;
        align-items: center;
    }

    .agenda-searchbar {
        display: none;
        grid-template-columns: 1fr;
    }

    .agenda-searchbar.is-open {
        display: grid;
    }

    .agenda-layout {
        grid-template-columns: 1fr;
    }

    .agenda-list-panel {
        order: 1;
    }

    .agenda-detail-panel {
        order: 2;
        min-height: 0;
    }

    .agenda-mobile-activity-select {
        display: block;
        max-width: 230px;
    }

    #u46517,
    #u465178 {
        max-height: 440px;
    }
}

@media (max-width: 640px) {
    .agenda-app {
        padding: 16px 12px 24px;
    }

    .agenda-topbar {
        align-items: center;
    }

    .agenda-topbar p {
        max-width: 260px;
        font-size: 0.9rem;
    }

    .agenda-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .agenda-tab {
        justify-content: center;
        padding: 0 10px;
        font-size: 0.85rem;
    }

    .agenda-list-panel,
    .agenda-detail-panel {
        border-radius: 18px;
        padding: 14px;
    }

    .agenda-list-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-mobile-activity-select {
        max-width: none;
        width: 100%;
    }

    .agenda-item {
        grid-template-columns: 58px minmax(0,1fr);
        padding: 10px;
        border-radius: 15px;
    }

    .agenda-item-date {
        min-height: 58px;
        border-radius: 14px;
    }

    .agenda-detail-summary {
        min-height: 0;
        padding: 20px;
    }

    .agenda-detail-title {
        font-size: clamp(2rem, 11vw, 3.3rem);
    }

    .agenda-meta-grid {
        grid-template-columns: 1fr;
    }

    .agenda-image {
        min-height: 280px;
    }

    .agenda-image img {
        min-height: 280px;
    }

    .agenda-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .agenda-primary-action,
    .agenda-secondary-action {
        width: 100%;
    }

    .newsletter-section {
        width: calc(100% - 24px);
        padding: 22px 16px;
    }

    .newsletter-container {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-action {
        width: 100%;
        flex: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .agenda-item {
        transition: none;
    }
}


/* ================================================================
   PATCH FDML — Agenda Ultra v1.1
   Corrections DA, lisibilité, onglets, placeholder, images, boutons.
   ================================================================ */

/* En-tête plus compact et moins "vide" */
.agenda-app {
    padding-top: clamp(18px, 2.2vw, 34px);
}

.agenda-topbar {
    margin-bottom: 14px;
}

.agenda-eyebrow {
    color: #d00d50 !important;
}

.agenda-topbar h1 {
    color: #2a2a2a;
    font-size: clamp(2.15rem, 4vw, 4.4rem);
}

.agenda-topbar p {
    color: #555;
    text-transform: none;
}

/* Barre de filtres plus FDML */
.agenda-searchbar {
    border: 1px solid rgba(208, 13, 80, 0.10);
}

.agenda-reset-button {
    background: #d00d50 !important;
    color: #ffffff !important;
    border: 2px solid #d00d50 !important;
    box-shadow: 0 7px 16px rgba(208, 13, 80, 0.16);
}

.agenda-reset-button:hover,
.agenda-reset-button:focus {
    background: #ffffff !important;
    color: #d00d50 !important;
}

/* Onglets : suppression du noir, meilleure lisibilité */
.agenda-tabs {
    width: auto;
    gap: 10px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.agenda-tab {
    min-height: 48px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #4d4d4d;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.agenda-tab span {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.agenda-tab[data-tab="regular"] {
    border-color: rgba(102, 45, 145, 0.28);
    color: #662d91;
}

.agenda-tab[data-tab="public"] {
    border-color: rgba(208, 13, 80, 0.28);
    color: #d00d50;
}

.agenda-tab[data-tab="regular"].is-active {
    background: #662d91;
    border-color: #662d91;
    color: #ffffff;
}

.agenda-tab[data-tab="public"].is-active {
    background: #d00d50;
    border-color: #d00d50;
    color: #ffffff;
}

.agenda-tab.is-active span {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* Panneau liste plus lisible */
.agenda-list-panel,
.agenda-detail-panel {
    border: 1px solid rgba(255, 255, 255, 0.95);
}

.agenda-small-label {
    color: #d00d50;
}

/* Cartes activité : un peu moins comprimées, titres plus lisibles */
.agenda-item {
    border-color: #e9e9ee;
}

.agenda-item-title {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.agenda-item.agenda-active {
    border-color: #d00d50;
    background: #fff7fb;
}

/* Placeholder plus professionnel, sans gros symbole noir */
.agenda-placeholder {
    min-height: 520px;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(208, 13, 80, 0.28);
    border-radius: 22px;
    background:
        radial-gradient(circle at 20% 20%, rgba(208, 13, 80, 0.08), transparent 35%),
        radial-gradient(circle at 80% 30%, rgba(102, 45, 145, 0.08), transparent 34%),
        rgba(255, 255, 255, 0.78);
}

.agenda-placeholder-symbol {
    width: 68px;
    height: 68px;
    margin-bottom: 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, #d00d50, #662d91);
    color: #ffffff;
    font-size: 1.7rem;
    box-shadow: 0 12px 28px rgba(208, 13, 80, 0.18);
}

.agenda-placeholder h2 {
    color: #2a2a2a;
    font-size: clamp(1.65rem, 2.4vw, 2.55rem);
    letter-spacing: -0.03em;
}

.agenda-placeholder p {
    max-width: 560px;
    color: #555;
}

/* Détail : image dans un cadre toujours identique */
.agenda-detail-visual {
    grid-template-columns: minmax(290px, 36%) minmax(0, 1fr);
    align-items: stretch;
}

.agenda-image {
    position: relative;
    min-height: 430px;
    aspect-ratio: 4 / 5;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(102, 45, 145, 0.08), rgba(208, 13, 80, 0.08)),
        #f1f1f4;
}

.agenda-image img {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* En cas d'affiches très verticales ou horizontales, ajouter cette classe côté HTML/JS si besoin.
   Par défaut : cover pour un rendu stable et professionnel. */
.agenda-image.image-contain img {
    object-fit: contain;
    padding: 12px;
}

/* Fiche : DA FDML, moins "noir" */
.agenda-detail-summary {
    background:
        radial-gradient(circle at top right, rgba(102,45,145,0.16), transparent 35%),
        linear-gradient(135deg, rgba(102,45,145,0.10), rgba(102,45,145,0.04));
}

.agenda-detail.is-large-public .agenda-detail-summary {
    background:
        radial-gradient(circle at top right, rgba(208,13,80,0.16), transparent 35%),
        linear-gradient(135deg, rgba(208,13,80,0.10), rgba(208,13,80,0.04));
}

.agenda-detail-title {
    color: #222;
}

.agenda-meta-card {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

/* Boutons : correction blanc sur blanc */
.agenda-primary-action,
.agenda-secondary-action {
    min-width: 150px;
    border-radius: 14px;
    font-weight: 900;
    text-decoration: none !important;
}

.agenda-primary-action {
    border: 2px solid #d00d50 !important;
    background: #d00d50 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(208, 13, 80, 0.18);
}

.agenda-primary-action:hover,
.agenda-primary-action:focus {
    background: #ffffff !important;
    color: #d00d50 !important;
}

.agenda-secondary-action {
    border: 2px solid #662d91 !important;
    background: #ffffff !important;
    color: #662d91 !important;
}

.agenda-secondary-action:hover,
.agenda-secondary-action:focus {
    background: #662d91 !important;
    color: #ffffff !important;
}

/* Large public inactif mais lisible */
.agenda-tab:not(.is-active) {
    opacity: 1 !important;
}

/* Smartphone : filtres et onglets propres */
@media (max-width: 900px) {
    .agenda-mobile-filter-button {
        background: #d00d50 !important;
        color: #ffffff !important;
    }

    .agenda-searchbar.is-open {
        display: grid;
    }

    .agenda-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .agenda-tab {
        justify-content: center;
        padding: 0 12px;
        border-radius: 16px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    }
}

@media (max-width: 640px) {
    .agenda-placeholder {
        min-height: 300px;
        padding: 28px 18px;
    }

    .agenda-detail-visual {
        grid-template-columns: 1fr;
    }

    .agenda-image {
        min-height: 280px;
        aspect-ratio: 16 / 11;
    }

    .agenda-image img {
        min-height: 280px;
    }

    .agenda-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .agenda-primary-action,
    .agenda-secondary-action {
        width: 100%;
    }
}


/* ================================================================
   PATCH FDML — Agenda Ultra v1.2
   Lisibilité onglets + stabilité visuelle de la fiche.
   ================================================================ */

/* Le panneau de détail devient la référence de positionnement */
.agenda-detail-panel {
    position: relative;
    min-height: 640px;
    overflow: hidden;
}

/* Placeholder et fiche gardent une base de hauteur identique */
.agenda-placeholder,
.agenda-detail {
    min-height: 580px;
}

.agenda-detail {
    width: 100%;
}

/* Le loader ne pousse plus le contenu vers le bas */
.agenda-loading {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 20;
    width: auto;
    min-width: 180px;
    margin: 0;
    transform: translateX(-50%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

/* Le message d'erreur reste dans le flux mais ne provoque pas de saut important */
.agenda-error {
    margin-bottom: 12px;
}

/* Onglets : forcer les couleurs contre les styles globaux du template */
.agenda-tab,
.agenda-tab span {
    text-shadow: none !important;
}

.agenda-tab[data-tab="regular"]:not(.is-active) {
    background: #ffffff !important;
    border-color: #662d91 !important;
    color: #662d91 !important;
}

.agenda-tab[data-tab="regular"]:not(.is-active) span {
    background: rgba(102, 45, 145, 0.10) !important;
    color: #662d91 !important;
}

.agenda-tab[data-tab="public"]:not(.is-active) {
    background: #ffffff !important;
    border-color: #d00d50 !important;
    color: #d00d50 !important;
}

.agenda-tab[data-tab="public"]:not(.is-active) span {
    background: rgba(208, 13, 80, 0.10) !important;
    color: #d00d50 !important;
}

.agenda-tab[data-tab="regular"].is-active {
    background: #662d91 !important;
    border-color: #662d91 !important;
    color: #ffffff !important;
}

.agenda-tab[data-tab="public"].is-active {
    background: #d00d50 !important;
    border-color: #d00d50 !important;
    color: #ffffff !important;
}

.agenda-tab.is-active span {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* Le bouton conserve toujours son texte visible */
.agenda-reset-button {
    white-space: nowrap;
}

/* Stabilisation de l'image avant son chargement */
.agenda-image {
    aspect-ratio: 4 / 5;
    contain: layout paint;
}

.agenda-image img {
    aspect-ratio: 4 / 5;
}

/* La partie haute garde une hauteur stable lors du rendu AJAX */
.agenda-detail-visual {
    min-height: 430px;
}

.agenda-detail-summary {
    min-height: 430px;
}

/* Transition douce sans déplacement de mise en page */
.agenda-placeholder,
.agenda-detail {
    transition: opacity 0.16s ease;
}

.agenda-detail:not(.is-visible) {
    opacity: 0;
    pointer-events: none;
}

.agenda-detail.is-visible {
    opacity: 1;
}

@media (max-width: 1180px) {
    .agenda-detail-panel {
        min-height: 560px;
    }

    .agenda-placeholder,
    .agenda-detail {
        min-height: 500px;
    }

    .agenda-detail-visual,
    .agenda-detail-summary {
        min-height: 360px;
    }
}

@media (max-width: 640px) {
    .agenda-detail-panel {
        min-height: 0;
        overflow: visible;
    }

    .agenda-placeholder,
    .agenda-detail {
        min-height: 0;
    }

    .agenda-detail-visual,
    .agenda-detail-summary {
        min-height: 0;
    }

    .agenda-loading {
        position: fixed;
        top: 78px;
        left: 50%;
        z-index: 2000;
    }
}


.agenda-detail.is-loading {
    opacity: 0.58;
}


/* ================================================================
   PATCH FDML — Agenda Ultra v1.3
   Navigation, compteurs, mobile, lisibilité.
   ================================================================ */

.agenda-house-field {
    position: relative;
}

.agenda-field-label {
    position: absolute;
    top: -8px;
    left: 14px;
    z-index: 2;
    padding: 0 6px;
    background: #ffffff;
    color: #662d91;
    font-size: 0.70rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.agenda-house-select {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    padding-left: 15px !important;
    padding-right: 42px !important;
    border: 2px solid rgba(102, 45, 145, 0.26) !important;
    background-color: #ffffff !important;
    color: #2a2a2a !important;
    font-weight: 750;
    cursor: pointer;
}

.agenda-house-select:hover,
.agenda-house-select:focus {
    border-color: #662d91 !important;
    box-shadow: 0 0 0 3px rgba(102, 45, 145, 0.10);
    outline: none;
}

.agenda-list-heading strong {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(102, 45, 145, 0.08);
    color: #662d91;
    font-size: 0.9rem;
}

.agenda-detail-title {
    font-size: clamp(2rem, 3vw, 3.75rem) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.035em !important;
    overflow-wrap: anywhere;
}

.agenda-meta-card {
    min-height: 62px;
    padding: 14px 16px;
    gap: 12px;
}

.agenda-meta-card > span:first-child {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(102, 45, 145, 0.10);
    font-size: 1.15rem;
}

.agenda-detail.is-large-public .agenda-meta-card > span:first-child {
    background: rgba(208, 13, 80, 0.10);
}

.agenda-meta-card strong {
    font-size: 0.95rem;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .agenda-topbar {
        align-items: flex-start;
    }

    .agenda-searchbar {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .agenda-tabs {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        gap: 8px;
    }

    .agenda-tab {
        width: 100%;
        min-width: 0;
        padding: 0 8px !important;
        font-size: 0.82rem;
        line-height: 1.15;
        white-space: normal;
        text-align: center;
    }

    .agenda-tab span {
        flex: 0 0 auto;
    }

    .agenda-layout {
        display: block;
    }

    .agenda-list-panel {
        margin-bottom: 14px;
    }

    .agenda-mobile-activity-select,
    #mobilevalide2 {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .agenda-app {
        padding-left: 10px;
        padding-right: 10px;
    }

    .agenda-topbar {
        gap: 12px;
    }

    .agenda-topbar h1 {
        font-size: clamp(2.15rem, 13vw, 3.25rem);
    }

    .agenda-topbar p {
        max-width: 220px;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .agenda-mobile-filter-button {
        min-height: 42px;
        padding: 0 14px;
        font-size: 0.85rem;
    }

    .agenda-tabs {
        gap: 6px;
    }

    .agenda-tab {
        min-height: 52px;
        border-radius: 14px;
        font-size: 0.78rem;
    }

    .agenda-tab span {
        min-width: 22px;
        height: 22px;
        font-size: 0.70rem;
    }

    #u46517,
    #u465178 {
        max-height: 390px;
    }

    .agenda-list-panel,
    .agenda-detail-panel {
        padding: 12px;
        border-radius: 16px;
    }

    .agenda-detail-title {
        font-size: clamp(1.8rem, 10vw, 2.7rem) !important;
    }

    .agenda-meta-grid {
        grid-template-columns: 1fr !important;
    }

    .agenda-meta-card {
        min-height: 56px;
    }
}


/* ================================================================
   PATCH FDML — Agenda Ultra v1.3.3
   Nouvel état vide + aucun résultat + reset de sélection.
   ================================================================ */

.agenda-placeholder {
    padding: clamp(26px, 4vw, 56px);
}

.agenda-empty-state {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: clamp(24px, 4vw, 54px);
    align-items: center;
    width: min(100%, 760px);
    margin: 0 auto;
    text-align: left;
}

.agenda-empty-illustration {
    display: flex;
    width: 150px;
    height: 150px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 34px;
    background:
        linear-gradient(145deg, #662d91, #d00d50);
    color: #ffffff;
    box-shadow: 0 22px 48px rgba(102, 45, 145, 0.24);
    transform: rotate(-3deg);
}

.agenda-empty-date {
    font-size: 3.8rem;
    font-weight: 950;
    line-height: 0.9;
}

.agenda-empty-month {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.agenda-empty-kicker {
    display: block;
    margin-bottom: 8px;
    color: #d00d50;
    font-size: 0.76rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.agenda-empty-copy h2 {
    min-height: 0;
    margin: 0 0 12px;
    color: #232323;
    font-size: clamp(2rem, 3.4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.agenda-empty-copy p {
    max-width: 560px;
    margin: 0;
    color: #616167;
    font-size: 1rem;
    line-height: 1.7;
}

.agenda-empty-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.agenda-empty-hints span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(102, 45, 145, 0.08);
    color: #554c5e;
    font-size: 0.8rem;
    font-weight: 800;
}

.agenda-no-results {
    padding: 28px 18px;
    border: 1px dashed rgba(208, 13, 80, 0.34);
    border-radius: 16px;
    background: linear-gradient(135deg, #fff9fb, #ffffff);
    text-align: center;
}

.agenda-no-results strong {
    display: block;
    margin-bottom: 5px;
    color: #d00d50;
    font-size: 1rem;
}

.agenda-no-results span {
    color: #6e6e74;
    font-size: 0.86rem;
}

@media (max-width: 640px) {
    .agenda-empty-state {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .agenda-empty-illustration {
        width: 112px;
        height: 112px;
        margin: 0 auto;
        border-radius: 26px;
    }

    .agenda-empty-date {
        font-size: 2.8rem;
    }

    .agenda-empty-hints {
        justify-content: center;
    }

    .agenda-empty-copy h2 {
        font-size: clamp(1.8rem, 10vw, 2.7rem);
    }
}


/* ================================================================
   FDML — Agenda mobile 1.4.3
   Recherche + Maison, listes 20 par 20, fiche mobile dédiée.
   ================================================================ */

.agenda-mobile-back,
.agenda-load-more,
.agenda-item-arrow {
    display: none;
}

.agenda-item.agenda-filter-hidden {
    display: none !important;
}

.agenda-detail-content > :last-child {
    margin-bottom: 0 !important;
}

.agenda-detail-content p:empty,
.agenda-detail-content div:empty {
    display: none !important;
}

@media (max-width: 900px) {
    .agenda-app {
        width: 100%;
        padding: 14px 10px 24px;
        overflow: hidden;
    }

    .agenda-topbar {
        display: block;
        margin-bottom: 14px;
    }

    .agenda-topbar h1 {
        margin: 0;
        font-size: clamp(2.25rem, 12vw, 3.4rem);
        line-height: 0.95;
    }

    .agenda-topbar p {
        max-width: 280px;
        margin-top: 6px;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    /* Plus de bouton Filtres ni Réinitialiser en mobile. */
    .agenda-mobile-filter-button,
    .agenda-reset-button {
        display: none !important;
    }

    /* Recherche et Maison visibles en permanence. */
    .agenda-searchbar,
    .agenda-searchbar.is-open {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 17px;
    }

    .agenda-search-field input,
    .agenda-house-select {
        width: 100%;
        min-height: 48px;
    }

    /* Les onglets desktop disparaissent. Les deux listes se suivent. */
    .agenda-tabs {
        display: none !important;
    }

    .agenda-list-view,
    .agenda-list-view.is-active {
        display: block !important;
    }

    .agenda-list-view[data-view="public"] {
        margin-top: 24px;
        padding-top: 18px;
        border-top: 2px solid rgba(208, 13, 80, 0.14);
    }

    .agenda-list-view[data-view="public"]::before {
        content: "Activités large public";
        display: block;
        margin: 0 0 12px;
        color: #d00d50;
        font-size: 0.82rem;
        font-weight: 900;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }

    /* La page défile normalement : aucun scroll imbriqué. */
    .agenda-layout {
        display: block;
    }

    .agenda-list-panel,
    .agenda-detail-panel {
        width: 100%;
        min-width: 0;
        border-radius: 18px;
        padding: 12px;
    }

    .agenda-list-panel,
    #u46517,
    #u465178 {
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }

    .agenda-detail-panel {
        display: none;
        min-height: 0;
        overflow: visible;
    }

    .agenda-app.mobile-detail-open .agenda-topbar,
    .agenda-app.mobile-detail-open .agenda-searchbar,
    .agenda-app.mobile-detail-open .agenda-tabs,
    .agenda-app.mobile-detail-open .agenda-list-panel {
        display: none !important;
    }

    .agenda-app.mobile-detail-open .agenda-detail-panel {
        display: block;
    }

    /* Tuiles mobiles. */
    .agenda-item {
        position: relative;
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr) 20px;
        gap: 11px;
        align-items: center;
        width: 100%;
        min-width: 0;
        padding: 10px;
        margin-bottom: 9px;
        border-radius: 15px;
    }

    .agenda-item-date {
        width: 60px;
        min-height: 60px;
        border-radius: 14px;
    }

    .agenda-item-date-day {
        font-size: 1.42rem;
    }

    .agenda-item-date-month {
        font-size: 0.63rem;
    }

    .agenda-item-content {
        min-width: 0;
        overflow: hidden;
    }

    .agenda-item-title {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.94rem;
        line-height: 1.25;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .agenda-item-house,
    .agenda-item-meta {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .agenda-item-house {
        font-size: 0.79rem;
    }

    .agenda-item-meta {
        font-size: 0.74rem;
    }

    .agenda-item-arrow {
        display: block;
        color: #d00d50;
        font-size: 1.65rem;
        line-height: 1;
        text-align: right;
    }

    /* Pagination 20 par 20. */
    .agenda-item.agenda-page-hidden {
        display: none !important;
    }

    .agenda-load-more:not([hidden]) {
        display: flex;
    }

    .agenda-load-more {
        width: 100%;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        margin: 12px 0 4px;
        padding: 10px 16px;
        border: 2px solid #662d91;
        border-radius: 14px;
        background: #ffffff;
        color: #662d91;
        font-size: 0.9rem;
        font-weight: 900;
        cursor: pointer;
    }

    #loadMorePublic {
        border-color: #d00d50;
        color: #d00d50;
    }

    /* Bouton retour, placé sous le menu burger du template. */
    .agenda-mobile-back {
        position: sticky;
        top: calc(env(safe-area-inset-top, 0px) + 86px);
        z-index: 40;
        width: auto;
        min-height: 44px;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        margin: 4px 0 14px;
        padding: 0 16px;
        border: 2px solid #662d91;
        border-radius: 999px;
        background: #ffffff;
        color: #662d91;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
        font-size: 0.9rem;
        font-weight: 900;
    }

    .agenda-app.mobile-detail-open .agenda-mobile-back {
        display: inline-flex;
    }

    .agenda-mobile-back span:first-child {
        color: #d00d50;
        font-size: 1.25rem;
        line-height: 1;
    }

    /* Fiche plein écran logique sur mobile. */
    .agenda-placeholder {
        display: none !important;
    }

    .agenda-detail,
    .agenda-detail.is-visible {
        min-height: 0;
    }

    .agenda-detail-visual {
        display: flex;
        min-height: 0;
        flex-direction: column;
        gap: 12px;
    }

    .agenda-image {
        order: 1;
        width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 11;
        border-radius: 17px;
    }

    .agenda-image img {
        width: 100%;
        height: 100%;
        min-height: 0;
        aspect-ratio: 16 / 11;
        object-fit: cover;
    }

    .agenda-image.image-contain img {
        object-fit: contain;
        padding: 8px;
    }

    .agenda-detail-summary {
        order: 2;
        min-height: 0;
        padding: 20px 16px;
        border-radius: 17px;
    }

    .agenda-detail-title {
        margin-bottom: 18px;
        font-size: clamp(1.8rem, 9.5vw, 2.8rem) !important;
        line-height: 1.02 !important;
    }

    .agenda-meta-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    .agenda-meta-card {
        min-height: 54px;
        padding: 10px 12px;
    }

    .agenda-detail-content {
        padding: 20px 4px 0;
        font-size: 1rem;
        line-height: 1.7;
    }

    .agenda-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 18px;
    }

    .agenda-primary-action,
    .agenda-secondary-action {
        width: 100%;
        min-height: 48px;
    }

    .agenda-loading {
        position: fixed;
        top: 72px;
        left: 50%;
        z-index: 3000;
        width: auto;
        min-width: 170px;
        transform: translateX(-50%);
    }

    .agenda-detail-content,
    .agenda-detail-extras,
    .agenda-detail-content * {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .agenda-detail-content img,
    .agenda-detail-content iframe {
        max-width: 100% !important;
        height: auto !important;
    }

    .agenda-detail-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (min-width: 901px) {
    .agenda-item.agenda-page-hidden {
        display: grid !important;
    }

    .agenda-load-more {
        display: none !important;
    }
}


/* ================================================================
   FDML — Agenda Ultra 1.5.0
   Correctifs mobiles consolidés
   ================================================================ */

/* Empêche le glissement horizontal sur iPhone */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

#wrapper,
#main,
.inner,
.agenda-inner,
#banner,
.agenda-app,
.agenda-layout,
.agenda-list-panel,
.agenda-detail-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Survol uniquement avec une vraie souris */
@media (hover: hover) and (pointer: fine) {
    .agenda-item:hover,
    .agenda-item:focus-visible {
        transform: translateY(-2px);
        border-color: rgba(208, 13, 80, 0.35);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 900px) {

    /* En-tête mobile plus compact */
    .agenda-eyebrow {
        display: none !important;
    }

    #banner.agenda {
        padding-top: 2px !important;
    }

    .agenda-app {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-top: 10px !important;
        overflow-x: hidden !important;
    }

    .agenda-topbar {
        margin-top: 0 !important;
        margin-bottom: 10px !important;
        padding-top: 0 !important;
    }

    .agenda-topbar h1 {
        margin-top: 0 !important;
        margin-bottom: 4px !important;
    }

    .agenda-topbar p {
        margin-top: 2px !important;
    }

    /* Boutons inutiles sur mobile */
    .agenda-mobile-filter-button,
    .agenda-reset-button,
    .agenda-tabs {
        display: none !important;
    }

    /* Recherche et Maison toujours visibles */
    .agenda-searchbar,
    .agenda-searchbar.is-open {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    /* Large public masqué sur smartphone */
    .agenda-list-view[data-view="public"],
    #loadMorePublic {
        display: none !important;
    }

    /* Pas de scroll imbriqué */
    .agenda-list-panel,
    #u46517,
    #u465178 {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Largeurs sûres */
    .agenda-searchbar,
    .agenda-list-panel,
    .agenda-detail-panel,
    .agenda-item,
    .agenda-detail-visual,
    .agenda-detail-summary,
    .agenda-detail-content,
    .agenda-detail-extras {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .agenda-item-content,
    .agenda-detail-summary,
    .agenda-meta-card {
        min-width: 0;
    }

    .agenda-item-title,
    .agenda-item-house,
    .agenda-item-meta,
    .agenda-detail-title,
    .agenda-detail-content {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Aucun effet de survol/focus persistant au toucher */
    .agenda-item,
    .agenda-item:hover,
    .agenda-item:focus,
    .agenda-item:active {
        transform: none !important;
        box-shadow: none !important;
        -webkit-tap-highlight-color: transparent;
    }

    .agenda-item.agenda-active,
    .agenda-item.agenda-active:hover,
    .agenda-item.agenda-active:focus,
    .agenda-item.agenda-active:active {
        transform: none !important;
        border-color: #d00d50 !important;
        background: #fff8fb !important;
        box-shadow: none !important;
    }

    /* Bouton Voir plus visible */
    .agenda-load-more,
    #loadMoreRegular {
        display: flex;
        width: 100%;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        margin: 14px 0 6px;
        padding: 10px 16px;
        border: 2px solid #662d91 !important;
        border-radius: 14px;
        background-color: #662d91 !important;
        color: #ffffff !important;
        font-size: 0.9rem;
        font-weight: 900;
        line-height: 1.2;
        text-align: center;
        text-decoration: none !important;
        box-shadow: 0 8px 20px rgba(102, 45, 145, 0.18);
        cursor: pointer;
    }

    .agenda-load-more:hover,
    .agenda-load-more:focus,
    #loadMoreRegular:hover,
    #loadMoreRegular:focus {
        border-color: #662d91 !important;
        background-color: #ffffff !important;
        color: #662d91 !important;
    }

    .agenda-load-more[hidden],
    #loadMoreRegular[hidden],
    #loadMorePublic[hidden] {
        display: none !important;
    }

    /* Retour visible, dans le flux et non sur l'image */
    .agenda-mobile-back {
        position: relative !important;
        top: auto !important;
        z-index: 10;
        display: none;
        width: 100%;
        min-height: 46px;
        align-items: center;
        justify-content: flex-start;
        gap: 9px;
        margin: 0 0 14px;
        padding: 0 16px;
        border: 2px solid #662d91 !important;
        border-radius: 14px;
        background-color: #662d91 !important;
        color: #ffffff !important;
        box-shadow: 0 8px 20px rgba(102, 45, 145, 0.18);
        font-size: 0.9rem;
        font-weight: 900;
        line-height: 1.2;
        text-decoration: none !important;
    }

    .agenda-app.mobile-detail-open .agenda-mobile-back {
        display: inline-flex !important;
    }

    .agenda-mobile-back span,
    .agenda-mobile-back span:first-child {
        color: #ffffff !important;
    }

    .agenda-mobile-back span:first-child {
        font-size: 1.3rem;
        line-height: 1;
    }

    .agenda-mobile-back:hover,
    .agenda-mobile-back:focus {
        background-color: #ffffff !important;
        color: #662d91 !important;
    }

    .agenda-mobile-back:hover span,
    .agenda-mobile-back:focus span {
        color: #662d91 !important;
    }

    .agenda-detail-panel {
        padding-top: 12px !important;
    }

    .agenda-detail {
        clear: both;
    }

    .agenda-detail-visual {
        margin-top: 0 !important;
    }

    /* Contenus BDD responsives */
    .agenda-detail-content img,
    .agenda-detail-content iframe,
    .agenda-detail-content video,
    .agenda-detail-content table {
        max-width: 100% !important;
    }

    .agenda-detail-content iframe,
    .agenda-detail-content video {
        width: 100% !important;
        height: auto;
    }

    .agenda-detail-content table {
        display: block;
        overflow-x: auto;
    }

    .agenda-detail-content > :last-child {
        margin-bottom: 0 !important;
    }

    .agenda-detail-content p:empty,
    .agenda-detail-content div:empty {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .agenda-app {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}
/* ================================================================
   DESKTOP — Largeur maîtrisée
   ================================================================ */

@media (min-width: 901px) {

    /*
     * Le header peut rester sur toute la largeur,
     * mais le contenu de l’agenda est recentré.
     */
    .agenda-app {
        width: calc(100% - 64px) !important;
        max-width: 1500px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /*
     * Colonne liste plus raisonnable.
     */
    .agenda-layout {
        grid-template-columns:
            minmax(330px, 390px)
            minmax(0, 1fr) !important;

        gap: 24px !important;
    }

    /*
     * Évite une fiche gigantesque sur les très grands écrans.
     */
    .agenda-detail-panel {
        min-width: 0;
    }

    .agenda-detail-content {
        max-width: 1000px;
    }
}

@media (min-width: 1600px) {

    .agenda-app {
        max-width: 1450px !important;
    }
}

/* ================================================================
   MOBILE — Aucune mise en avant rouge de la tuile
   ================================================================ */

@media (max-width: 900px) {

    .agenda-item.agenda-active,
    .agenda-item.agenda-active:hover,
    .agenda-item.agenda-active:focus,
    .agenda-item.agenda-active:active {
        border-color: #ededf0 !important;
        background-color: #ffffff !important;
        box-shadow: none !important;
        transform: none !important;
    }

    .agenda-item:active {
        border-color: #ededf0 !important;
        background-color: #ffffff !important;
        box-shadow: none !important;
        transform: none !important;
    }
}
@media (max-width: 900px) {
    html,
    body {
        scroll-behavior: auto !important;
    }
}

/* ================================================================
   SMARTPHONE — Bouton retour en haut
   ================================================================ */

.agenda-scroll-top {
    display: none;
}

@media (max-width: 900px) {

    .agenda-scroll-top {
        position: fixed;
        right: 16px;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        z-index: 2500;

        display: inline-flex;
        min-width: 48px;
        height: 48px;
        align-items: center;
        justify-content: center;
        gap: 6px;

        padding: 0 14px;

        border: 2px solid #662d91 !important;
        border-radius: 999px;

        background: #662d91 !important;
        color: #ffffff !important;

        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);

        font-size: 0.85rem;
        font-weight: 900;
        line-height: 1;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(12px);
        transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0.18s ease;
    }

    .agenda-scroll-top.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .agenda-scroll-top > span:first-child {
        color: #ffffff !important;
        font-size: 1.3rem;
        line-height: 1;
    }

    .agenda-scroll-top-label {
        color: #ffffff !important;
    }

    .agenda-scroll-top:hover,
    .agenda-scroll-top:focus {
        border-color: #662d91 !important;
        background: #ffffff !important;
        color: #662d91 !important;
    }

    .agenda-scroll-top:hover span,
    .agenda-scroll-top:focus span {
        color: #662d91 !important;
    }
}

@media (max-width: 420px) {

    /* Sur les petits écrans, bouton plus compact */
    .agenda-scroll-top {
        width: 48px;
        min-width: 48px;
        padding: 0;
    }

    .agenda-scroll-top-label {
        display: none;
    }
}

@media (max-width: 900px) {

    .agenda-scroll-top {
        position: fixed !important;
        right: 14px !important;
        bottom: calc(
            18px + env(safe-area-inset-bottom, 0px)
        ) !important;
        z-index: 9999 !important;

        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        -webkit-appearance: none;
        appearance: none;
    }

    .agenda-scroll-top.is-visible {
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 900px) {

    /*
     * Zone tactile de sécurité autour du bouton.
     * Elle bloque les clics sur les cartes situées dessous.
     */
    .agenda-scroll-top {
        position: fixed !important;
        right: 10px !important;
        bottom: calc(
            12px + env(safe-area-inset-bottom, 0px)
        ) !important;

        z-index: 10000 !important;

        width: 64px !important;
        min-width: 64px !important;
        height: 64px !important;
        padding: 8px !important;

        border: 0 !important;
        border-radius: 50% !important;

        /*
         * Fond transparent de la zone complète.
         */
        background: transparent !important;
        box-shadow: none !important;

        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        pointer-events: none;
    }

    /*
     * Le bouton visible est dessiné dans un pseudo-élément.
     */
    .agenda-scroll-top::before {
        content: "↑";

        position: absolute;
        top: 8px;
        left: 8px;

        display: flex;
        width: 48px;
        height: 48px;

        align-items: center;
        justify-content: center;

        border: 2px solid #662d91;
        border-radius: 50%;

        background: #662d91;
        color: #ffffff;

        box-shadow:
            0 10px 26px
            rgba(0, 0, 0, 0.22);

        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1;

        pointer-events: none;
    }

    /*
     * La zone entière devient cliquable uniquement
     * quand le bouton est visible.
     */
    .agenda-scroll-top.is-visible {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /*
     * On masque le contenu HTML existant,
     * car la flèche est affichée via ::before.
     */
    .agenda-scroll-top > span {
        display: none !important;
    }
}

/* ================================================================
   MOBILE — Zone tactile sécurisée autour de la flèche
   ================================================================ */

@media (max-width: 900px) {

    .agenda-scroll-top {
        position: fixed !important;
        right: 8px !important;
        bottom: calc(
            10px + env(safe-area-inset-bottom, 0px)
        ) !important;

        z-index: 10000 !important;

        width: 72px !important;
        min-width: 72px !important;
        height: 72px !important;
        padding: 12px !important;

        border: 0 !important;
        border-radius: 50% !important;

        background: transparent !important;
        box-shadow: none !important;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /*
     * Flèche visible au centre de la grande zone tactile.
     */
    .agenda-scroll-top::before {
        content: "↑";

        position: absolute;
        top: 12px;
        left: 12px;

        display: flex;
        width: 48px;
        height: 48px;

        align-items: center;
        justify-content: center;

        border: 2px solid #662d91;
        border-radius: 50%;

        background: #662d91;
        color: #ffffff;

        box-shadow:
            0 10px 26px
            rgba(0, 0, 0, 0.22);

        font-size: 1.35rem;
        font-weight: 900;
        line-height: 1;

        pointer-events: none;
    }

    .agenda-scroll-top.is-visible {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /*
     * Le texte HTML n’est plus nécessaire :
     * la flèche est dessinée avec ::before.
     */
    .agenda-scroll-top > span {
        display: none !important;
    }
}

/* Newsletter : mêmes dimensions responsive que les autres icônes */
.newsletter-menu-icon {
    display: block;
    width: 90px;
    height: 90px;
}

/* Tablettes */
@media screen and (max-width: 980px) and (min-width: 737px) {
    .icons .navbar-brand,
    .icons .navbar-brand > img,
    .icons .newsletter-menu-icon {
        width: 55px !important;
        height: 55px !important;
    }
}

/* Smartphones */
@media screen and (max-width: 736px) {
    .icons .navbar-brand,
    .icons .navbar-brand > img,
    .icons .newsletter-menu-icon {
        width: 45px !important;
        height: 45px !important;
    }
}

/* ================================================================
   DESKTOP — En-tête Agenda plus compact
   ================================================================ */

@media screen and (min-width: 901px) {

    /* Retire le petit label FDML rouge */
    .agenda-eyebrow {
        display: none !important;
    }

    /* Remonte légèrement tout le bloc Agenda */
    .agenda-app {
        padding-top: 18px !important;
    }

    .agenda-topbar {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
        padding-top: 0 !important;
    }

    .agenda-topbar h1 {
        margin-top: 0 !important;
        margin-bottom: 4px !important;
    }

    .agenda-topbar p {
        margin-top: 4px !important;
    }
}