:root {
    --ai-prob-transparent: 255, 255, 255, 0;
    --ai-prob-low: 255, 149, 155;
    --ai-prob-midlow: 243, 194, 189;
    --ai-prob-midhigh: 182, 217, 146;
    --ai-prob-high: 67, 219, 150;
    --ai-prob-transparent: 255, 255, 255, 0;
    --right-bar-width: 350px;
    --rb-peek: 3.25rem;
    /* #right-barHauteur visible du panneau Paramètres */
    --ai-border: #6666661a;
    --ai-box-shadow: 0 0 0 1px var(--tw-shadow-color, #0000000a), 0 2px 8px 0 var(--tw-shadow-color, #0000000a), 0px 4px 80px 8px var(--tw-shadow-color, #00000006);

}

.katex {
    font-size: 1em;
}

/* Accessibilité - Classe pour masquer visuellement tout en gardant accessible aux lecteurs d'écran */
.visually-hidden,
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.vitta-modal {
    max-width: fit-content;
}

/* Accessibilité - Focus visible pour la navigation clavier */
.shepherd-element *:focus-visible {
       outline-width: 3px;
    outline-color: var(--vitta-blue);
}

.theme-light.contrast-high #ai-text-editor-form img {
    filter: contrast(0) !important;
}

.theme-light.contrast-high #ai-text-moderation img {
    filter: grayscale(1) !important;
}

.contrast-high.theme-light #right-bar-content {
    border-left: #000000 2px solid !important;
}

.contrast-high.theme-dark #right-bar-content {
    border-left: #ffffff 2px solid !important;
}

.contrast-high.theme-light .gen-switcher .switcher__input:checked+.switcher__label {
    box-shadow: 0 1px 3px #0f0f0f;
}

.contrast-high.theme-light #container-for-quick-promts .item-prompt-list,
.contrast-high.theme-light #ai-text-editor-form button,
.contrast-high.theme-light .gen-switcher.switcher,
.contrast-high.theme-light #ai-text-editor,
.contrast-high.theme-light .gen-model-card {
    border-color: black !important;
}

.contrast-high.theme-dark #container-for-quick-promts .item-prompt-list,
.contrast-high.theme-dark #ai-text-editor-form button,
.contrast-high.theme-dark .gen-switcher.switcher,
.contrast-high.theme-dark #ai-text-editor,
.contrast-high.theme-dark .gen-model-card,
.contrast-high.theme-dark .gen-switcher .switcher__input:checked+.switcher__label {
    border-color: white !important;
    box-shadow: none !important;
}

.theme-dark.contrast-normal .switcher__input:checked+.switcher__label {
    color: var(--vitta-green) !important;
}




/* Accessibilité - Indicateurs de focus améliorés pour les boutons du tutoriel */
.shepherd-button:focus,
.shepherd-cancel-btn:focus {
    outline: 3px solid var(--vitta-primary-color, #007bff) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.25) !important;
}

/* Accessibilité - Amélioration du contraste pour les éléments de probabilité */
.probs-list [role="option"]:focus {
    outline: 2px solid currentColor !important;
    outline-offset: 1px !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.theme-dark .probs-list [role="option"] {
    background-color: transparent !important;
}



.text-step-2-description img {
    width: 100%;
    height: auto;
    margin-top: 10px;
    border: solid 1px var(--vitta-grey);
}

#tokent-selection:hover {
    background-color: var(--vitta-green) !important;
}

/* Accessibilité - Support pour prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {

    .shepherd-element,
    .shepherd-modal-overlay-container,
    .skip-link,
    .tutorial-item-placeholder-image,
    .rb-sheet-page #right-bar {
        transition: none !important;
        animation: none !important;
    }
}

/* Accessibilité - Support pour prefers-contrast */
@media (prefers-contrast: high) {
    .shepherd-element {
        border: 2px solid currentColor !important;
    }

    .shepherd-button {
        border: 2px solid currentColor !important;
    }

    .probs-list [role="option"] {
        border: 1px solid currentColor !important;
    }
}

html {
    background-color: var(--bg-0) !important;
    scroll-behavior: auto;
    overflow: hidden;
}

.export-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.export-button-icon-image {
    width: 80%;
    transition: transform 0.3s ease;
}

.export-button-icon {
    border-radius: 0.5em;
    width: 4.5em;
    height: 4.5em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 10px var(--vitta-shadow-color);
}

.export-area {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

body {
    overflow: hidden;
    font-size: 18px;
    background-color: var(--bg-0) !important;
}

.ide-navbar {
    justify-content: space-between;
}

#ai-ide {
    height: 100%;
    position: relative;
    background-color: var(--bg-1);
    display: flex;
    flex-direction: column;
}

#ai-ide-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    position: relative;
    border-top: rgba(128, 128, 128, 0.5) 3px solid;
    border-radius: 0px;
}

#ai-ide-container #ai-text-editor {
    height: 8vh;
}

.ai-text-editor .lastStrong {
    font-weight: 900;
}

.ai-text-editor .titre-three {
    font-size: 16px;
}

.ai-text-editor .titre-two {
    font-size: 20px;
}

.ai-text-editor .titre-one {
    font-size: 24px;
}

/* button[type="submit"] {
    display: flex;
    flex-direction: row;
    gap: 5px;
} */
.action-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .6rem;
}

#ai-text-report {
    font-weight: 400;

}


button.token {

    --_opacity: 0.5;
    height: 20px;
    border: none;
    margin: 0;
    padding: 0;
    width: auto;
    overflow: visible;

    background-color: rgba(var(--_bg), var(--_opacity));
    color: var(--text-0);
    font: inherit;
    line-height: normal;
    -webkit-font-smoothing: inherit;
    -moz-osx-font-smoothing: inherit;
    -webkit-appearance: none;
    appearance: none;
    white-space: break-spaces;
}

button.token:hover {
    --_opacity: 0.8;
    scale: 1.1;
}

#content-container:not(.token-display) button.token:hover {
    scale: 1 !important;
}

h1 button.token,
h2 button.token,
h4 button.token,
h3 button.token {
    height: auto;
}

.form-select {
    border-radius: var(--bs-border-radius) !important;
    border: 1px var(--vitta-green) solid;
}

.switcher label {
    font-size: 18px;
    padding: 0px 5px !important;
}

#ai-mode-chat label {
    padding: 0px 10px;
}

.ai-mode-toggle-container .switcher {
    gap: 1em;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.ai-mode-toggle-container .switcher__toggle {
    position: absolute;
    float: left;
    height: 30px;
    font-size: 12px;
    line-height: 30px;
    cursor: pointer;
    border-radius: 30px;
    left: 4px;
    top: 4px;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: 50% !important;
}

.ai-mode-toggle-container .switcher label {
    width: 50% !important;
}

.ai-mode-toggle-container .switcher__input--right:checked~.switcher__toggle {
    width: 140px !important;
    left: calc(100% - 144px);
}

.ai-mode-toggle-container .switcher__label img {
    filter: invert(1);
}

.ai-mode-toggle-container .switcher__input--left:checked~.switcher__toggle {
    width: auto;
}

.ai-mode-toggle-container .switcher__input:focus+.switcher__label {
    outline: 2px solid var(--vitta-green) !important;
}


.dropdown-token {
    display: -webkit-inline-box !important;
    cursor: pointer;


}

/* Groups all the token boxes of a single word so the line never wraps in the
   middle of a word. Line breaks are only allowed between words (see the U+200B
   inserted between .token-word spans in AiTextTokenizer). */
.token-word {
    white-space: nowrap;
}

.user-plain-text {
    white-space: pre-wrap;
    user-select: text;
}

.user-tokenized-text {
    user-select: none;
}

.dropdown-menu {
    border: 2px solid var(--bg-3);
    max-width: max-content;
    min-width: max-content;
    padding: 5px;
}

.dropdown-menu.show {
    display: flex !important;
    flex-direction: column !important;
}

#tokenCount {
    background-color: var(--vitta-grey-dark);
}


/* instruction exemples */

.button-exemple {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin: auto;
}

.button-exemple p,
.list-exemples p {
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 0px !important;
}

.input-group {
    align-items: center;
    font-size: 18px;
}

.button-exemple span,
.exemple span {
    font-size: 16px;
    line-height: 1em;
}

.list-exemples {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 5px;
    width: 100%;
    margin: 5px auto;
    border-radius: 0.25rem;
    box-shadow: 3px 3px 20px var(--vitta-shadow-color);
    border: 2px solid white;
}

