.cro-search-widget {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 30px;
    background: #182848;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(20, 30, 70, 0.18);
    font-family: inherit;
}

.cro-search-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.cro-search-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.cro-search-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.cro-search-title {
    margin: 0 0 6px 0;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.25;
}

.cro-search-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.cro-search-fields {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.cro-search-fields input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #182848;
}

.cro-search-fields input[type="text"]::placeholder {
    color: #8a90a8;
}

.cro-search-fields input[type="text"]:focus {
    outline: none;
    background: #f4f6fb;
}

.cro-search-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.cro-search-btn:hover {
    filter: brightness(0.9);
}

.cro-search-results {
    margin-top: 20px;
}

.cro-loading,
.cro-no-result,
.cro-error {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px;
}

.cro-error {
    color: #ffb4ab;
}

/* Ancien affichage tableau (conservé pour compatibilité) */
.cro-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.cro-results-table th,
.cro-results-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e8f2;
}

.cro-results-table th {
    background: #f3f5fb;
    color: #182848;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.cro-results-table a {
    color: #182848;
    font-weight: 600;
    text-decoration: none;
}

.cro-results-table a:hover {
    text-decoration: underline;
}

.cro-results-table tbody tr:hover {
    background: #fafbff;
}

/* Page dédiée aux résultats */
.cro-results-page {
    width: 100%;
    margin: 0 auto;
}

.cro-results-search-form {
    margin-bottom: 24px;
}

.cro-search-fields-compact {
    max-width: 420px;
    background: #fff;
    border: 2px solid #182848;
}

.cro-results-page .cro-no-result {
    color: #4a5170;
    padding: 12px 0;
}

/* En-tête "SES RÉSULTATS (N COURSES)" */
.cro-results-header {
    margin-bottom: 18px;
}

.cro-results-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #182848;
    text-transform: uppercase;
}

.cro-results-title span {
    font-weight: 700;
}

/* Ligne d'en-têtes de colonnes (desktop uniquement) */
.cro-results-columns {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 8px 20px;
    color: #8a90a8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cro-col-thumb { flex: 0 0 110px; }
.cro-col-event { flex: 1 1 auto; }
.cro-col-epreuve { flex: 0 1 auto; text-align: center; padding: 0 10px; white-space: nowrap; }
.cro-col-temps { flex: 0 1 auto; text-align: center; padding: 0 10px; white-space: nowrap; }
.cro-col-rank { flex: 0 1 auto; text-align: center; padding: 0 10px; white-space: nowrap; }

/* Cartes de résultats */
.cro-results-list {
    display: flex;
    flex-direction: column;
    gap: var(--cro-row-gap, 12px);
}

/* Mode "vignettes" : grille de vraies cartes verticales */
.cro-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--cro-grid-min-width, 260px), 1fr));
    gap: var(--cro-row-gap, 12px);
    align-items: stretch;
}

.cro-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e8f2;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20, 30, 70, 0.08);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.cro-tile:hover {
    box-shadow: 0 8px 20px rgba(20, 30, 70, 0.14);
    transform: translateY(-2px);
}

.cro-tile-image {
    position: relative;
    width: 100%;
    height: 160px;
    background: #e5e8f2;
    flex: 0 0 auto;
}

.cro-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cro-tile-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cro-tile-date {
    position: absolute;
    left: 10px;
    top: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
    box-shadow: 0 1px 4px rgba(20, 30, 70, 0.25);
}

.cro-tile-date-day {
    font-weight: 800;
    color: #182848;
}

.cro-tile-date-month {
    font-weight: 700;
    color: #4a5170;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.cro-tile-date-year {
    color: #8a90a8;
}

.cro-tile-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 4px 11px;
    border-radius: 20px;
    background: #e8621c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(20, 30, 70, 0.25);
}

.cro-tile-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
}

