/* ==========================================================================
   ESTIMATION DU PRIX (plugin car-price-estimator, vue estimator.blade.php)
   ========================================================================== */
.pe {
    --pe-brand: var(--primary-color, #98bc2a);
    --pe-brand-soft: rgba(var(--primary-color-rgb, 152, 188, 42), .12);
    --pe-brand-ink: #56730b; /* vert du site, plus foncé : lisible sur blanc */
    --pe-dark: #0f172a;
    --pe-text: #334155;
    --pe-muted: #64748b;
    --pe-line: #e2e8f0;
    --pe-soft: #f8fafc;
    --pe-radius: 14px;
    --pe-shadow: 0 4px 20px rgba(15, 23, 42, .06);
    color: var(--pe-text);
    padding: 24px 0 64px;
}

/* Le thème fixe couleur et taille sur tous les éléments (* { color; font-size }) : ici, tout hérite */
.pe * {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* « hidden » l'emporte toujours sur les display: flex/grid de la page (squelette, position du prix…) */
.pe [hidden] {
    display: none !important;
}

.pe__head {
    max-width: 720px;
    margin-bottom: 28px;
}

.pe__title {
    margin: 0 0 8px;
    color: var(--pe-dark);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.pe__lead {
    margin: 0;
    color: var(--pe-muted);
    font-size: 16px;
    line-height: 1.6;
}

.pe__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.pe-card {
    background: #fff;
    border: 1px solid var(--pe-line);
    border-radius: var(--pe-radius);
    box-shadow: var(--pe-shadow);
    padding: 24px;
}

/* ---------- Formulaire ---------- */
.pe-form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.pe-form__row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pe-field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
}

.pe-field__label span {
    color: #dc2626;
}

.pe-field select,
.pe-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    background: #fff;
    color: var(--pe-dark);
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}

/* Le thème masque la flèche des listes : on la remet */
.pe-field select {
    padding-right: 38px;
    -webkit-appearance: none;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}

.pe-field select:focus,
.pe-field input:focus {
    outline: none;
    border-color: var(--pe-brand);
    box-shadow: 0 0 0 3px var(--pe-brand-soft);
}

.pe-field__suffix {
    position: relative;
}

.pe-field__suffix input {
    padding-right: 44px;
}

.pe-field__suffix span {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--pe-muted);
    font-size: 14px;
    pointer-events: none;
}

/* ---------- Sections du formulaire ---------- */
.pe-section {
    min-width: 0;
    margin: 0 0 24px;
    padding: 0 0 24px;
    border: 0;
    border-bottom: 1px solid var(--pe-line);
}

.pe-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    color: var(--pe-dark);
    font-size: 18px;
    font-weight: 700;
}

.pe-section__title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pe-brand-soft);
    color: var(--pe-brand-ink);
    font-size: 14px;
}

.pe-section__hint {
    margin: -8px 0 16px;
    color: var(--pe-muted);
    font-size: 14px;
}

.pe-section__count {
    color: var(--pe-brand-ink);
    font-weight: 600;
}

/* État et historique : boutons à choix unique */
.pe-choice {
    margin-bottom: 16px;
}

.pe-choice:last-child {
    margin-bottom: 0;
}

.pe-choice__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pe-choice__option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.pe-choice__option input,
.pe-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pe-choice__option span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--pe-line);
    border-radius: 999px;
    background: #fff;
    color: var(--pe-text);
    font-size: 14px;
    transition: border-color .15s, background .15s, color .15s;
}

.pe-choice__option:hover span {
    border-color: var(--pe-brand);
}

.pe-choice__option input:checked + span {
    border-color: var(--pe-brand);
    background: var(--pe-brand-soft);
    color: var(--pe-brand-ink);
    font-weight: 600;
}

.pe-choice__option--unknown input:checked + span {
    border-color: var(--pe-line);
    background: var(--pe-soft);
    color: var(--pe-muted);
}

.pe-choice__option input:focus-visible + span,
.pe-check input:focus-visible + span {
    box-shadow: 0 0 0 3px var(--pe-brand-soft);
}

/* Options : une catégorie dépliable par groupe */
.pe-options {
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    margin-bottom: 8px;
}

.pe-options__title {
    padding: 12px 14px;
    color: var(--pe-dark);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.pe-options__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 16px;
    padding: 0 14px 14px;
}

.pe-check {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.pe-check span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 14px;
}

.pe-check span::before {
    content: "";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    background: #fff no-repeat center / 12px;
    transition: background-color .15s, border-color .15s;
}