/* Hover affordance, like .model-select. .largeCard is the non-interactive
   safe_prompt header, so it keeps its flat look. */
.list-exemples:not(.largeCard) {
    cursor: pointer;
}

.list-exemples:not(.largeCard):hover {
    box-shadow: 3px 3px 10px var(--vitta-grey);
}

.model-worning {
    margin: 10px 30px;
}

.list-exemples img {
    width: 50px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

/* From tablet up: two examples per row, each card centred and narrower. */
@media (min-width: 768px) {
    .aiText-list-form {
        grid-template-columns: 1fr 1fr;
    }

    .list-exemples {
        width: 80%;
    }
}

.ai-text-instruction {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border-radius: var(--bs-border-radius) !important;
    padding: 5px;
    align-items: center;
    margin-bottom: 0.5em;
    align-items: baseline;
}

.item-prompt-list {
    padding: 5px;
    border-radius: 3.25rem;
    margin-right: 10px;
    font-size: medium;
    display: inline-block;
    white-space: nowrap;
    background-color: var(--bg-1) !important;
    box-shadow: var(--ai-box-shadow) !important;
    border-color: var(--ai-border) !important;

}

.item-prompt-list:hover {
    background-color: var(--bg-2) !important;
    color: var(--text-0) !important;
    cursor: pointer;
}

/* Accessibilité - Focus visible pour la navigation clavier */
.item-prompt-list:focus-visible {
    outline-width: 3px;
    outline-color: var(--vitta-blue);
}

#container-for-quick-promts,
#container-for-quick-promts-image {
    overflow-y: hidden;
    overflow-x: auto;
    display: -webkit-inline-box;
    display: flex;
    text-align: end;
    padding-bottom: 4px;
}

#container-for-quick-promts {
    display: none;

}

.random-prompts-list {
    display: contents;
}

.ide-cog-button {
    margin-left: 0px !important;
}

.largeCard {
    grid-column: 1 / -1;
    box-shadow: none !important;
    border: none !important;
}

/*messages*/
.chat-userMsg {
    padding: 5px 10px;
    letter-spacing: 0px;
    opacity: 1;
    max-width: 80%;
    margin-inline-start: auto;
    margin-bottom: 0.5em;
    position: relative;
    background-color: var(--bg-2);
    width: max-content;
    border-radius: 1.25rem;
    border: solid 1px var(--vitta-grey);
    font-size: medium;
}

.contrast-high.theme-light .chat-userMsg {
    border-width: 2px !important;
    border-color: black !important;
}

.contrast-high.theme-dark .chat-userMsg {
    border-color: rgb(255, 255, 255) !important;
}

.theme-dark .chat-userMsg {
    border-width: 2px !important;
}

.theme-dark .shepherd-content {
    border: 2px solid var(--vitta-white) !important;
}

.theme-dark .shepherd-content .probtoken {

    background: var(--bg-5);

}

.theme-dark .shepherd-content .dropdown-item {

    background-color: transparent;

}

.theme-dark .progress-balance span {
    background-color: var(--vitta-grey);
}

tbody,
td,
tfoot,
th,
thead,
tr {
    CORNER-SHAPE: SUPERELLIPSE(0.5);
    border-color: var(--bg-3) !important;
    border-style: solid !important;
    border-width: 1px !important;
}

td,
th {
    padding: 5px !important;
    text-align: left;
}

.chat-aiMsg {
    padding: 10px;
    letter-spacing: 0px;
    opacity: 1;
    border-radius: var(--bs-border-radius) !important;
    max-width: 90%;
    margin-bottom: 0.5em;
    position: relative;
}

.message-container {
    margin-bottom: 6px;
}

.message-container img {
    padding-right: 3px;
}

ai-message-container {
    white-space: nowrap;
    word-break: keep-all;
}


.ai-message-container img {
    float: left;
    padding-left: 3px;
}

.ai-message-container {
    position: relative;
}

.button-copy {
    display: block;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-0) 82%, transparent);
    cursor: pointer;
}

.button-copy:hover {
    color: var(--vitta-orange-light);
}
.hidden-btn {
    visibility: hidden;
}

.final-message,
.final-message p {
    display: inline !important;
    word-break: keep-all;
    color: var(--text-0);
}


.top-logprobs-header {
    width: max-content;
    max-width: 260px;
    white-space: wrap;
    padding: 0.3rem;
}

.ai-text-editor {
    height: 50vh;
    overflow-y: auto;
}

.justify-content-between .ai-text-editor {
    height: 25vh !important;
}

.token-message {
    filter: grayscale(1);
    white-space: pre-wrap;
    user-select: text;
}

.aiText-list-form {
    display: grid;
    margin-bottom: 20px;
}

#ai-text-editor-form button img {
    width: 20px;
}

#ai-text-editor-form-container .form-control,
#ai-text-editor-form .form-control {
    background-color: var(--bg-0) ;
    box-shadow: var(--ai-box-shadow);
    border-color: var(--ai-border);
}
#ai-text-editor-form-container .form-control:focus,
#ai-text-editor-form .form-control:focus {
    border-color: var(--vitta-grey-dark);
    box-shadow: 0px 0px 10px var(--vitta-blue);
}

#ai-text-editor-form .action-bar {
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

#ai-text-editor-form .action-bar .btn {
    margin: 0 !important;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    height: 40px;
}

/* Boutons icône seule (signaler, modération)*/
#ai-text-editor-form .action-bar .btn:not(:has(span)) {
    width: 40px;
    height: 40px;
    padding: 0;
}

/* Boutons secondaires = fond neutre bordé. */
#ai-text-editor-form .action-bar .btn-secondary {
    border-color: var(--bg-3);
    color: var(--text-2);
}

.form-action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.form-action-buttons .btn-secondary {
    background: var(--bg-2);
    border-color: var(--bg-2);
    color: var(--text-1);
}

.form-action-buttons .btn-secondary img {
    filter: invert(0.5);
}

#ai-text-editor-form .action-bar .btn-secondary:hover:not(:disabled) {
    opacity: 0.6;
}


#ai-text-editor-form .action-bar .btn-primary {
    background: var(--vitta-green);
    border-color: var(--vitta-green);
    color: #fff;
}

#ai-text-editor-form .action-bar .btn-primary:hover:not(:disabled) {
    transform: scale(1.01);
}

#ai-text-editor-form .action-bar #ai-text-editor-submit,
#ai-text-editor-form .action-bar #ai-text-editor-regenerate,
#ai-text-editor-form .action-bar #ai-text-editor-stop,
#ai-text-editor-form .action-bar #send-message {
    font-size: 0.95rem;
}


.count-danger {
    color: var(--vitta-red);
    font-weight: 600;
}


.model-text {
    font-weight: 600;
}

.models-parameters {
    font-size: medium;
    font-weight: bold;
    padding: 0px 5px;
}

.flex-row small {
    color: var(--vitta-green);
    font-size: medium;
    font-weight: bold;
}

.model-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.instruction-remove img {
    filter: invert(50%);
    width: 15px;
}

.no-display {
    display: none;
}

#instruction-remove {
    max-height: 40px;
    max-width: 50px;
}

#button-continue:hover {
    cursor: pointer;
    color: var(--vitta-orange-light)
}

#model-select {
    visibility: hidden;
    color: var(--text-1);
}

#model-select option:hover {
    background-color: #24A069;
}

option[selected] {
    background: var(--vitta-grey)
}

pre {
    font-feature-settings: "tnum";
    /* Active les chiffres tabulaires */
    font-variant-numeric: tabular-nums;
    /* Alternative pour les navigateurs modernes */
    background-color: var(--bg-2);
    border: 1px solid var(--text-2);
    border-radius: 10px;
    position: relative;
    padding: 1em;

}

code.hljs {
    padding: 0em !important;
}

code,
.probtoken {
    background-color: var(--bg-3);
    border-radius: 3px;
    padding: 0 3px;
    font-size: 16px;
}

code {
    color: #b62a70;
}

.probtoken {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.95em;
}

.dropdown-item.active {
    color: var(--text-0) !important;
    font-size: larger;
}

.probs-list .dropdown-item.active {
    font-size: medium;
}

.dropdown-item.active {
    color: var(--text-0) !important;
}


/* step-by-step progress bar */
.progress-balance-wrapper {
    height: 18px;
    width: 104px;
    border: 3px solid var(--bg-0);
    border-radius: 5px;
    background-color: var(--bg-0);
}