.cro-tile-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 800;
    color: #182848;
    line-height: 1.3;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cro-tile-meta {
    margin: 0 0 14px 0;
    font-size: 13px;
    font-weight: 600;
    color: #4a5170;
    text-align: center;
}

.cro-tile-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border-top: 1px solid #eef0f6;
    border-bottom: 1px solid #eef0f6;
    padding: 12px 0;
}

.cro-tile-stat-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.cro-tile-stat-value--main {
    font-size: 20px;
}

.cro-tile-stat-sub {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 18px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #eef0f6;
}

.cro-tile-stat {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
}

.cro-tile-stat-sub .cro-tile-stat + .cro-tile-stat {
    border-left: 1px solid #eef0f6;
    padding-left: 18px;
}

.cro-tile-stat-value {
    font-weight: 800;
    font-size: 15px;
    color: #182848;
    white-space: nowrap;
}

.cro-tile-stat-label {
    font-size: 10px;
    font-weight: 700;
    color: #8a90a8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.cro-tile-cta {
    margin-top: auto;
    display: block;
    text-align: center;
    padding: 11px 16px;
    border-radius: 8px;
    background: #e8621c;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.cro-tile-cta:hover {
    filter: brightness(0.92);
    color: #fff;
}

.cro-result-card {
    display: flex;
    align-items: stretch;
    gap: 18px;
    background: #fff;
    border: 1px solid #e5e8f2;
    border-radius: 12px;
    padding: 16px 22px;
    box-shadow: 0 1px 4px rgba(20, 30, 70, 0.06);
    min-height: 112px;
}

/* La vignette s'étire pour occuper toute la hauteur de la rangée,
   quelle que soit la taille du contenu texte à côté. */
.cro-result-thumb {
    position: relative;
    flex: 0 0 110px;
    align-self: stretch;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e8f2;
}

.cro-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cro-result-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #182848;
}

.cro-result-date-badge {
    position: absolute;
    left: 6px;
    top: 6px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    padding: 3px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
    box-shadow: 0 1px 3px rgba(20, 30, 70, 0.25);
}

.cro-result-day {
    font-size: 15px;
    font-weight: 800;
    color: #182848;
}

.cro-result-month {
    font-size: 9px;
    font-weight: 700;
    color: #4a5170;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.cro-result-year {
    font-size: 9px;
    color: #8a90a8;
}

.cro-result-event {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
}

.cro-result-title {
    font-weight: 700;
    font-size: 15px;
    color: #182848;
    text-decoration: none;
    line-height: 1.3;
}

.cro-result-title:hover {
    text-decoration: underline;
}

.cro-result-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #e8621c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cro-result-epreuve {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5170;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    padding: 0 10px;
}

.cro-result-temps {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #182848;
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    padding: 0 10px;
}

.cro-result-rank {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
    padding: 0 10px;
}

.cro-result-rank-scratch {
    font-weight: 800;
    font-size: 15px;
    color: #182848;
}

.cro-result-rank-cat {
    font-size: 12px;
    color: #4a5170;
}

@media (max-width: 480px) {
    .cro-search-widget {
        padding: 22px 18px;
    }
    .cro-search-fields {
        border-radius: 10px;
    }
    .cro-search-fields input[type="text"] {
        min-width: 0;
    }
    .cro-search-btn {
        padding: 12px;
    }
    .cro-results-table {
        font-size: 12px;
    }
    .cro-results-table th,
    .cro-results-table td {
        padding: 8px 6px;
    }
    .cro-search-fields-compact {
        max-width: 100%;
    }
    .cro-results-columns {
        display: none;
    }
    .cro-result-card {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 12px 16px;
        min-height: 0;
    }
    .cro-result-thumb {
        flex: 0 0 72px;
        height: 72px;
        align-self: flex-start;
    }
    .cro-result-event {
        flex: 1 1 auto;
        order: 2;
    }
    .cro-result-epreuve,
    .cro-result-temps,
    .cro-result-rank {
        flex: 1 1 33%;
        order: 3;
    }
}