.pe-check input:checked + span::before {
    border-color: var(--pe-brand);
    background-color: var(--pe-brand);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.pe-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

/* « Affiner l'estimation » : parties 2 à 5 repliées */
.pe-more {
    margin-bottom: 20px;
    border: 1px solid var(--pe-line);
    border-radius: 12px;
    background: var(--pe-soft);
    transition: background .2s;
}

.pe-more[open] {
    background: #fff;
}

.pe-more__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.pe-more__toggle::-webkit-details-marker {
    display: none;
}

/* Chevron, tourné quand la partie est ouverte */
.pe-more__toggle::after {
    content: "";
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    margin-left: 4px;
    border-right: 2px solid var(--pe-muted);
    border-bottom: 2px solid var(--pe-muted);
    transform: rotate(45deg) translateY(-3px);
    transition: transform .2s;
}

.pe-more[open] > .pe-more__toggle::after {
    transform: rotate(-135deg) translateY(-3px);
}

.pe-more__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.pe-more__text strong {
    color: var(--pe-dark);
    font-size: 16px;
}

.pe-more__text small {
    color: var(--pe-muted);
    font-size: 13px;
}

.pe-more__count:not(:empty) {
    flex-shrink: 0;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--pe-brand-soft);
    color: var(--pe-brand-ink);
    font-size: 13px;
    font-weight: 700;
}

.pe-more__body {
    padding: 8px 16px 4px;
    border-top: 1px solid var(--pe-line);
    animation: pe-fade-up .25s ease-out both;
}

.pe-more__body .pe-section:first-child {
    padding-top: 12px;
}

.pe-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
}

.pe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 10px;
    background: var(--pe-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s;
}

.pe-btn:hover {
    filter: brightness(.94);
}

.pe-btn:disabled {
    cursor: wait;
    opacity: .7;
}

.pe-btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pe-spin .7s linear infinite;
}

@keyframes pe-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Résultat (colonne de droite) ---------- */
.pe-result {
    position: sticky;
    top: 100px;
    font-size: 15px;
    line-height: 1.6;
    transition: border-color .2s, opacity .2s;
}

.pe-result.is-filled {
    border-color: var(--pe-brand);
}

.pe-result.is-loading {
    opacity: .6;
}

.pe-result__empty > p:nth-child(2) {
    margin: 0;
    color: var(--pe-muted);
}

.pe-result__kicker {
    margin: 0 0 4px;
    color: var(--pe-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Méthode, dans l'état vide */
.pe-steps {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.pe-steps li {
    position: relative;
    padding: 6px 0 6px 26px;
    color: var(--pe-muted);
    font-size: 14px;
}

.pe-steps li::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pe-brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%2356730b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 10px;
}

.pe-steps strong {
    color: var(--pe-dark);
}

/* Dernières estimations (localStorage) */
.pe-history {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--pe-line);
}

.pe-history__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pe-history__item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s;
}

.pe-history__item:hover {
    background: var(--pe-soft);
}

.pe-history__label {
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
}

.pe-history__meta {
    color: var(--pe-muted);
    font-size: 13px;
}

/* Squelette pendant le calcul */
.pe-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pe-skeleton__line,
.pe-skeleton__block {
    display: block;
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--pe-line) 25%, var(--pe-soft) 50%, var(--pe-line) 75%) 0 0 / 200% 100%;
    animation: pe-shimmer 1.2s linear infinite;
}

.pe-skeleton__line--short {
    width: 40%;
}

.pe-skeleton__line--price {
    width: 70%;
    height: 40px;
}

.pe-skeleton__block {
    height: 58px;
    border-radius: 10px;
}

@keyframes pe-shimmer {
    to {
        background-position: -200% 0;
    }
}

/* Résumé : prix, fourchette, prix utiles, confiance */
.pe-summary {
    animation: pe-fade-up .35s ease-out both;
}

.pe-summary__car {
    margin: 0 0 4px;
    color: var(--pe-muted);
    font-size: 14px;
}

.pe-result__price {
    margin: 0;
    color: var(--pe-dark);
    font-size: 40px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.pe-gauge {
    margin: 18px 0 14px;
}

.pe-gauge__track {
    --pe-from: 20%;
    --pe-to: 80%;
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--pe-line) var(--pe-from), var(--pe-brand) var(--pe-from), var(--pe-brand) var(--pe-to), var(--pe-line) var(--pe-to));
}

