html,
body {
    margin: 0;
    padding: 0;
    background: #f5f6f7;
}

body.campus-sante-fullscreen {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cs-app {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f5f6f7;
}

/* Tous les textes superposés à l'image */

.cs-event-visual,
.cs-event-visual .cs-event-date,
.cs-event-visual .cs-event-day,
.cs-event-visual .cs-event-time,
.cs-event-visual .cs-event-bottom,
.cs-event-visual .cs-event-title {
    color: #ffffff !important;
}

.cs-event-visual:not(.has-image) .cs-event-overlay {
    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.10) 0%,
            rgba(0, 0, 0, 0.05) 45%,
            rgba(0, 0, 0, 0.30) 100%
        );
}

/* HEADER */

.cs-header {
    background: linear-gradient(
        135deg,
        #0f7f5d,
        #1b946d
    );

    color: white;

    padding:
        calc(18px + env(safe-area-inset-top))
        18px
        16px;

    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.cs-header-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

/* NAVIGATION PRINCIPALE */

.cs-navigation {
    display: flex;
    align-items: stretch;

    background: white;

    border-bottom: 1px solid #d7d7d7;

    overflow-x: auto;

    scrollbar-width: none;
}

.cs-navigation::-webkit-scrollbar {
    display: none;
}

.cs-navigation a {
    flex: 1;

    min-width: max-content;

    padding: 16px 10px 12px;

    text-decoration: none;

    text-align: center;

    color: #181818;

    font-size: 12px;
    font-weight: 500;

    position: relative;
}

.cs-navigation a.active {
    color: #148261;
}

.cs-navigation a.active::after {
    content: "";

    position: absolute;

    left: 22%;
    right: 22%;
    bottom: 0;

    height: 2px;

    border-radius: 2px;

    background: #148261;
}

/* CONTENU */

.cs-content {
    padding: 12px 14px 24px;
}

.cs-section-title {
    margin: 8px 0 10px;

    font-size: 16px;
    font-weight: 700;

    color: #1d1d1f;
}

/* FILTRES */

.cs-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0 0 12px;
    padding-bottom: 2px;
}

.cs-filters::-webkit-scrollbar {
    display: none;
}

.cs-filters button {
    border: 1px solid #17845f;
    border-radius: 18px;
    background: white;
    color: #222;
    padding: 6px 12px;
    white-space: nowrap;
    font-size: 12px;
}

.cs-filters button.active {
    background: #17845f;
    color: white;
}

/* LISTE EVENEMENTS */

.cs-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* CARTE EVENEMENT */

.cs-event-card {
    position: relative;
    overflow: hidden;
    height: 155px;
    margin: 0;
    border-radius: 14px;
    background: #ddd;
    box-shadow: none;
}

.cs-event-visual {
    position: relative;

    width: 100%;
    height: 100%;

    padding: 10px 11px;

    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background-size: cover;
    background-position: center;

    color: white;
}

/* Filtre sombre sur toute l'image */

.cs-event-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.42) 0%,
            rgba(0, 0, 0, 0.15) 42%,
            rgba(0, 0, 0, 0.78) 100%
        );

    z-index: 1;
}

/* Événement : vert foncé */
.cs-event-category-evenement {
    background: #17845f !important;
}

/* Conférence : turquoise */
.cs-event-category-conference {
    background: #20b99a !important;
}

/* Workshop : bleu */
.cs-event-category-workshop {
    background: #4774e8 !important;
}

/* CONTENU */

.cs-event-section {
    margin-bottom: 22px;
}

.cs-event-section .cs-section-title {
    margin: 8px 0 10px;

    font-size: 17px;
    font-weight: 700;

    color: #1d1d1f;
}

.cs-event-top,
.cs-event-bottom {
    position: relative;
    z-index: 2;
}

.cs-event-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-top: 0;
}

/* DATE / HEURE */

.cs-event-date {
    display: flex;
    flex-direction: column;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.9);
}