.prob-score {
    width: 185px;
    border-radius: 5px;
    height: 20px;
    display: flex;
    align-items: center;
    gap: 1.2em;
    background: var(--vitta-green);
    color: white;


}

.prob-score span {
    margin-left: 5px;
    font-size: 0.9em;
    font-weight: 600;
    padding: 2px;
    width: 55px;
}

.progress-balance {
    width: 100%;
    height: 14px;
    background-color: var(--vitta-green);
    border-radius: 5px 0px 0px 5px;
}

.progress-balance span {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 0 2px var(--bg-0);
    cursor: help;
}

/* fin step-by-step */
.probs-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: auto;
    overflow-y: none;
}

.probs-list .dropdown-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 25px;
    background-color: transparent;
}

.more-tokens {
    position: relative;
    left: 50%;
    border: none;
    background: var(--bg-0);
    text-decoration: underline;
    color: var(--bs-gray);
    cursor: pointer;
}

pre .dropdown-menu {
    font-family: var(--bs-body-font-family);
}

.dropdown-item code {
    background-color: var(--bg-3);
}

.copy-code-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1em;
    cursor: pointer !important;
}

.copy-code-btn:hover {
    color: var(--vitta-orange-light);
}

.copy-code-feedback {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 1em;
    opacity: 0;
    color: var(--vitta-green);
    transition: opacity 0.3s;
}
.fa-check {
    color: var(--vitta-green);
}

.request-params {
    display: block;
    text-align: end;
}

.info-addition {
    font-size: small;
    float: right;
}

.v-text {
    font-weight: bold;
    text-align: center;
    margin-bottom: 1em;
}

#modal-aiText-models,
#modal-aiText-exemples,
#modal-ai-generate-image-styles,
#modal-ai-generate-image-models,
#modal-ai-image-generate-moderation,
#modal-aiText-report {
    border: 2px solid white;
}

#modal-ai-generate-image-models {
    width: min(90vw, 960px);
    max-width: 960px;
}

#modal-aiText-models {
    width: min(90vw, 960px);
    max-width: 960px;
}


/* Mobile-first : pleine largeur + petit texte sur téléphone/tablette ; largeur
   au contenu restaurée dès lg. Ex-bloc desktop-first @media max-width:940px. */
.censure-warning {
    width: 100%;
    font-size: 10px;
    /* border:  solid 1px var(--vitta-orange-light); */
    padding: 5px;
    border-radius: var(--bs-border-radius) !important;
    box-shadow: 3px 3px 10px var(--vitta-grey);
    padding: 10px;
    margin: auto;
    background: #FFFFFF 0% 0% no-repeat padding-box;
    box-shadow: 0px 0px 10px #FF94034D;
    border: 1px solid #FF9404 !important;
}

@media (min-width: 1024px) {
    .censure-warning {
        width: max-content;
        font-size: inherit;
    }
}

.censure-warning .btn {
    position: relative !important;
    transform: translate(50%, -50%);
}

#modal-aiText-tokens-restriction,
#modal-aiText-models-restriction,
#modal-ai-generate-images-restriction {
    width: 40%;
    z-index: 1005;
}

#modal-aiText-rag-restriction {
    width: 50%;
}

#modal-aiText-tokens-restriction .vitta-modal-header span,
#modal-aiText-models-restriction .vitta-modal-header span,
#modal-ai-generate-images-restriction .vitta-modal-header span {
    color: var(--vitta-red);
}

.plyr__video-wrapper {
    margin: -5px !important;
}

#modal-tokens-restriction-button-subscription,
#modal-models-restriction-button-subscription,
#modal-images-restriction-button-subscription {
    background-color: var(--vitta-orange-light);
}

/* .list-models / .premium-restrictions / .available-restrictions styles live in components/modelCard.js */

.safetyPrompt {

    border: 3px solid var(--vitta-green);
    border-radius: 10px;
    padding: 10px 38px 10px 12px;
    font-size: 1em;
    font-weight: 400;
    line-height: 1;
    color: var(--text-1);
    text-align: left;
    width: 100%;
    margin-bottom: 10px;
}

.safetyPrompt button {
    position: relative;
    left: 100%;
}

/* shepherd */
.shepherd-arrow:before {

    display: inline-block !important;
    transform: rotate(-45deg);
}

.shepherd-modal-overlay-container {
    z-index: 100000 !important;
}

.shepherd-element {
    z-index: 100001 !important;
    margin: 10px !important;
}

.shepherd-element.shepherd-has-title .shepherd-content .shepherd-header {
    background: transparent;
    padding: 0;
}

.shepherd-element .shepherd-content {
    background: var(--bg-1, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 400px;
    border: none;
}

.shepherd-element .shepherd-text {
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-1, #1f2937);
}

.shepherd-element .shepherd-text .v-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--vitta-green, #1B855A);
}

.shepherd-element .shepherd-text .info-addition {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--vitta-grey-dark);
    text-align: right;
    font-style: italic;
}

.shepherd-element .shepherd-footer {
    padding: 12px 0 0 0;
    margin-top: 12px;
}

.shepherd-element .shepherd-arrow {
    z-index: 100002 !important;
    width: 16px;
    height: 16px;

}

.shepherd-element .shepherd-arrow:before {
    border: 3px solid var(--vitta-green) !important;
    border-top: none !important;
    border-left: none !important;
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    position: absolute;
}

.shepherd-element[data-popper-placement^='top'] .shepherd-arrow:before {
    transform: rotate(45deg);
    bottom: -1px;
}

.shepherd-element[data-popper-placement^='bottom'] .shepherd-arrow:before {
    transform: rotate(225deg);
    top: -1px;
}

.shepherd-element[data-popper-placement^='left'] .shepherd-arrow:before {
    transform: rotate(-45deg);
    right: -1px;
}

.shepherd-element[data-popper-placement^='right'] .shepherd-arrow:before {
    transform: rotate(135deg);
    left: -1px;
}

.shepherd-target {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(27, 133, 90, 0.5) !important;
}

.shepherd-target:focus,
.shepherd-target:focus-visible {
    outline: none !important;
}


.shepherd-cancel-icon {
    height: 35px;
    width: 35px;
    position: absolute;
    right: 0%;
    top: 0%;
    transform: translate(35%, -35%);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em !important;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;

    --bs-btn-padding-x: 0.15em;
    --bs-btn-padding-x: 0.15em;
    --bs-btn-focus-box-shadow: 0px 0px 10px var(--vitta-blue);
    --bs-btn-border-radius: 50%;

    --bs-btn-color: var(--text-1);
    --bs-btn-bg: var(--bg-1);

    --bs-btn-hover-color: var(--text-1);
    --bs-btn-hover-bg: var(--bg-3);

    --bs-btn-active-color: var(--text-2);
    --bs-btn-active-bg: var(--bg-3);

}

.shepherd-cancel-icon:hover {
    cursor: pointer;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
    background-color: var(--vitta-grey-dark) !important;
}

.theme-dark .shepherd-target {
    background-color: var(--bg-5) !important;
}

.gradcam-info-wrapper {
    justify-content: center !important;
}

#original-image {
    width: 90% !important;
    height: 90%;
    padding: 5px;
}

.edit-image-for-adacraft {
    border: 2px solid var(--vitta-green);
    border-radius: 20px;
    max-width: 350px;

}

#cropped-image {
    display: block;
    object-fit: contain;
    border-radius: 12px;
    background-color: var(--bg-2);
    max-width: min(350px, 100%);
    margin-top: 1em;
    aspect-ratio: 12 / 9;
}

.vitta-modal {
    max-height: max-content !important;
}

.tutorial-item-placeholder-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background-image: linear-gradient(90deg, var(--bg-3) 0px, var(--bg-1) 80px, var(--bg-3) 180px);
    animation: shine-placeholder 2s infinite linear;
    background-size: 600px
}

.form-control::placeholder {
    /* --text-3 (#a1a1a1 on white) is ~2.5:1, below the 4.5:1 AA floor for
       readable text — --text-2 (#666, ~5.7:1) is the closest token that clears it. */
    color: var(--text-2) !important;
}

@keyframes shine-placeholder {
    0% {
        background-position: -180px;
    }

    40%,
    100% {
        background-position: 360px;
    }
}


@media screen and (max-height: 850px) {
    .vitta-modal {
        max-height: calc(100% - 20vh) !important;
    }

    #modal-aiImage-generate-restriction .modal-footer-div div {
        flex-direction: column !important;
    }
}


