.civic-ia-lab-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f6fb;
    border-radius: 12px;
    padding: 24px;
}

.civic-ia-lab-header {
    background: #90B393; /* rouge Civic IA approximatif */
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.civic-ia-logo {
    font-weight: 700;
    font-size: 18px;
}

.civic-ia-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.civic-ia-lab-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .civic-ia-lab-main {
        grid-template-columns: 1fr;
    }
}

.civic-ia-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.civic-ia-kpi-row {
    display: flex;
    gap: 16px;
}

.civic-ia-kpi-card {
    flex: 1;
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.kpi-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 60px;
    font-weight: 900;
    color: #90B393;
}

.kpi-top-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.kpi-top-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.kpi-top-list .badge {
    background: #90B393;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.civic-ia-summary-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.civic-ia-summary-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}

.civic-ia-summary-note {
    font-size: 11px;
    color: #777;
    margin-top: 8px;
}

.civic-ia-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .civic-ia-charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.chart-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

/* Panneau formulaire */

.civic-ia-form-panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.civic-ia-form-panel h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.field-group {
    margin-bottom: 12px;
}

.field-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.civic-ia-form-panel input[type="email"],
.civic-ia-form-panel select,
.civic-ia-form-panel textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d0d4e6;
    font-size: 13px;
}

.civic-ia-form-panel textarea {
    resize: vertical;
}

.scope-toggle {
    display: flex;
    gap: 8px;
}

.scope-toggle label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    border: 1px solid #d0d4e6;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
}

.scope-toggle input {
    margin: 0;
}

.civic-ia-submit {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: none;
    background: #90B393;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.civic-ia-submit:hover {
    opacity: 0.92;
}

.civic-ia-form-message {
    margin-top: 8px;
    font-size: 12px;
}

.civic-ia-form-message.success {
    color: #008060;
}

.civic-ia-form-message.error {
    color: #b00020;
}

.civic-ia-privacy-note {
    margin-top: 12px;
    font-size: 11px;
    color: #777;
}

/* Liste des idées */

.civic-ia-list-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.civic-ia-idea-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.civic-ia-idea-item {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    margin-bottom: 10px;
}

.idea-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.tag {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0f1f9;
    color: #000;
}

.tag-theme {
    background: #4b763c;
    color: #fff;
	font-size: 14px;
}

.idea-content p {
    margin: 0;
    font-size: 14px;
    color: #000;
}

.idea-date {
    margin-top: 6px;
    font-size: 14px;
    color: #888;
}

.civic-ia-load-more-wrapper {
    text-align: left;
    margin-top: 12px;
}

.civic-ia-load-more {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #90B393;
    color: #90B393;
    font-size: 13px;
    text-decoration: none;
}

.civic-ia-load-more:hover {
    background: #90B393;
    color: #ffffff;
}

.idea-author {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.civic-ia-form-message {
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.civic-ia-form-message.success {
    color: #006400;
}

.civic-ia-form-message.error {
    color: #b00020;
}

/* Harmoniser tous les inputs du formulaire Civic IA */
#civic-ia-idea-form input[type="text"],
#civic-ia-idea-form input[type="email"],
#civic-ia-idea-form select,
#civic-ia-idea-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

/* Espacement uniforme des champs */
#civic-ia-idea-form .field-group {
    margin-bottom: 18px;
}

/* Votes */

.civic-ia-votes {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.civic-ia-vote-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d0d4e6;
    background: #f7f8fd;
    cursor: pointer;
    font-size: 12px;
    color: #333;
}

.civic-ia-vote-button .vote-icon {
    font-size: 12px;
}

.civic-ia-vote-button .vote-count {
    font-weight: 600;
}

.civic-ia-vote-button.active {
    border-color: #90B393;
    background: #e4f2e8;
    color: #2f5b36;
}
/* Boutons de vote 4 niveaux (--, -, +, ++) */

.civic-ia-votes {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.civic-ia-vote-button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.civic-ia-vote-button img {
    display: block;
    width: 40px;
    height: 40px;
}

.civic-ia-vote-button.active img {
    outline: 2px solid #90B393;
    outline-offset: 2px;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.2));
}

/* Bloc compteur sous les boutons */

.civic-ia-vote-summary {
    margin-top: 4px;
}

/* Conteneur du compteur large */

.vote-gauge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e0e3f5;
    background: #f7f8fd;
}

.vote-gauge-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Demi-jauge type cadran, fond rouge → vert */

.vote-gauge-dial {
    position: relative;
    width: 80px;
    height: 40px;
    border-radius: 80px 80px 0 0;
    overflow: hidden;
    background: linear-gradient(90deg, #d9534f, #f0ad4e, #5cb85c);
}

/* Aiguille pilotée par le JS (rotation) */

.vote-gauge-needle {
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 2px;
    height: 46px;
    background: #222;
    transform-origin: bottom center;
    transform: rotate(0deg);
    transition: transform 0.3s ease-out;
}

/* Affichage du total de votes */

.vote-gauge-total {
    margin-left: auto;
    font-size: 12px;
    color: #555;
}

.vote-gauge-number {
    font-weight: 700;
    margin-right: 2px;
}
/* Cartouche des idées : bord arrondi noir + mise en page horizontale */

.civic-ia-idea-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border: 2px solid #000;
    border-radius: 20px;
    background: #fff;
}