.cs-event-day,
.cs-event-time {
    color: #ffffff !important;
}

.cs-event-day {
    white-space: nowrap;
}

.cs-event-time {
    margin-top: 2px;
    white-space: nowrap;
}

/* BADGES EN HAUT A DROITE */

.cs-event-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    max-width: 72%;
    margin-left: auto;
    flex-wrap: nowrap;
}

.cs-event-location,
.cs-event-category {
    position: static;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    box-sizing: border-box;
    padding: 4px 8px;
    border-radius: 11px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* Lieu */

.cs-event-location {
    background: rgba(255, 255, 255, 0.95);
    color: #17845f !important;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Catégorie */

.cs-event-category {
    background: #17845f;
    color: #ffffff !important;
    flex-shrink: 0;
}

/* TITRE */

.cs-event-bottom {
    margin-top: auto;
    padding-bottom: 4px;
}

.cs-event-title {
    margin: 0;
    max-width: 96%;
    color: #ffffff !important;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.08;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.95);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}


/* SERVICES */

.cs-services {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-service-card {
    display: flex;
    gap: 12px;
    padding: 14px;

    background: white;

    border-radius: 14px;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.06);
}

.cs-service-icon {
    flex: 0 0 48px;

    width: 48px;
    height: 48px;

    border-radius: 12px;

    overflow: hidden;

    background: #eef1ef;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cs-service-content {
    flex: 1;
    min-width: 0;
}

.cs-service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cs-service-header h3 {
    margin: 0;

    font-size: 16px;
    font-weight: 700;

    color: #1d1d1f;
}

.cs-service-status {
    flex-shrink: 0;
    padding: 5px 9px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.cs-service-status.ouvert {
    background: #dff4e9;
    color: #147b53;
}

.cs-service-status.ferme {
    background: #f3e2e2;
    color: #a23a3a;
}

.cs-service-meta {
    margin-top: 3px;

    font-size: 12px;

    color: #6b6b6b;
}

.cs-service-description {
    margin-top: 8px;

    font-size: 13px;
    line-height: 1.35;

    color: #353535;
}

.cs-service-description p {
    margin: 0;
}


.cs-associations {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-association-card {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 14px;

    background: #ffffff;
    border-radius: 14px;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.06);

    text-decoration: none;
    color: inherit;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

/* Effet pour Mac / desktop */
@media (hover: hover) {

    .cs-association-card:hover {
        transform: translateY(-1px);

        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.10);
    }
}

/* Effet tactile */
.cs-association-card:active {
    transform: scale(0.985);
}


/* LOGO */

.cs-association-logo {
    flex: 0 0 60px;

    width: 60px;
    height: 60px;

    border-radius: 14px;

    overflow: hidden;

    background: #f1f3f2;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-association-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* CONTENU */

.cs-association-content {
    flex: 1;
    min-width: 0;
}

.cs-association-content h3 {
    margin: 0 0 5px;

    font-size: 16px;
    font-weight: 700;

    color: #1d1d1f;
}

.cs-association-description {
    font-size: 13px;
    line-height: 1.35;

    color: #5f6368;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
}

.cs-association-description p {
    margin: 0;
}


/* CHEVRON */

.cs-association-chevron {
    flex: 0 0 auto;

    padding-left: 4px;

    font-size: 28px;
    font-weight: 300;
    line-height: 1;

    color: #a0a0a0;
}


.cs-map-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 2px;

    scrollbar-width: none;
}

.cs-map-tabs::-webkit-scrollbar {
    display: none;
}

.cs-map-tab {
    flex: 0 0 auto;

    border: 1px solid #17845f;
    border-radius: 18px;

    background: white;
    color: #1d1d1f;

    padding: 6px 12px;

    font-size: 12px;
    font-weight: 600;
}

.cs-map-tab.active {
    background: #17845f;
    color: white;
}

.cs-map-container {
    width: 100%;
}

.cs-map-panel {
    display: none;
}

.cs-map-panel.active {
    display: block;
}

.cs-map-viewer {
    position: relative;

    width: 100%;
    height: 65vh;
    min-height: 420px;

    overflow: hidden;

    background: white;
    border-radius: 14px;

    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.06);

    touch-action: none;
    user-select: none;
}

.cs-map-transform {
    position: absolute;
    inset: 0;

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

    transform-origin: center center;

}

.cs-map-transform img {
    display: block;

    width: 100%;
    height: auto;

    max-width: none;
    max-height: none;

    pointer-events: none;
    user-select: none;
}

/* Boutons zoom */

.cs-map-controls {
    position: absolute;

    right: 12px;
    bottom: 12px;

    z-index: 10;

    display: flex;
    align-items: center;

    background: rgba(255, 255, 255, 0.94);

    border-radius: 22px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15);

    overflow: hidden;
}

.cs-map-controls button {
    height: 40px;

    border: 0;
    background: transparent;

    color: #17845f;

    font-size: 18px;
    font-weight: 600;

    padding: 0 14px;
}

.cs-map-reset {
    min-width: 64px;

    border-left: 1px solid #eee !important;
    border-right: 1px solid #eee !important;

    font-size: 12px !important;
}

.cs-map-empty {
    padding: 30px;

    text-align: center;

    background: white;

    border-radius: 14px;

    color: #777;
}

/* ============================================================
   BOTTOM SHEET SERVICES
   ============================================================ */

.cs-service-sheets {
    position: relative;
    z-index: 100;
}

.cs-service-sheet {
    position: fixed;

    left: 50%;
    bottom: 0;

    width: min(520px, 100%);
    max-height: 82vh;

    transform:
        translateX(-50%)
        translateY(105%);

    background: white;

    border-top-left-radius: 22px;
    border-top-right-radius: 22px;

    box-shadow:
        0 -8px 30px rgba(0, 0, 0, 0.18);

    padding:
        10px
        18px
        calc(24px + env(safe-area-inset-bottom));

    box-sizing: border-box;

    overflow-y: auto;

    transition:
        transform 0.28s ease;

    z-index: 102;
}

.cs-service-sheet.active {
    transform:
        translateX(-50%)
        translateY(0);
}

.cs-service-sheet-handle {
    width: 42px;
    height: 5px;

    margin: 0 auto 14px;

    border-radius: 999px;

    background: #d0d0d0;
}

.cs-service-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;
}

.cs-service-sheet-header h2 {
    margin: 0;

    font-size: 22px;
    line-height: 1.1;

    color: #1d1d1f;
}

.cs-service-sheet-status {
    margin-top: 5px;

    font-size: 13px;
    font-weight: 600;

    color: #17845f;
}

.cs-service-sheet-close {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    background: #f0f1f1;
    color: #444;

    font-size: 24px;
    line-height: 1;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-service-sheet-location {
    margin-top: 16px;

    font-size: 13px;
    font-weight: 600;

    color: #5f6368;
}

.cs-service-sheet-description {
    margin-top: 14px;

    font-size: 14px;
    line-height: 1.45;

    color: #333;
}

.cs-service-sheet-description p {
    margin-top: 0;
}

.cs-service-sheet-hours {
    margin-top: 22px;
}

.cs-service-sheet-hours h3 {
    margin: 0 0 10px;

    font-size: 16px;
    font-weight: 700;

    color: #1d1d1f;
}

.cs-service-hour-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-height: 34px;

    border-bottom: 1px solid #eeeeee;

    font-size: 13px;
}

.cs-service-hour-day {
    color: #444;
}

.cs-service-hour-value {
    font-weight: 600;
    color: #1d1d1f;

    white-space: nowrap;
}

.cs-service-sheet-actions {
    margin-top: 22px;
}

.cs-service-sheet-link {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;

    border-radius: 12px;

    background: #17845f;
    color: white !important;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;
}

/* Fond assombri */

.cs-service-sheet-backdrop {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.38);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 101;
}