.editor-image-playground .input-group {
    width: 80% !important;
    margin: auto !important;
    justify-content: center !important;
}

.editor-image-playground {
    width: 80%;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 20px;
    justify-content: space-evenly;
    align-content: stretch;
    align-items: start;
    justify-items: center;
}

#image-without-bg {
    padding: 5px;
}

.square {
    height: 200px;
    width: 200px;
    border: 3px solid var(--vitta-green);
}

.green {
    border: 3px solid var(--vitta-green);
}

.gray {
    background-color: #a5a5a530;
    border: 2px solid var(--vitta-grey);
    left: 20px;
    top: 20px;

}

.square img {
    border: 5px solid var(--bg-0);
    border-radius: 50%;
    width: 30px !important;
}

.theme-ligth .image-dark {
    display: none;
}

.theme-ligth .image-light {
    display: block;
}

.theme-dark .image-light {
    display: none;
}

.theme-dark .image-dark {
    display: block;

}

#new-resource-tutorial {
    margin: auto !important;

}

#new-resource-tutorial>div {
    gap: 0.3em !important;
}

.theme-dark #new-resource-tutorial,
.theme-dark .shepherd-element,
.theme-dark .shepherd-arrow {
    background-color: var(--bg-3);
}

.theme-dark .shepherd-text {
    color: var(--vitta-white);
}

.hidden-message {
    display: none;
}

.user-message-container .token span {
    background-color: var(--bg-2);
    border: 3px solid rgba(0, 0, 0, 0.5);
    border-left: none;
    border-top: none;
    border-right: none;
    border-radius: 5px;
    max-height: 2px;

}


#modal-choice-of-use-adacraft label .btn {
    font-size: 1.2rem;
}

#modal-choice-of-use-adacraft label img {
    width: 25px;
    margin: -3px;
}

.noHover {
    pointer-events: none;
}

.box-navigation button {
    margin-right: 5px;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
    appearance: none;
    text-transform: none;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    border-color: ghostwhite;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    gap: 8px;
    background: rgba(9, 9, 11, 0);
}

.tab-content>.active,
.best-creations,
#assets-game-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 20px;
    align-items: end;
    margin-top: 25px;
    justify-items: center;
    width: 100%;
    justify-content: space-around;
}

.best-creations {
    text-align: center;
    height: 100%;
    opacity: 1;
    flex-direction: column;
    align-items: center;
}

.container-green-border {
    box-shadow: 1px 1px 15px #24A06967;
    border: 1px solid var(--vitta-green);
    border-radius: 1em;
}

.tab-content>#best-images-container {
    display: block;
    justify-items: start;
}

/* ===== Onglets vitrine (#show-assets-container #myTab) =====
   Segmented control : barre arrondie (bg-1) contenant des pills.
   Mobile-first : défilement horizontal si les onglets débordent, jamais
   d'empilement vertical. Scopé par id -> surcharge .nav/.nav-tabs Bootstrap
   et la règle `.nav { flex-direction: column }` sans !important. */
#show-assets-container #myTab {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    margin: 0.25rem 0.5rem 0.5rem;
    padding: 0.25rem;
    border: 0;
    border-radius: 0.75rem;
    background: var(--bg-1);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-3) transparent;
}

#show-assets-container #myTab::-webkit-scrollbar {
    height: 8px;
}

#show-assets-container #myTab::-webkit-scrollbar-thumb {
    background: var(--bg-3);
    border-radius: 999px;
}

#show-assets-container #myTab::-webkit-scrollbar-track {
    background: transparent;
}

#show-assets-container #myTab .nav-item {
    margin: 0;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

#show-assets-container #myTab .ide-share-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.55rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-2);
    background: transparent;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#show-assets-container #myTab .tab-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Petit badge éventuel (compteur) injecté par JS : pas d'espace s'il est vide. */
#show-assets-container #myTab .ide-share-tab small:empty {
    display: none;
}

/* < desktop (lg 1024px) : icônes seules. Le libellé reste dans l'arbre
   d'accessibilité (technique sr-only) mais n'est plus affiché. */
#show-assets-container #myTab .tab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

#show-assets-container #myTab .ide-share-tab:hover {
    color: var(--text-0);
    background: var(--bg-2);
}

#show-assets-container #myTab .ide-share-tab:focus-visible {
    outline-width: 3px;
    outline-color: var(--vitta-blue);
}

/* Onglet actif : pill surélevée (bg-0) + accent vert. La classe `active` est
   posée sur le .ide-share-tab lui-même (et non un enfant). */
#show-assets-container #myTab .ide-share-tab.active {
    color: var(--vitta-green);
    background: var(--bg-0);
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Desktop (lg 1024px+) : on réaffiche le libellé à côté de l'icône et on
    redonne de l'air aux pills. Le scroll horizontal reste géré par la roue
    quand la barre déborde. */
@media (min-width: 1024px) {
    #show-assets-container #myTab .ide-share-tab {
        padding: 0.5rem 1.1rem;
        font-size: 0.95rem;
    }

    #show-assets-container #myTab .tab-icon {
        margin-inline-end: 0.45rem;
    }

    #show-assets-container #myTab .tab-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
    }
}

.wrapper-my-last-creation {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: fit-content;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid white;
    position: relative;



}

.image-container {
    height: 20rem;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3px;
    position: relative;
}

.wrapper-my-last-creation img {
    aspect-ratio: initial;
    max-width: min-content;
    max-height: 20rem;
    width: 100%;
    border-radius: 10px;
}

.creator-info {
    display: flex;
    align-items: center;
    padding: 10px;
    width: 100%;
    margin: 0 auto;
    max-width: 20rem;
}


.creator-info img {
    max-width: 25px;
}

.creator-info img,
.creator-info i {
    width: 25px;
    margin-right: 10px;
}

.image-by-creator {
    height: 15rem;
    margin: 10px;
    border-radius: 8px;
}

.user-icon {
    width: 40px;
    height: 40px;
    background-color: var(--bg-3);
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
}

.text-content {
    flex-grow: 1;
}

.creator-name {
    font-weight: bold;
    margin: 0;
    font-size: 14px;
}

.time {
    color: var(--text-2);
    margin: 0;
    font-size: 12px;
}

.interaction {
    display: flex;
    align-items: center;

}

.interaction i {
    color: var(--vitta-red);
}

.interaction:hover {
    cursor: pointer;
}

.likedImage i {
    font-weight: 700;
}

.count {
    font-size: 14px;
    margin-right: 5px;
}

.image-section {
    flex: 2;
    display: flex;
    justify-content: center;
}

.generated-image {

    aspect-ratio: initial;
    max-height: 70vh;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.info-section {
    flex: 1;
    padding: 0 15px;
}

.creator-name {
    font-weight: bold;
}

#arrow-left,
#arrow-right {
    background-color: rgb(245, 245, 245) !important;

}

#arrow-left:hover,
#arrow-right:hover {
    filter: none !important;
    color: var(--vitta-grey-dark) !important;
}

.download-section {
    margin-bottom: 10px;
}

.prompt-section {
    margin-bottom: 10px;
}

.settings {
    margin-bottom: 10px;
}

.setting-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

#modal-generated-image .setting-option {
    margin-bottom: 0px;
}

#modal-generated-image p {
    margin-bottom: 0.1rem
}

#modal-generated-image strong {
    margin-right: 5px;
}

.setting-option label {
    margin-right: 5px;
}

input[type="range"] {
    margin-left: 5px;
}

.more-images {
    margin-top: 10px;
}

#more-assets-game {
    margin: 10px auto;
}

.nav-link p {
    display: inline;
}

/*RAG section */
#video-container {
    border-radius: 15px;
    box-shadow: 0px 0px 6px var(--vitta-shadow-color);
    overflow: hidden;
    max-width: 80%;
    margin: auto;
}

.loading {
    color: var(--text-1);
    font-style: italic;
}

.stats {
    margin: 10px 0;
    padding: 10px;
    background: var(--bg-2);
    border-radius: 4px;
}

.right-bar-title p,
.right-bar-title h2 {
    margin-bottom: 0;

}

