/*
 * Surcouche outil chatgpt-index-checker.
 * DEPEND DE : consultant-seo-paris.css chargé AVANT (tokens --cp-* + composants).
 * INVARIANTS — toute règle qui les casse touche /consultant-seo-paris et
 * /consultant-seo-yvelines :
 *   1. Tout sélecteur contient .chatgpt-index-page. Sans exception.
 *   2. Toute SURCHARGE d'une règle de base utilise le composé SANS espace
 *      .consultant-paris-page.chatgpt-index-page.
 *   3. Jamais de .consultant-paris-page X nu dans ce fichier.
 *   4. Toute surcharge de grille ou d'alignement est répétée dans les media
 *      queries (une media query n'ajoute aucune spécificité).
 * Vérification de l'invariant 1 :
 *   grep -nE '^[^@/ ].*\{' app/static/css/chatgpt-index-checker.css | grep -v chatgpt-index-page
 *   doit ne rien retourner.
 */

html.consultant-paris-theme .consultant-paris-page.chatgpt-index-page .cic-panel {
    align-self: start;
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 10px;
    border-top: 3px solid var(--cp-clay);
    display: flex;
    flex-direction: column;
    gap: 10px;
    grid-column: 8 / -1;
    grid-row: 1 / 6;
    min-width: 0;
    padding: 24px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-privacy {
    background: var(--cp-clay-soft);
    border-left: 3px solid var(--cp-clay);
    color: var(--cp-text);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 4px;
    padding: 11px 13px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-privacy strong {
    color: var(--cp-heading);
}

html.consultant-paris-theme .chatgpt-index-page .cic-label {
    color: var(--cp-heading);
    font-size: 0.85rem;
    font-weight: 650;
    margin-top: 4px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-input {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-text);
    font-family: var(--font-sans-stack);
    font-size: 0.9rem;
    min-height: 46px;
    padding: 9px 14px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
    width: 100%;
}

html.consultant-paris-theme .chatgpt-index-page .cic-input::placeholder {
    color: var(--cp-muted);
}

html.consultant-paris-theme .chatgpt-index-page .cic-input:focus {
    border-color: var(--cp-accent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--cp-accent) 18%, transparent);
    outline: none;
}

/* Onglets de mode : Vérifier une URL / Rechercher dans l'index. */
html.consultant-paris-theme .chatgpt-index-page .cic-modes {
    display: flex;
    gap: 6px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-mode {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-muted);
    cursor: pointer;
    flex: 1;
    font-family: var(--font-sans-stack);
    font-size: 0.85rem;
    font-weight: 650;
    padding: 9px 10px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-mode.is-active {
    background: var(--cp-clay-soft);
    border-color: var(--cp-clay);
    color: var(--cp-clay-dark);
}

/* Options avancées. */
html.consultant-paris-theme .chatgpt-index-page .cic-options {
    border-top: 1px solid var(--cp-border);
    margin-top: 4px;
    padding-top: 10px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-options-summary {
    color: var(--cp-accent);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 650;
    list-style: revert;
}

html.consultant-paris-theme .chatgpt-index-page .cic-options-grid {
    display: grid;
    gap: 10px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-select {
    min-height: 40px;
    padding: 6px 10px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-opt-exact {
    grid-column: 1 / -1;
}

html.consultant-paris-theme .chatgpt-index-page .cic-opt-exact .cic-label {
    align-items: center;
    display: flex;
    gap: 8px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-opt-exact input[type="checkbox"] {
    accent-color: var(--cp-clay);
    height: 16px;
    width: 16px;
}

@media (max-width: 720px) {
    html.consultant-paris-theme .chatgpt-index-page .cic-options-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

html.consultant-paris-theme .chatgpt-index-page .cic-hint {
    color: var(--cp-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 4px 0 2px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-hint a {
    color: var(--cp-accent);
}

html.consultant-paris-theme .chatgpt-index-page .cic-submit {
    width: 100%;
}

html.consultant-paris-theme .chatgpt-index-page .cic-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

html.consultant-paris-theme .chatgpt-index-page .cic-status {
    color: var(--cp-muted);
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 2px 0 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-status.is-error {
    color: var(--cp-accent);
}

html.consultant-paris-theme .chatgpt-index-page .cic-results {
    margin: 34px 0;
    max-width: 920px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-badge {
    border: 1px solid var(--cp-border);
    border-radius: 99px;
    display: inline-block;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 5px 13px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-badge.is-found {
    background: color-mix(in oklch, var(--cp-clay) 12%, var(--cp-surface));
    border-color: var(--cp-clay);
    color: var(--cp-clay-dark);
}

html.consultant-paris-theme .chatgpt-index-page .cic-badge.is-missing {
    background: var(--cp-accent-soft);
    border-color: var(--cp-accent);
    color: var(--cp-accent);
}

html.consultant-paris-theme .chatgpt-index-page .cic-missing-note {
    color: var(--cp-muted);
    font-size: 0.92rem;
    margin: 14px 0 0;
    max-width: 72ch;
}

html.consultant-paris-theme .chatgpt-index-page .cic-meta-grid {
    display: grid;
    gap: 0 28px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 24px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-meta-pair {
    border-top: 1px solid var(--cp-border);
    min-width: 0;
    padding: 13px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-meta-label {
    color: var(--cp-muted);
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

html.consultant-paris-theme .chatgpt-index-page .cic-meta-value {
    color: var(--cp-heading);
    font-size: 0.95rem;
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extrait-measure {
    color: var(--cp-heading);
    font-size: 0.88rem;
    font-weight: 650;
    margin: 0 0 8px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extrait {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-text);
    font-family: var(--font-sans-stack);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
    max-height: 420px;
    overflow: auto;
    overflow-wrap: break-word;
    padding: 16px;
    white-space: pre-wrap;
}

/* 2e tour : appel au cache de lecture, coût annoncé avant le clic. */
html.consultant-paris-theme .chatgpt-index-page .cic-cache-cta {
    background: var(--cp-clay-soft);
    border-left: 3px solid var(--cp-clay);
    border-radius: 0 10px 10px 0;
    margin: 26px 0 0;
    padding: 18px 20px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-cta-text {
    color: var(--cp-text);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 14px;
    max-width: 72ch;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-button {
    width: auto;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-hint {
    color: var(--cp-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 12px 0 0;
    max-width: 72ch;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-results {
    border-top: 1px solid var(--cp-border);
    padding-top: 28px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-title {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    margin: 0 0 14px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-note {
    color: var(--cp-clay-dark);
    font-size: 0.9rem;
    font-weight: 650;
    margin: -8px 0 18px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-details summary {
    cursor: pointer;
    list-style: revert;
}

html.consultant-paris-theme .chatgpt-index-page .cic-cache-copy {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    max-height: 640px;
}

/* Fan-out : les requêtes exactes envoyées par le modèle. */
html.consultant-paris-theme .chatgpt-index-page .cic-actions {
    margin-top: 28px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-actions-title {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    margin: 0 0 6px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-actions-note {
    color: var(--cp-muted);
    font-size: 0.85rem;
    margin: 0 0 12px;
    max-width: 72ch;
}

html.consultant-paris-theme .chatgpt-index-page .cic-actions-list {
    margin: 0;
    padding-left: 1.3em;
}

html.consultant-paris-theme .chatgpt-index-page .cic-action {
    border-top: 1px solid var(--cp-border);
    padding: 10px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-action-kind {
    color: var(--cp-muted);
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    margin-right: 10px;
    text-transform: uppercase;
}

html.consultant-paris-theme .chatgpt-index-page .cic-action-query {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-heading);
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84rem;
    margin: 3px 6px 3px 0;
    overflow-wrap: anywhere;
    padding: 3px 8px;
}

/* Réponse brute de l'API. */
html.consultant-paris-theme .chatgpt-index-page .cic-raw {
    margin-top: 18px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-raw-summary {
    color: var(--cp-accent);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 650;
    list-style: revert;
}

html.consultant-paris-theme .chatgpt-index-page .cic-raw-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-raw-copy {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-heading);
    cursor: pointer;
    font-family: var(--font-sans-stack);
    font-size: 0.82rem;
    font-weight: 650;
    padding: 6px 12px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-raw-size {
    color: var(--cp-muted);
    font-size: 0.8rem;
}

html.consultant-paris-theme .chatgpt-index-page .cic-raw-pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.45;
    max-height: 560px;
}

/* Texte long reçu par le modèle pendant la recherche (cible et voisines). */
html.consultant-paris-theme .chatgpt-index-page .cic-extended {
    margin-top: 12px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extended.is-target {
    margin-top: 16px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extended-summary {
    color: var(--cp-accent);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 650;
    list-style: revert;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extended-pre {
    font-size: 0.84rem;
    margin-top: 8px;
    max-height: 480px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-extended.is-target + .cic-cache-note {
    margin-top: 12px;
}

/* Markdown rendu (texte reçu, copie du cache) : DOM construit à la main. */
html.consultant-paris-theme .chatgpt-index-page .cic-md-wrap {
    margin-top: 8px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md-tools {
    display: flex;
    gap: 6px;
    margin: 0 0 8px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md-toggle {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 6px;
    color: var(--cp-muted);
    cursor: pointer;
    font-family: var(--font-sans-stack);
    font-size: 0.78rem;
    font-weight: 650;
    padding: 5px 10px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md-toggle.is-active {
    border-color: var(--cp-clay);
    color: var(--cp-clay-dark);
}

html.consultant-paris-theme .chatgpt-index-page .cic-md {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    color: var(--cp-text);
    font-size: 0.92rem;
    line-height: 1.6;
    max-height: 560px;
    overflow: auto;
    overflow-wrap: anywhere;
    padding: 18px 20px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h {
    color: var(--cp-heading);
    font-weight: 700;
    line-height: 1.3;
    margin: 18px 0 8px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h:first-child {
    margin-top: 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h1 { font-size: 1.25rem; }
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h2 { font-size: 1.12rem; }
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h3 { font-size: 1.02rem; }
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h4,
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h5,
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-h6 { font-size: 0.95rem; }

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-p {
    margin: 0 0 10px;
    white-space: pre-wrap;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-list {
    margin: 0 0 10px;
    padding-left: 1.4em;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-list li {
    margin: 2px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-quote {
    border-left: 3px solid var(--cp-border);
    color: var(--cp-muted);
    margin: 0 0 10px;
    padding: 2px 0 2px 12px;
    white-space: pre-wrap;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-hr {
    border: 0;
    border-top: 1px solid var(--cp-border);
    margin: 14px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md code {
    background: var(--cp-clay-soft);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
    padding: 1px 5px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md a {
    color: var(--cp-accent);
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-scroll {
    margin: 0 0 12px;
    max-width: 100%;
    overflow-x: auto;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-table {
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 100%;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-table th,
html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-table td {
    border: 1px solid var(--cp-border);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

html.consultant-paris-theme .chatgpt-index-page .cic-md .cic-md-table th {
    background: var(--cp-clay-soft);
    color: var(--cp-heading);
    font-weight: 650;
}

html.consultant-paris-theme .chatgpt-index-page .cic-others {
    margin-top: 30px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-others-note {
    color: var(--cp-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 14px;
    max-width: 72ch;
}

html.consultant-paris-theme .chatgpt-index-page .cic-other-extrait {
    font-size: 0.86rem;
    margin-top: 8px;
    max-height: 200px;
    padding: 10px 12px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-others-title {
    font-size: clamp(1.15rem, 2vw, 1.35rem);
    margin-bottom: 12px;
}

html.consultant-paris-theme .chatgpt-index-page .cic-others-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-others li {
    border-top: 1px solid var(--cp-border);
    padding: 14px 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-other-url {
    color: var(--cp-accent);
    font-size: 0.88rem;
    word-break: break-all;
}

html.consultant-paris-theme .chatgpt-index-page .cic-other-title {
    color: var(--cp-heading);
    font-size: 0.94rem;
    font-weight: 650;
    margin: 5px 0 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-other-dates {
    color: var(--cp-muted);
    font-size: 0.8rem;
    margin: 4px 0 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-source {
    color: var(--cp-muted);
    font-size: 0.82rem;
    margin: 14px 0 0;
}

html.consultant-paris-theme .chatgpt-index-page .cic-source a {
    color: var(--cp-accent);
}

html.consultant-paris-theme .chatgpt-index-page .cic-cost {
    color: var(--cp-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    margin: 22px 0 0;
}

/* Recopie de .final-cta .cta-meta (scopée yvelines dans le fichier de base). */
html.consultant-paris-theme .chatgpt-index-page .final-cta .cta-meta {
    color: color-mix(in oklch, var(--cp-surface) 62%, transparent);
    font-size: 0.82rem;
    margin: 20px 0 0;
}

@media (max-width: 960px) {
    html.consultant-paris-theme .consultant-paris-page.chatgpt-index-page .cic-panel {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 8px;
    }
}

@media (max-width: 720px) {
    html.consultant-paris-theme .consultant-paris-page.chatgpt-index-page .cic-panel {
        align-self: stretch;
        order: 6;
        padding: 20px;
        width: 100%;
    }

    html.consultant-paris-theme .chatgpt-index-page .cic-meta-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    html.consultant-paris-theme .chatgpt-index-page .cic-input {
        transition: none;
    }
}
