body.legacy-calendar .cour:not(.cour-shaped) {
    background-color: var(--ressource-color, #0099ff);
    color: var(--schedule-event-text-color, var(--font-ressource-color));
    border-radius: 18px;
    padding-left: 1rem;
    padding-right: 1rem;
    min-height: 1px;
    transition: all ease-in-out 0.3s;
    border: white 2px solid;
    cursor: pointer;
    overflow-y: auto;
}

/* Growth can give a course a narrow overlap lane; avoid Legacy's old 32px side padding. */
body.legacy-calendar .cour:not(.cour-shaped) {
    box-sizing: border-box;
    padding: 4px 6px;
}

body.legacy-calendar .cour:not(.cour-merged):hover {
    z-index: 1000 !important;
}

body.legacy-calendar .cour:not(.cour-shaped) div {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
}

body.legacy-calendar .cour:not(.cour-shaped) .name {
    font-weight: bold;
    font-size: 1em;
}

body.legacy-calendar .cour:not(.cour-shaped) .location {
    font-weight: bold;
    font-size: 0.8em;
}

body.legacy-calendar .cour:not(.cour-shaped) .prof,
body.legacy-calendar .cour:not(.cour-shaped) .time {
    color: var(--schedule-event-text-color, var(--less-important-text));
    font-style: italic;
    font-size: 0.8em;
    margin-top: 0.2rem;
}

body.legacy-calendar .cour:not(.cour-shaped).cour-merged {
    border: 2px solid #ffe082;
    box-shadow: 0 8px 18px rgba(255, 214, 10, 0.28), 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Growth changes each event's outline; keep Legacy's fill, border and typography. */
body.legacy-calendar .cour.cour-shaped .event-card-outline path {
    stroke: #fff;
    stroke-width: 2px;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    padding: 4px 8px;
    text-align: center;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.25rem;
    text-align: center;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy p {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    text-align: center;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy .name {
    font-size: 1em;
    font-weight: bold;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy .location {
    font-size: 0.8em;
    font-weight: bold;
}

body.legacy-calendar .cour.cour-shaped .event-card-copy .prof,
body.legacy-calendar .cour.cour-shaped .event-card-copy .time {
    margin-top: 0.2rem;
    color: var(--schedule-event-text-color, var(--less-important-text));
    font-size: 0.8em;
    font-style: italic;
}

body.legacy-calendar #edt-modal .backdrop {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.legacy-calendar #edt-modal .dialog {
    width: min(92vw, 640px);
    max-height: 86vh;
    overflow: auto;
    background-color: #0099ff;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

body.legacy-calendar #edt-modal .title {
    margin: 0 28px 8px 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    padding: 20px;
}

body.legacy-calendar #edt-modal .meta {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
    text-align: center;
}

body.legacy-calendar #edt-modal .close {
    right: 2px;
    top: 2px;
    border: none;
    background: transparent;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 32px;
}

body.legacy-calendar #edt-modal .salle-link {
    color: inherit;
    text-decoration: underline;
}

body.legacy-calendar #edt-modal .salle-link:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    body.legacy-calendar .cour:not(.cour-shaped):not(.cour-merged) {
        border-radius: 8px;
        overflow: hidden;
    }

    body.legacy-calendar .cour:not(.cour-shaped) .name {
        font-size: 0.5em;
    }

    body.legacy-calendar .cour:not(.cour-shaped) .prof,
    body.legacy-calendar .cour:not(.cour-shaped) .time,
    body.legacy-calendar .cour:not(.cour-shaped) .location {
        font-size: 0.5em;
    }
}

@media (max-width: 480px) {
    body.legacy-calendar #edt-modal .dialog {
        width: 96vw;
        padding: 14px;
    }

    body.legacy-calendar #edt-modal .title {
        font-size: 1rem;
    }
}