.rb-sheet-page #right-bar-content .right-bar-title > p,
.rb-sheet-page #right-bar-content .right-bar-title > h2,
.rb-sheet-page #right-bar-content .gen-section-title > p,
.rb-sheet-page #right-bar-content .gen-section-title > h2,
.rb-sheet-page #right-bar-content .gen-field-label,
.rb-sheet-page #right-bar-content .gen-slider-head .gen-field-label,
.rb-sheet-page #right-bar-content .ai-user-restrictions-card .export-button-text {
    margin: 0;
    color: var(--text-0);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
}

.highlight {
    background-color: #ff0;
    color: #000;
}

.rag-prompt-button {
    cursor: pointer;
    color: var(--vitta-blue);
    text-decoration: underline;
}

.icon-arrow-chunk {
    width: 30px;
    margin: 2px
}

.texte-tronque {
    white-space: nowrap;
    /* pas de retour à la ligne */
    overflow: hidden;
    /* cache ce qui dépasse */
    text-overflow: ellipsis;
    /* ajoute les trois points (...) */
    max-width: 90%;
}

/*consumption*/
.consumption iframe {
    padding: 0 !important;
}

.etiquette {
    background-color: white;
    position: relative;
    line-height: 1.25em !important;
    width: fit-content;
    align-items: center;
    min-width: 100%;
}

.theme-dark .etiquette {
    background-color: var(--bg-1);
}

.equivalent {
    position: relative;
    display: flex;
    border-radius: 0 0 8px 8px;
    border: 2px solid var(--vitta-green);
    border-right: 1px solid var(--vitta-green);
    border-top: none;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, .06);

}

.consum-animation {
    position: relative;
    display: inline-block;
}

.consum-animation img {
    display: block;
    width: 70px;
}

.consum-text {
    position: absolute;
    z-index: 10;
    top: 70%;
    right: 15%;
    transform: translate(0%, -50%);
    color: var(--bg-0);
    font-weight: 700;
    pointer-events: none;
    text-align: center;
    line-height: 20px;
    font-size: 0.75em;
}

.theme-dark .consum-text {
    color: var(--text-1);
}

.data-consum-card {
    flex: 1;
    padding: 12px;
    border-right: 1px solid var(--vitta-green);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.data-consum-card:first-child {
    border-left: none;
}

.data-consum-card img {
    width: 45px;
    height: 45px;
    margin-bottom: 10px;
}

.value {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.font-size-medium {
    font-size: medium;
}

.gwp-value {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    border: 2px solid var(--vitta-green);
    border-radius: 6px 6px 0px 0px;
    text-align: center;
    padding: 4px;
    background: #19875412;
}

.gwp-value span {
    font-weight: 600;
}

.data-consum-card .label {
    font-size: .75em !important;
    font-weight: 500 !important;
    line-height: 1em !important;
}

.consumption-content button {
    border: none;
    background-color: var(--vitta-green);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    right: 10px;
    border: 2px solid var(--primary-30) !important;
    height: 2rem !important;
    width: 2rem !important;
}

/* responsive */
#right-bar {

    width: 350px;
    right: 0%;
    position: fixed;
    height: 100%;
    background-color: var(--bg-0);
    border: 5px solid var(--bg-3);
    padding: unset !important;
    z-index: 20;
}

#right-bar.aig-right-bar {
    /* Cap to the viewport so the bar never overflows on phones
       narrower than the sidebar (e.g. 320px screens). */
    width: var(--right-bar-width);
    width: min(var(--right-bar-width), 100vw);

}

.playground #right-bar-content {
    height: calc(100% - 45px) !important;
}

#right-toggle-bar {
    transform: rotate(180deg) !important;
    left: -25px;
    top: calc(50% - 100px);
    transform: translateY(-50%);
}

#right-toggle-bar i {
    position: relative;
    top: 10px;
    left: 5px;

}


#right-bar-content {
    width: auto;
    height: calc(100% - 120px);
    margin-right: -3px;

}


/* Poignée du bottom-sheet (panneau Paramètres en mobile). Scopée à .rb-sheet-page
   (text.php + image-generate.php) pour ne pas affecter d'autres pages (ex. TTS)
   qui partagent ce CSS. Masquée en desktop ; affichée dans @media max-width:768px. */
.rb-sheet-page .rb-sheet-grip {
    display: none;
}

#left-part-container {
    background-color: var(--bg-1);
}

#left-part {
    width: calc(100% - var(--right-bar-width));
    height: 100%;
}

/* ===== Zones image-generate : séparation visuelle (anti-mélange) =====
   .ig-playground = saisie + boutons + image générée ; .ig-vitrine = créations.
   Chaque zone est une carte autonome (tokens -> thème clair/sombre). */
.ig-zone {
    background: var(--bg-0);
    border: 1px solid var(--bg-3);
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 1rem;
}

.ig-vitrine {
    margin-bottom: 0;
}


/* En-têtes de section (Paramètres / Consommation / Sources / Utilisation) */
.rb-sheet-page #right-bar-content .right-bar-title {
    gap: 0.5rem;
    padding: 0.5rem 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.rb-sheet-page #right-bar-content .right-bar-title:hover {
    background: var(--bg-2);
}

.rb-sheet-page #right-bar-content .gen-section-title {
    display: block;
    width: calc(100% - 1rem);
    margin: 0.5rem !important;
    padding: 0.5rem 0.4rem;
    cursor: default;
    text-align: left;
}

.rb-sheet-page #right-bar-content .gen-section-title > p {
    display: block;
    width: 100%;
    text-align: left !important;
}

.rb-sheet-page #right-bar-content #parameters.gen-section-title {
    margin: 0.2rem 0.5rem 0.1rem !important;
}

.rb-sheet-page #right-bar-content #ai-text-options #parameters.gen-section-title {
    width: 100%;
    margin: 0.2rem 0.5rem 0.1rem !important;
}

.rb-sheet-page #right-bar-content #parameters+.generation-content {
    padding-top: 0;
}

.rb-sheet-page #right-bar-content #parameters+.parameters-content {
    padding-top: 0;
}

.rb-sheet-page #right-bar-content #ai-text-options #cont-model-selected,
.rb-sheet-page #right-bar-content #ai-text-options .button-exemple,
.rb-sheet-page #right-bar-content #ai-text-options .text-sidebar-block {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

.rb-sheet-page #right-bar-content #ai-text-options .text-sidebar-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rb-sheet-page #right-bar-content #ai-text-options .gen-slider-head,
.rb-sheet-page #right-bar-content #ai-text-options .text-sidebar-block > .w-100,
.rb-sheet-page #right-bar-content #ai-text-options .ai-mode-toggle-container > .gen-field-label {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.rb-sheet-page #right-bar-content .ai-user-restrictions-card,
.rb-sheet-page #right-bar-content .gen-field,
.rb-sheet-page #right-bar-content .gen-slider-block {
    margin: 0 0.5rem;
}


/* Chevron poussé tout à droite (passe devant l'utilitaire Bootstrap .mx-2). */
.rb-sheet-page #right-bar-content .right-bar-title>i.fa-chevron-right,
.rb-sheet-page #right-bar-content .right-bar-title>i.fa-chevron-down {
    margin-left: auto !important;
    color: var(--text-3);
    font-size: 0.85em;
}

/* Séparateurs discrets façon maquette (.divider). */
.rb-sheet-page #right-bar-content hr {
    height: 1px;
    border: 0;
    background: var(--bg-3);
    opacity: 1;
}

/* Accent vert sur les icônes de réglages (modèle, aléatoire) comme la maquette. */
.rb-sheet-page #right-bar-content .parameters-content .fa-robot,
.rb-sheet-page #right-bar-content .parameters-content .fa-dice-three {
    color: var(--vitta-green) !important;
}

/* Icônes d'export (Utilisation) : fond carré arrondi façon maquette. */
.rb-sheet-page #right-bar-content .export-button-icon {
    background: var(--bg-2);
}

think,
.thinkCompleted {
    margin-left: 25px;
    --bs-badge-font-weight: 500;
    --bs-badge-color: #fff;
    --bs-badge-border-radius: 0.375rem;
    display: inline-block;
    background-color: var(--bg-2);
    border: 1px solid var(--text-2);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    padding: 10px;
}

/* Reflection ("thinking") block for reasoning-capable models. The inner
   .reasoning-content reuses the .thinkCompleted badge styling above. */
.ai-reasoning {
    margin-bottom: 8px;
}

.ai-reasoning .reasoning-icon {
    float: left;
}


.vitta-logo {
    width: 30px;
    float: left;
}

/*game part*/
.game-image img {
    max-width: 20rem;
    max-height: 20rem;
    margin: 1em;
    border-radius: 10px;
}