.pe-gauge__mark {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
    transform: translate(-50%, -50%);
    transition: left .6s cubic-bezier(.2, .8, .2, 1);
}

.pe-gauge__mark--estimate {
    background: var(--pe-dark);
}

.pe-gauge__mark--asking {
    background: #f59e0b;
}

.pe-gauge__labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.pe-gauge__labels span {
    display: flex;
    flex-direction: column;
}

.pe-gauge__labels span:last-child {
    text-align: right;
}

.pe-gauge__labels small {
    color: var(--pe-muted);
    font-size: 12px;
}

.pe-gauge__labels strong {
    color: var(--pe-dark);
    font-size: 15px;
}

/* Prix envisagé situé par rapport au marché */
.pe-position {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-left: 4px solid;
    border-radius: 8px;
    font-size: 14px;
}

.pe-position strong {
    font-size: 15px;
}

.pe-position--fair {
    border-color: var(--pe-brand);
    background: var(--pe-brand-soft);
    color: var(--pe-brand-ink);
}

.pe-position--under {
    border-color: #0284c7;
    background: #e0f2fe;
    color: #075985;
}

.pe-position--above {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.pe-position--far_above {
    border-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

/* Les trois prix utiles */
.pe-prices {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.pe-prices__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 12px;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    background: var(--pe-soft);
}

.pe-prices__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
}

.pe-prices__value {
    color: var(--pe-dark);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pe-prices__hint {
    grid-column: 1 / -1;
    color: var(--pe-muted);
    font-size: 12.5px;
    line-height: 1.4;
}

/* Données réelles / calcul */
.pe-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.pe-badge--data {
    background: #ecfccb;
    color: #3f6212;
}

.pe-badge--calcul {
    background: #e0e7ff;
    color: #3730a3;
}

.pe-badge--ai {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Indice de confiance */
.pe-confidence {
    margin-bottom: 16px;
}

.pe-confidence__head {
    display: flex;
    justify-content: space-between;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
}

.pe-confidence__bar {
    height: 8px;
    margin: 6px 0;
    border-radius: 999px;
    background: var(--pe-line);
    overflow: hidden;
}

.pe-confidence__bar span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

.pe-confidence--high .pe-confidence__bar span {
    background: var(--pe-brand);
}

.pe-confidence--medium .pe-confidence__bar span {
    background: #f59e0b;
}

.pe-confidence--low .pe-confidence__bar span {
    background: #ef4444;
}

.pe-confidence__label {
    margin: 0;
    color: var(--pe-muted);
    font-size: 13px;
}

/* Source de l'estimation (base du site / Claude IA) et nombre d'annonces comparables */
.pe-source {
    display: grid;
    gap: 4px;
    margin: 10px 0 0;
    font-size: 13px;
}

.pe-source div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.pe-source dt {
    color: var(--pe-muted);
    font-weight: 400;
}

.pe-source dd {
    margin: 0;
    color: var(--pe-dark);
    font-weight: 600;
    text-align: right;
}

/* Actions : PDF, partage, modifier */
.pe-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.pe-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    background: #fff;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.pe-action:hover {
    border-color: var(--pe-brand);
}

.pe-action--primary {
    border-color: var(--pe-dark);
    background: var(--pe-dark);
    color: #fff;
}

.pe-action--primary:hover {
    background: #1e293b;
}

.pe-actions__feedback {
    margin: 8px 0 0;
    color: var(--pe-brand-ink);
    font-size: 13px;
    word-break: break-all;
}

.pe-actions__feedback:empty {
    display: none;
}

/* ---------- Analyse (pleine largeur, sous le formulaire) ---------- */
.pe-dash {
    margin-top: 32px;
    animation: pe-fade-up .4s ease-out both;
}

.pe-dash__title {
    margin: 0 0 16px;
    color: var(--pe-dark);
    font-size: 24px;
    font-weight: 700;
}

.pe-dash__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.pe-panel--wide {
    grid-column: 1 / -1;
}

.pe-panel__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--pe-dark);
    font-size: 17px;
    font-weight: 700;
}

.pe-panel__hint {
    margin: -6px 0 12px;
    color: var(--pe-muted);
    font-size: 14px;
}

/* Facteurs qui font monter ou baisser le prix */
.pe-factors {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pe-factor {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pe-line);
}

.pe-factor:last-child {
    border-bottom: 0;
}

.pe-factor__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--pe-soft);
    color: var(--pe-muted);
    font-size: 11px;
}