/* Colonne "contenu" à gauche (tags, auteur, texte, date) */

.civic-ia-idea-item .idea-meta,
.civic-ia-idea-item .idea-author,
.civic-ia-idea-item .idea-content,
.civic-ia-idea-item .idea-date {
    flex: 1 1 auto;
}

/* Ordre visuel des blocs à l’intérieur de la cartouche */

.civic-ia-idea-item .idea-meta { order: 1; }
.civic-ia-idea-item .idea-author { order: 2; }
.civic-ia-idea-item .idea-content { order: 3; }
.civic-ia-idea-item .idea-date { order: 4; }
.civic-ia-idea-item .civic-ia-votes { order: 5; }
.civic-ia-idea-item .civic-ia-vote-summary { order: 6; }

/* Auteur et texte centrés, comme sur ta maquette */

.civic-ia-idea-item .idea-author {
    font-size: 11px;
    text-align: center;
    color: #666;
}

.civic-ia-idea-item .idea-content {
    text-align: center;
}

.civic-ia-idea-item .idea-content p {
    margin: 4px 0;
    font-weight: 500;
}

/* Date discretement sous le texte */

.civic-ia-idea-item .idea-date {
    font-size: 11px;
    text-align: center;
    color: #777;
}

/* Colonne de droite : boutons de vote + jauge verticalement */

.civic-ia-idea-item .civic-ia-votes,
.civic-ia-idea-item .civic-ia-vote-summary {
    flex: 0 0 auto;
}

.civic-ia-idea-item .civic-ia-vote-summary {
    margin-top: 4px;
}

/* Jauge calée sur le bord droit, avec texte "X vote(s)" en dessous */

.civic-ia-idea-item .vote-gauge {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
}

.civic-ia-idea-item .vote-gauge-label {
    font-size: 11px;
    font-weight: 500;
}

.civic-ia-idea-item .vote-gauge-dial {
    width: 90px;
    height: 45px;
}

.civic-ia-idea-item .vote-gauge-total {
    font-size: 13px;
    font-weight: 600;
}

/* Ajuste un peu l’aiguille pour qu’elle sorte bien du cadran */

.civic-ia-idea-item .vote-gauge-needle {
    height: 52px;
}

/* Texte "1 vote" / "X votes" collé sous la jauge */

.civic-ia-idea-item .vote-gauge-number {
    margin-right: 4px;
}}

.vote-gauge-needle {
    position: absolute;
    bottom: -20px;           /* on descend le pivot sous le cadran */
    left: 50%;
    width: 3px;
    height: 80px;            /* aiguille plus longue */
    background: #222;
    transform-origin: bottom center;
    transform: rotate(0deg);
    transition: transform 0.3s ease-out;
}

/* petit disque au centre, pour que le pivot reste toujours visible */
.vote-gauge-needle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #222;
    transform: translateX(-50%);
}
/* Jauge plus grande, l’aiguille peut dépasser du cadran */
.vote-gauge-dial {
    position: relative;
    width: 110px;         /* un peu plus large */
    height: 55px;         /* un peu plus haute */
    border-radius: 110px 110px 0 0;
    overflow: visible;    /* important : l’aiguille peut dépasser */
    background: linear-gradient(90deg, #d9534f, #f0ad4e, #5cb85c);
}

/* Légère marge pour la zone texte sous la jauge */

.vote-gauge-total {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}
.vote-gauge-svg {
    width: 100px;
    height: auto;
    display: block;
}

.vote-gauge-pointer {
    transform-origin: 100px 100px;
    transition: transform 0.25s ease-out;
}
/* Mobile (<= 768px) : on empile proprement et on simplifie la carte */

@media (max-width: 768px) {

    /* carte d’idée : on passe en colonne */
    .civic-ia-idea-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }

    /* tags : on évite les grosses pillules qui cassent la mise en page */
    .civic-ia-idea-item .idea-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    /* pseudo + date sur une ligne, compact */
    .civic-ia-idea-item .idea-author,
    .civic-ia-idea-item .idea-date {
        text-align: left;
        font-size: 12px;
        margin: 0;
    }

    /* texte : lisible, pas centré sur mobile */
    .civic-ia-idea-item .idea-content,
    .civic-ia-idea-item .idea-content p {
        text-align: left;
        margin: 0;
        line-height: 1.25;
    }

    /* bloc votes : on le met en bas, aligné à gauche */
    .civic-ia-idea-item .civic-ia-votes {
        justify-content: flex-start;
        gap: 10px;
        margin: 0;
    }

    .civic-ia-vote-button img {
        width: 34px;
        height: 34px;
    }

    /* jauge + compteur : sur une ligne */
    .civic-ia-idea-item .civic-ia-vote-summary {
        margin-top: 0;
    }

    .civic-ia-idea-item .vote-gauge {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .vote-gauge-svg {
        width: 90px; /* un peu plus petit */
    }

    .vote-gauge-label {
        display: none; /* "résultat actuel" est redondant sur mobile */
    }

    .vote-gauge-total {
        margin-top: 0;
        font-size: 13px;
        white-space: nowrap;
    }
}