/* Breakpoint normalisé 940 → lg (1024) pour rester sur les paliers standard. */
@media (min-width: 1024px) {

    #manage-button-panel button span,
    .ide-btn-group-mode button span {
        display: none;
    }
}


/* ============================================================================
   RESPONSIVE MOBILE-FIRST (SKILL responsive-css §1)
   Bloc historiquement écrit en desktop-first (@media max-width:768px), inversé :
   - styles de base ci-dessous = téléphone ;
   - @media (min-width: 768px) plus bas = restauration desktop (valeurs d'origine).
   Frontière conservée à 768px pour rester alignée avec rightbar-text&image.js
   (matchMedia "(max-width: 768px)"). Les surcharges de composants TIERS
   (Shepherd, Cropper), dont la valeur desktop appartient à la librairie, restent
   dans un petit bloc max-width:768px documenté en fin de section.
   ========================================================================== */

.models-parameters {
    font-size: small;
}

.scrollbar {
    overflow-y: auto;

    /* height: clamp(8rem, 32vh, 45vh); */
}

.ai-text-instruction {
    font-size: 14px;
    padding: 0px;
}

form small {
    display: contents;
    font-size: 12px;
}

.image-generated-wrapper {
    margin: 0.5rem !important;
}

/* #image-container / .tab-content>.active : grilles fluides auto-fit (base). */

.nav {
    flex-direction: column;
    align-items: end;
}

.nav-tabs {
    font-size: small !important;
}

.two-playground-cols {
    flex-direction: column-reverse !important;
}

.editor-image-playground {
    grid-template-columns: repeat(1, 1fr) !important;
    width: 100% !important;
}

.editor-image-playground .input-group {
    width: auto !important;
    margin: auto !important;
}

.tab-content>.active {
    order: 1;
}

#modal-aiText-models-restriction,
#modal-aiText-rag-restriction {
    width: 90%;
}

/* Réserve l'espace du bottom-sheet replié pour ne rien cacher dessous. */
.rb-sheet-page #left-part {
    width: 100%;
    padding-bottom: var(--rb-peek) !important;
}

.rb-sheet-page #right-bar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 100%;
    max-height: calc(100vh - 55px);
    /* dvh accounts for the mobile browser chrome (address bar) that vh ignores,
       so the sheet's cap doesn't sit under it. Kept after the vh line so
       browsers without dvh support still get a value. */
    max-height: calc(100dvh - 55px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid var(--bg-3);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(calc(100% - var(--rb-peek)));
    transition: transform 1s cubic-bezier(0.67, 0.24, 0.69, 1.22);
    /* overflow-x: hidden; */
    overscroll-behavior: contain;
}

.rb-sheet-page #right-bar.is-open {
    transform: translateY(calc(var(--rb-peek) + 50px));
}

.rb-sheet-page #right-bar-content,
.rb-sheet-page.playground #right-bar-content,
.playground .rb-sheet-page #right-bar-content {
    /* height: auto !important; */
    height: calc(85vh - 2.2 * var(--rb-peek)) !important;
    height: calc(85dvh - 2.2 * var(--rb-peek)) !important;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 0;
    overscroll-behavior: contain;
}

.ig-zone {
    margin-bottom: 0 !important;
    border: none;
}

.rb-sheet-page #right-toggle-bar {
    display: none !important;
}

.rb-sheet-page .rb-sheet-grip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
    width: 100%;
    min-height: var(--rb-peek);
    padding: 0.55rem 0.9rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--text-0);
    font: inherit;
}

.rb-sheet-page .rb-sheet-grip .rb-sheet-bar {
    align-self: center;
    width: 42px;
    height: 5px;
    border-radius: 5px;
    background: var(--bg-3);
}

.rb-sheet-page .rb-sheet-grip .rb-grip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
}

.rb-sheet-page .rb-sheet-grip .rb-grip-row .rb-chev {
    margin-left: auto;
    color: var(--text-3);
    transition: transform 0.25s ease;
}

.rb-sheet-page #right-bar.is-open .rb-sheet-grip .rb-grip-row .rb-chev {
    transform: rotate(180deg);
}

think,
.thinkCompleted {
    max-width: 83%;
}

#ai-text-editor-form .action-bar {
    flex-wrap: nowrap;
    gap: 0.4rem;
    align-items: center;
    height: 36px;
}


#ai-text-editor-form .action-bar #ai-text-editor-submit,
#ai-text-editor-form .action-bar #ai-text-editor-stop,
#ai-text-editor-form .action-bar #send-message {
    flex: 1 1 auto;
}

#ai-text-editor-form .action-bar #ai-text-editor-submit .d-none,
#ai-text-editor-form .action-bar #ai-text-editor-stop .d-none,
#ai-text-editor-form .action-bar #send-message .d-none {
    display: inline !important;
}


/* ===== Restauration DESKTOP (≥768px) des valeurs d'origine surchargées en
   mobile-first ci-dessus. `revert` = retour à la valeur d'avant ce CSS (UA /
   héritée) là où aucune autre règle projet ne la fixe. ===== */
@media (min-width: 768px) {
    .models-parameters {
        font-size: medium;
    }

    /* .scrollbar { height: 25vh; } */

    .ai-text-instruction {
        font-size: revert;
        padding: 5px;
    }

    form small {
        display: revert;
        font-size: revert;
    }
    .nav {
        flex-direction: row;
        align-items: revert;
    }

    .nav-tabs {
        font-size: revert !important;
    }

    .two-playground-cols {
        flex-direction: row !important;
    }

    .editor-image-playground {
        grid-template-columns: repeat(2, 1fr) !important;
        width: 80% !important;
    }

    .editor-image-playground .input-group {
        width: 80% !important;
        margin: auto !important;
    }

    .tab-content>.active {
        order: 0;
    }

    #modal-aiText-models-restriction {
        width: 40%;
    }

    #modal-aiText-rag-restriction {
        width: 50%;
    }

    .rb-sheet-page #left-part {

        width: calc(100% - var(--right-bar-width));
        padding-bottom: 0 !important;
    }

    .rb-sheet-page #right-bar {
        top: auto;
        bottom: auto;
        left: auto;
        right: 0;
        width: min(var(--right-bar-width), 100vw);
        height: 100%;
        max-height: none;
        display: block;
        border: 5px solid var(--bg-3);
        border-radius: 0;
        box-shadow: none;
        transform: none;
        transition: none;
        overscroll-behavior: auto;
    }
    .conversation #right-bar-content {
    height: calc(100vh - 112px) !important;
}

    .rb-sheet-page #right-bar.is-open {
        transform: none;
    }

    .rb-sheet-page #right-bar-content {
        height: calc(100vh - 42px) !important;
        /* max-height: none !important; */
        margin-right: -3px;
        overscroll-behavior: auto;
    }
    .conversation #right-bar-content {
        height: calc(100vh - 112px) !important;
    }

    .ig-zone {
        margin-bottom: 1rem !important;
        border: 1px solid var(--bg-3);
    }

    .rb-sheet-page #right-toggle-bar {
        display: revert !important;
    }

    .rb-sheet-page .rb-sheet-grip {
        display: none;
    }

    think,
    .thinkCompleted {
        max-width: 90%;
    }

    #ai-text-editor-form .action-bar {
        gap: 0.5rem;
    }

    #ai-text-editor-form .action-bar {
        display: flex;
    }

    #ai-text-editor-form .action-bar #ai-text-editor-submit,
    #ai-text-editor-form .action-bar #ai-text-editor-stop,
    #ai-text-editor-form .action-bar #send-message {
        flex: 0 1 auto;
    }
}



@media (max-width: 768px) {
    .shepherd-element {
        width: 90% !important;
    }

    #container-for-quick-promts,
    #container-for-quick-promts-image {
        padding-bottom: 10px;
    }

    .shepherd-content {
        padding: 10px !important;
    }

    .step-by-step.text-step-3-description {
        max-height: 60vh !important;
        overflow-y: auto !important;
    }

    .shepherd-footer {
        justify-content: space-between !important;
    }

    .cropper-crop-box {
        aspect-ratio: initial !important;
        max-width: max-content !important;
        max-height: max-content !important;
    }
}

@media (max-width: 360px) {
    .nav-tabs {
        font-size: medium !important;
    }
}