.cs-service-sheet-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Indique que les cartes sont interactives */

.cs-service-card {
    cursor: pointer;
}

.cs-service-card:active {
    transform: scale(0.99);
}

/* ========================================
   HORAIRES SERVICES
   ======================================== */

.cs-service-hour-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 9px 10px;

    border-bottom: 1px solid #eeeeee;

    font-size: 13px;
}

.cs-service-hour-row:last-child {
    border-bottom: 0;
}

.cs-service-hour-day {
    font-weight: 500;
    color: #555;
}

.cs-service-hour-value {
    color: #555;
}

/* Jour actuel */

.cs-service-hour-row.today {
    margin: 2px 0;

    background: #e8f5ef;

    border-radius: 9px;
    border-bottom-color: transparent;
}

.cs-service-hour-row.today .cs-service-hour-day {
    color: #148261;
    font-weight: 700;
}

.cs-service-hour-row.today .cs-service-hour-value {
    color: #148261;
    font-weight: 600;
}

/* ========================================
   FICHE DETAIL SERVICE
   ======================================== */

.cs-service-sheet {
    position: fixed;

    left: 50%;
    bottom: 0;

    width: 100%;
    max-width: 520px;
    max-height: 82vh;

    box-sizing: border-box;

    padding:
        10px
        18px
        calc(22px + env(safe-area-inset-bottom));

    background: #ffffff;

    border-radius: 22px 22px 0 0;

    box-shadow:
        0 -6px 30px rgba(0, 0, 0, 0.16);

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    z-index: 1001;

    transform: translate(-50%, 105%);
    transition: transform 0.28s ease;
}