.pe-factor--up .pe-factor__icon {
    background: var(--pe-brand-soft);
    color: var(--pe-brand-ink);
}

.pe-factor--down .pe-factor__icon {
    background: #fee2e2;
    color: #b91c1c;
}

.pe-factor__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    font-size: 14px;
}

.pe-factor__body strong {
    color: var(--pe-dark);
}

.pe-factor__body span {
    color: var(--pe-muted);
    font-size: 13px;
}

.pe-factor__value {
    flex-shrink: 0;
    font-weight: 700;
}

.pe-factor--up .pe-factor__value {
    color: var(--pe-brand-ink);
}

.pe-factor--down .pe-factor__value {
    color: #b91c1c;
}

/* Détail du calcul : prix du marché puis corrections */
.pe-detail__list {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

.pe-detail__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--pe-line);
    font-size: 14px;
}

.pe-detail__item > span:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pe-detail__value {
    flex-shrink: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pe-detail__item--base .pe-detail__value,
.pe-detail__item--total {
    color: var(--pe-dark);
}

.pe-detail__item--total {
    font-weight: 700;
}

.pe-detail__item--total:last-child {
    border-bottom: 0;
}

.pe-detail__item--up .pe-detail__value {
    color: var(--pe-brand-ink);
}

.pe-detail__item--down .pe-detail__value {
    color: #b91c1c;
}

.pe-detail__item--neutral .pe-detail__value {
    color: var(--pe-muted);
}

.pe-result__basis {
    margin: 0 0 10px;
    color: var(--pe-muted);
    font-size: 14px;
}

.pe-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--pe-muted);
    font-size: 12.5px;
}

/* Graphiques en barres (SVG dessiné par price-estimator.js) */
.pe-chart {
    overflow-x: auto;
}

.pe-chart svg {
    display: block;
}

.pe-chart__bar rect {
    fill: #cbd5e1;
    transform-box: fill-box;
    transform-origin: bottom;
    animation: pe-grow .5s cubic-bezier(.2, .8, .2, 1) both;
    transition: fill .15s;
}

.pe-chart__bar:hover rect {
    fill: #94a3b8;
}

.pe-chart__bar.is-current rect {
    fill: var(--pe-brand);
}

.pe-chart__axis {
    fill: var(--pe-muted);
    font-size: 11px;
}

.pe-chart__value {
    fill: var(--pe-dark);
    font-size: 11px;
    font-weight: 700;
}

/* Annonces comparables */
.pe-similar__title {
    margin: 0 0 8px;
    color: var(--pe-dark);
    font-weight: 600;
}

.pe-similar__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pe-similar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    text-decoration: none;
    transition: background .15s;
}

.pe-similar__item:hover {
    background: var(--pe-soft);
}

.pe-similar__item img {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
}

.pe-similar__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.pe-similar__name {
    overflow: hidden;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-similar__meta,
.pe-similar__diff {
    color: var(--pe-muted);
    font-size: 13px;
}

.pe-similar__side {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: flex-end;
}

.pe-similar__price {
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 700;
}

/* Conseils */
.pe-tips {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pe-tips li {
    position: relative;
    padding: 8px 0 8px 28px;
    border-bottom: 1px solid var(--pe-line);
    font-size: 14px;
}

.pe-tips li:last-child {
    border-bottom: 0;
}

.pe-tips li::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pe-brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2.5v4M6 8.6v.4' fill='none' stroke='%2356730b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 12px;
}

.pe-result__note {
    margin: 20px 0 0;
    color: var(--pe-muted);
    font-size: 13px;
}

@keyframes pe-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes pe-grow {
    from {
        transform: scaleY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pe-skeleton__line,
    .pe-skeleton__block,
    .pe-more__body,
    .pe-summary,
    .pe-dash,
    .pe-chart__bar rect {
        animation: none;
    }

    .pe-gauge__mark,
    .pe-confidence__bar span {
        transition: none;
    }
}

@media (max-width: 991px) {
    .pe__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pe-result {
        position: static;
        scroll-margin-top: 90px;
    }

    .pe-dash__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575px) {
    .pe__title {
        font-size: 26px;
    }

    .pe-card {
        padding: 18px;
    }

    .pe-options__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .pe-form__row,
    .pe-form__row--3 {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        margin-bottom: 14px;
    }

    .pe-result__price {
        font-size: 32px;
    }

    .pe-dash__title {
        font-size: 20px;
    }

    .pe-actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .pe-action--primary {
        grid-column: 1 / -1;
    }
}

/* Impression : seulement le résultat et l'analyse */
@media print {
    .pe-form,
    .pe-actions,
    .pe-actions__feedback {
        display: none;
    }

    .pe__grid,
    .pe-dash__grid {
        display: block;
    }

    .pe-card {
        margin-bottom: 12px;
        box-shadow: none;
        break-inside: avoid;
    }

    .pe-result {
        position: static;
    }
}

/* ---------- Connexion avant le résultat (<dialog data-pe-gate>, price-estimator.js) ---------- */
.pe-gate {
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
}

.pe-gate::backdrop {
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.pe-gate[open] {
    animation: pe-gate-in .22s ease;
}

@keyframes pe-gate-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.98);
    }
}