/* finish mode chat */
.tokenIdCode {
    color: var(--text-0) !important;
    width: 15%;
    border-top: 1px solid var(--text-3);
    border-right: 1px solid var(--text-3);
    border-top-right-radius: 3px;
    border-right: ridge;
    border-top: ridge;
}

.token-user {
    border-top: solid var(--text-3) 1px;
    border-right: solid var(--text-3) 1px;
    border-right-style: ridge;
}

.token-and-tokenID {
    margin-top: 0;
    margin-bottom: 0;
    padding: var(--bs-dropdown-header-padding-y) var(--bs-dropdown-header-padding-x);
    font-weight: 600;
}

.active {
    color: var(--text-1);
}

.active.bg-prob-low {
    background-color: #ff959b;
}

.active.bg-prob-midlow {
    background-color: #f3c2bd;
}

.active.bg-prob-midhigh {
    background-color: #b6d992;
}

.active.bg-prob-high {
    background-color: #43db96;
}

button.token.bg-prob-transparent {
    --_bg: var(--ai-prob-transparent);
}

button.token.bg-prob-low {
    --_bg: var(--ai-prob-low);
}

button.token.bg-prob-low {
    --_bg: var(--ai-prob-low);
}

button.token.bg-prob-midlow {
    --_bg: var(--ai-prob-midlow);
}

button.token.bg-prob-midhigh {
    --_bg: var(--ai-prob-midhigh);
}

button.token.bg-prob-high {
    --_bg: var(--ai-prob-high);
}



.theme-dark button.token {
    --_opacity: 1;
    color: var(--bg-1);
}

.theme-dark .user-message-container button.token {
    color: var(--text-1);
    background-color: transparent !important;
    
}

.theme-dark .probtoken {
    color: var(--text-1);
    background: var(--vitta-grey-dark);
}

.theme-dark code {
    color: #f080b0;
}

.theme-dark .dropdown-item.active {
    color: var(--bg-5) !important;
}

.theme-dark .text-dark {
    background-color: transparent !important;
}


#content-container span.tokenID-message {
    cursor: text !important;
}

#content-container:not(.token-display) button.token {
    background-color: transparent !important;
    --_opacity: 0 !important;
}


#content-container button.token:disabled {
    cursor: text !important;
}

#content-container button.token:not(:disabled) {
    cursor: pointer !important;
}


#content-container:not(.token-display) button.token span {
    border: none !important;
    color: var(--text-0);
    cursor: text;
}

.theme-dark #content-container:not(.token-display) button.token span {
    color: var(--text-3) !important;
    background-color: transparent !important;
}

.theme-dark #content-container.token-display .user-message-container button.token span {
    color: var(--text-3) !important;
}

.theme-dark #ai-text-editor-form-container button {
    border-color: var(--text-3) !important;
}

.playground {
    height: calc(100vh - 45px);

}

.image-zoom-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.image-zoom {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom img {
    aspect-ratio: initial !important;
    max-height: 80vh !important;
    max-width: 80vw !important;
    height: auto !important;
    width: auto !important;
}

#image-container {
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(33%, 1fr));
    margin-bottom: 20px;
}

#ai-editor-image-prompt {
    min-height: 5rem;
}

.editor-negative-prompt {
    min-height: 4rem !important;
}

.wrappers-container {
    width: 100%;
    text-align: center;
}

.image-generated-wrapper {
    margin: 1rem;
    position: relative;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

#oneImage {
    align-items: center;
    width: 40%;
    height: 40%;
}

#oneImage img {
    display: block;
}

.image-generated-wrapper:hover .image-export-button,
.image-generated-wrapper:hover .play-pause-btn {
    display: flex;
}

.image-export-button,
.play-pause-btn {
    position: absolute;
    display: none;
    margin: 0;
    padding: 0;
    right: 0.1em;
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    border: none;
    background: var(--bg-5);
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.image-score {
    position: absolute;
    border-radius: 20%;
    background: #000000a3;
    padding: 2px;
    color: var(--bg-0);
    z-index: 100;
    transition: background-color 0.3s ease;
    top: 0.5em;
    right: 0.5em;
    padding-left: 5px;
    padding-right: 5px;


}

.image-export-button {
    top: 0.1em;
}

.play-pause-btn {
    bottom: 0.1em;
    width: 2em;
    height: 2em;

}

.generated-image-grid {
    width: 100%;
}

.gif-image {
    width: 100%;
}

.image-export-button img {
    width: 70%;
}

.image-export-button:hover {
    background-color: var(--text-1);
    cursor: pointer;
}

#container-for-quick-promts li,
#container-for-quick-promts-image li {
    list-style-type: none;
}

#ai-text-options .image-generated-wrapper {
    margin: auto;
    margin-top: 5.5em;
}

#balance-container {
    margin-top: -8px;
    min-height: auto;
}

#user-restrictions-container {
    background-color: var(--bg-2);
    width: calc(var(--right-bar-width) - 10px);
}

#balance-container .progress-balance-wrapper {
    border: 1px solid #d1d1d1;
    height: 15px;
}

.aspect-ratio-selector {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    background-color: var(--bg-2);
    border-radius: 12px;
    padding: 4px;
    border: none;
}

.aspect-ratio-selector input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.aspect-ratio-selector label {
    flex: 1;
    border: none;
    background-color: transparent;
    padding: 8px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-2);
    border-radius: 9px;
    margin: 0;
}

.aspect-ratio-selector input[type="radio"]:checked+label {
    background-color: var(--bg-0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: var(--vitta-green);
    font-weight: bold;
}

.aspect-ratio-selector input[type="radio"]:focus+label {
    outline: 2px solid var(--vitta-green);
    outline-offset: 2px;
}

.aspect-ratio-selector label .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.aspect-ratio-selector label .icon.rect {
    width: 11px;
    height: 18px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.aspect-ratio-selector label .icon.square {
    width: 15px;
    height: 15px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.aspect-ratio-selector label .icon.wide {
    width: 18px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.aspect-ratio-selector-dark {
    background-color: #808080 !important;
}

.aspect-ratio-selector-dark input[type="radio"]:checked+label {
    background-color: rgba(255, 255, 255, 0.123);
}

/* ============================================================
   PANNEAU PARAMÈTRES — bloc « Génération » (cf. maquette)
   ============================================================ */

/* En-tête de section repliable (image: #generation, texte: #parameters) */
.gen-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
}

.gen-head .gen-head-ico {
    color: var(--vitta-green);
    font-size: 1.05rem;
}

.embedding-text-link {
    font-size: 1rem;
    text-align: center;
    color: var(--text-2);
    text-decoration: underline;


}

.gen-head .export-button-text {
    margin: 0;
    font-size: 1rem;
    color: var(--text-0);

}

.gen-head .gen-head-chev {
    margin-left: auto;
    color: var(--text-3);
}

.generation-content {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: .4rem .5rem .2rem;
}

/* Champ générique (libellé + contrôle) */
.gen-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.gen-field-label {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text-0);
}

/* Carte modèle — cliquable en entier pour ouvrir la sélection de modèle */
.gen-model-card {
    display: flex;
    align-items: center;
    gap: .7rem;
    border: 1px solid var(--bg-3);
    border-radius: 14px;
    background: var(--bg-0);
    padding: .6rem;
    cursor: pointer;
}

.gen-model-card:hover {
    border-color: var(--vitta-green);
}

.gen-model-card:focus-visible {
    outline: 2px solid var(--vitta-blue);
    outline-offset: 2px;
}

.gen-model-thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.3rem;
}

.gen-model-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 4px;
}

.gen-model-thumb i {
    padding: 0 !important;
}

.gen-model-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.gen-model-name-row {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.gen-model-card #model-selected {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent !important;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-0);
    line-height: 1.2;
}

.gen-model-card .ai-element-selection,
.gen-model-card #model-selected span {
    width: auto;
    border: none;
    background: transparent !important;
    background-image: none;
    padding: 0;
    font-weight: 700;
    color: var(--text-0);
    line-height: 1.2;
}

.gen-model-badge {
    flex: 0 0 auto;
    font-size: .72rem;
    color: #fff;
    background: var(--vitta-green);
    border-radius: 6px;
    padding: .05em .5em;
    font-weight: 600;
    white-space: nowrap;
}

.gen-model-badge:empty {
    display: none;
}

.gen-model-badge--premium {
    background: var(--vitta-orange);
}

.gen-model-sub {
    font-size: .78rem;
}