.cs-service-sheet.active {
    transform: translate(-50%, 0);
}


/* Poignée */

.cs-service-sheet-handle {
    width: 38px;
    height: 5px;

    margin: 0 auto 14px;

    border-radius: 3px;

    background: #d1d1d6;
}


/* En-tête */

.cs-service-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 8px;
}

.cs-service-sheet-header h2 {
    margin: 0 0 7px;

    font-size: 22px;
    line-height: 1.15;
    font-weight: 750;

    color: #1d1d1f;
}


/* Statut */

.cs-service-sheet-status {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 3px 9px;

    border-radius: 12px;

    background: #eef7f3;

    color: #148261;

    font-size: 11px;
    font-weight: 700;
}


/* Bouton fermer */

.cs-service-sheet-close {
    flex: 0 0 32px;

    width: 32px;
    height: 32px;

    padding: 0;

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

    border: 0;
    border-radius: 50%;

    background: #f0f0f2;

    color: #666;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}


/* Lieu */

.cs-service-sheet-location {
    margin: 10px 0 14px;

    color: #6b6b6b;

    font-size: 13px;
    font-weight: 500;
}


/* Description */

.cs-service-sheet-description {
    margin: 14px 0 18px;

    color: #353535;

    font-size: 14px;
    line-height: 1.45;
}

.cs-service-sheet-description p {
    margin: 0;
}


/* Titre horaires */

.cs-service-sheet-hours {
    margin-top: 16px;
}

.cs-service-sheet-hours h3 {
    margin: 0 0 8px;

    color: #1d1d1f;

    font-size: 15px;
    font-weight: 700;
}


/* Fond derrière la fiche */

.cs-service-sheet-backdrop {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0);

    visibility: hidden;

    z-index: 1000;

    transition:
        background 0.25s ease,
        visibility 0.25s ease;
}

.cs-service-sheet-backdrop.active {
    visibility: visible;

    background: rgba(0, 0, 0, 0.34);
}

/* Fond par défaut si aucune image */

.cs-event-bg-default {
    background-color: #5f6f69;
}

/* Événement */

.cs-event-bg-evenement {
    background-color: #17845f;
}

/* Conférence */

.cs-event-bg-conference {
    background-color: #20b99a;
}

/* Workshop */

.cs-event-bg-workshop {
    background-color: #4774e8;
}