.pe-gate__box {
    position: relative;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 28px;
    border-radius: var(--pe-radius);
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
    text-align: center;
}

.pe-gate__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    background: #fff;
    color: var(--pe-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pe-gate__close:hover {
    border-color: var(--pe-brand);
    color: var(--pe-brand-ink);
}

.pe-gate__kicker {
    margin: 0 0 6px;
    color: var(--pe-brand-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pe-gate__title {
    margin: 0 0 12px;
    padding: 0 32px;
    color: var(--pe-dark);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
}

.pe-gate__text {
    margin: 0 0 16px;
    color: var(--pe-text);
    font-size: 15px;
    line-height: 1.5;
}

/* Le bouton Google (iframe) se dessine ici : hauteur réservée pour éviter un saut */
.pe-gate__google {
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.pe-gate__or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--pe-muted);
    font-size: 13px;
}

.pe-gate__or::before,
.pe-gate__or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--pe-line);
}

.pe-gate__email {
    text-align: left;
}

.pe-gate__email label {
    display: block;
    margin-bottom: 8px;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 600;
}

.pe-gate__row {
    display: flex;
    gap: 8px;
}

.pe-gate__row input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    font-size: 15px;
}

.pe-gate__row input:focus {
    border-color: var(--pe-brand);
    outline: 2px solid var(--pe-brand-soft);
}

.pe-gate__send {
    flex-shrink: 0;
    height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--pe-dark);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.pe-gate__send:disabled {
    opacity: .6;
    cursor: wait;
}

.pe-gate__error {
    margin: 14px 0 0;
    padding: .55rem .75rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    text-align: left;
}

.pe-gate__icon {
    margin: 4px 0 8px;
    color: var(--pe-brand-ink);
    font-size: 40px;
    line-height: 1;
}

.pe-gate__hint {
    margin: 0 0 20px;
    color: var(--pe-muted);
    font-size: 13px;
}

@media (max-width: 480px) {
    .pe-gate__box {
        padding: 24px 18px;
    }

    .pe-gate__row {
        flex-direction: column;
    }

    .pe-gate__row input {
        flex: none;
        width: 100%;
    }

    .pe-gate__send {
        width: 100%;
    }
}

/* Analyse de Claude (IA) : seulement quand les annonces du site ne suffisaient pas */
.pe-ai {
    margin-bottom: 20px;
    border-color: #e9d5ff;
}

.pe-ai__range {
    margin: 0 0 10px;
    color: var(--pe-text);
    font-size: 15px;
}

.pe-ai__range strong {
    color: var(--pe-dark);
}

.pe-ai__text {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.55;
}

.pe-ai__cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 6px;
}

.pe-ai__subtitle {
    margin: 8px 0 6px;
    color: var(--pe-dark);
    font-size: 14px;
    font-weight: 700;
}

.pe-ai__list {
    margin: 0;
    padding-left: 18px;
    font-size: 13.5px;
    line-height: 1.5;
}

.pe-ai__listings {
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.pe-ai__listing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 8px 10px;
    border: 1px solid var(--pe-line);
    border-radius: 10px;
    background: var(--pe-soft);
    font-size: 13.5px;
}

.pe-ai__link {
    overflow: hidden;
    color: var(--pe-brand-ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pe-ai__meta {
    grid-column: 1;
    color: var(--pe-muted);
    font-size: 12.5px;
}

.pe-ai__price {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    color: var(--pe-dark);
    white-space: nowrap;
}

.pe-ai__empty,
.pe-ai__notice {
    margin: 0 0 6px;
    color: var(--pe-muted);
    font-size: 12.5px;
}

@media (max-width: 575px) {
    .pe-ai__cols {
        grid-template-columns: 1fr;
    }
}