/* Bloc slider « Guidage » avec repères */
.gen-slider-block {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.gen-slider-head {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.icone-info {
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

#right-bar .fa-circle-question {
    color: var(--text-3);
    font-size: .85rem;
}

.gen-slider-value {
    margin-left: auto;
    font-size: .82rem;
    /* --text-3 fails 4.5:1 for this readout's text; --text-2 clears it. */
    color: var(--text-2);
}

.gen-range {
    width: 100%;
    accent-color: var(--vitta-green);
}


/* Contrôle segmenté « Sortie » (réutilise le switcher existant) */
.gen-switcher.switcher {
    position: relative;
    display: flex;
    width: 100%;
    gap: 4px;
    background: var(--bg-2);
    border-radius: 12px;
    padding: 4px;
}

.gen-switcher .switcher__toggle {
    display: none;
}

.gen-switcher .switcher__label {
    flex: 1;
    margin: 0;
    text-align: center;
    border-radius: 9px;
    font-size: .9rem;
    color: var(--text-2);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.gen-switcher .switcher__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.gen-switcher .switcher__input:checked+.switcher__label {
    background: var(--bg-1);
    color: var(--vitta-green);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.gen-switcher .switcher__input:focus+.switcher__label {
    outline: 2px solid var(--vitta-green);
    outline-offset: 2px;
}

.ai-mode-toggle-container .gen-switcher {
    gap: 4px;
}

.ai-mode-toggle-container .gen-switcher .switcher__label {
    width: auto !important;
}

.ai-mode-toggle-container .gen-switcher .switcher__toggle {
    display: none;
}

.blur {
    filter: blur(10px);
}

textarea {
    margin-bottom: 10px;
}

.ai-element-selection {
    border: 1px solid var(--vitta-green);
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-1);
    text-align: left;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6' /%3e%3c/svg%3e");
    background-color: var(--bg-1) !important;
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 1.2em;
    width: 100%;
    padding: 10px 38px 10px 12px;
}

.ai-element-selection:focus {
    outline: 2px solid var(--vitta-blue);
    outline-offset: 2px;
}

#best-images-container .ai-element-selection {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6' transform='rotate(-90 8 8)' /%3e%3c/svg%3e");
    background-position: left .75rem center;
    border: none !important;
    font-size: 1.2rem;
    padding: 10px 12px 10px 38px;
}

#best-images-container .opened {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6' /%3e%3c/svg%3e") !important;
    background-position: left .75rem top .75rem !important;
    padding: 10px 10px 10px 38px;
}

.theme-dark .probs-wrapper .btn {
    background-color: var(--vitta-grey-dark) !important;
    color: var(--text-1) !important;
}

.asset-trophy {
    position: absolute;
    margin: 0;
    padding: 0;
    right: 0.5em;
    top: -0.5em;
    width: 1.5em;
    height: 2.5em;
    border-radius: 50%;
    border: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#image-to-use-in-Adacraft {
    aspect-ratio: initial;
    max-width: min-content;
    max-height: 20rem;
    width: 100%;
    border-radius: 10px;
}

.vitta-modal-content-container {
    max-height: 80vh !important;
}

/*----- rag ------------------ */
.import-source-block {
    margin: 20px auto;
}

.import-source-block p {
    margin-top: 0;
    color: var(--text-0);
}

.import-rag-option {
    margin-bottom: 15px;
}

.import-rag-option label {
    min-width: 150px;
    align-items: center;
    color: var(--text-0);

}

.import-rag-option input,
.import-rag-option textarea {
    border: none;
    flex-grow: 1;
    font-size: 16px;
    color: var(--text-1);
    margin: 0 !important;
    line-height: normal;
    margin-left: 5px !important;
}

.import-rag-option textarea {
    height: 250px;
}


.item-rag {
    display: flex;
    border: 1px solid var(--text-3);
    border-radius: 5px;
    overflow: hidden;
    align-items: baseline;
    align-content: flex-end;
    justify-content: space-evenly;
    height: 40px;
}

.textarea-input {
    height: auto;
}

.counter {
    font-size: 14px;
    color: var(--text-1);
}

.item-rag input[type="file"] {
    display: none;
}

.item-rag input[type="url"]:focus,
.item-rag textarea:focus {
    border: none;
    outline: none;
}

.item-rag input[type="text"] {
    margin-left: 5px !important;
}

.custom-file-label {
    background-color: var(--bg-3);
    color: var(--text-0);
    padding: 8px 12px;
    cursor: pointer;
    border-right: 1px solid var(--text-3);
    height: 40px;

}

.custom-text-label {
    background-color: var(--bg-3);
    color: var(--text-0);
    padding: 8px 12px;
    cursor: pointer;
    border-right: 1px solid var(--text-3);
    height: 250px;

}

#file-name {
    flex-grow: 1;
    padding: 8px;
    font-size: 16px;
    color: var(--text-1);
}


.source-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    justify-content: space-between;
    margin-right: 5px;

}

.source-item button {
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.source-item button img {
    filter: brightness(0.5);
}

.source-item button:hover {
    border: 1px solid var(--vitta-grey);
}

.source-item button img {
    width: 15px;
}

#source-upload-button {
    margin: 10px auto;
    width: 100%;

}

.source-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 220px;
}

.source-name:hover {
    cursor: pointer;

}

.numSource {
    border-radius: 10px;
    z-index: 10;
    font-size: medium;
    background: var(--vitta-grey-dark);
    color: var(--bg-0);
    font-size: smaller;
    cursor: pointer;
    padding: 5px 8px;
    border: none;
    margin-inline: 4px;
}

.numSource p {
    display: inline;
}

.tooltipNumSource {
    min-width: 250px !important;
    max-width: 370px;
    height: 300px;
    overflow-y: scroll;
    background: var(--bg-1);
    color: var(--text-0);

}

.tooltipNumSource .dropdown-header {
    max-width: 250px;
    cursor: pointer;
}

.tooltipNumSource strong {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/*brogress-bar */
.progress-container {
    width: 90%;
    background-color: var(--bg-3);
    border-radius: 25px;
    margin: auto;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    width: 10%;
    background-color: #4caf50;
    text-align: center;
    line-height: 30px;
    color: white;
    border-radius: 25px;
}

#pop-up-wait {
    background: var(--vitta-grey-dark);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: medium;
}

/* modal source rag separator */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    width: 100%;

}

.separator::before,
.separator::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background-color: var(--text-3);
}

.separator span {
    padding: 0 10px;
    font-weight: bold;
    color: var(--text-1);
}

.tooltip-wide .tooltip-inner {
    max-width: 380px;
    text-align: left;
}

.visibility-error-popover {
    --bs-popover-bg: var(--vitta-red-light);
    --bs-popover-border-color: var(--vitta-red-light);
    --bs-popover-body-color: #fff;
    --bs-popover-max-width: 300px;
    z-index: 1080;
}

.visibility-error-popover .popover-body {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ── Embeddings visualisation modal (modal-aiText-embeddings-reset) ──────────
   The viz itself is a bundled React app (ia/assets/js/main/embedding/assets)
   with its own responsive stylesheet; these rules only keep its host (#root /
   .app) inside the modal bounds. Mobile-first: the app fills the modal width
   and a viewport-relative height that fits within the modal's max-height, so it
   no longer overflows on phones (the bundled CSS otherwise forces 100vh ≤768px).
   The id+class specificity here intentionally out-ranks the bundled .app rules. */
#modal-aiText-embeddings-reset #root {
    width: 100%;
}

#modal-aiText-embeddings-reset .app {
    width: 100%;
    height: 60vh;
    height: 60dvh;
}

@media (min-width: 768px) {
    #modal-aiText-embeddings-reset .app {
        height: 65vh;
        height: 65dvh;
    }
}

/* ── Tooltips Bootstrap sur appareils tactiles ───────────────────────────────
   Les tooltips se déclenchent par défaut sur `hover focus`. Sur tactile il n'y
   a pas de survol : un simple tap (signaler, modération, fermer le modal…) donne
   le focus au bouton, ce qui affiche le tooltip qui reste ensuite ouvert sans
   avoir été demandé. Comme un tooltip n'a de sens qu'au survol, on les masque
   sur les pointeurs grossiers (tactile). Les .popover (déclenchés au clic) ne
   sont pas concernés. */
@media (hover: none) {
    .tooltip.show {
        display: none !important;
    }

    .tooltip.tooltip-touch-visible.show {
        display: block !important;
        opacity: var(--bs-tooltip-opacity, 0.9) !important;
    }
}