/* ==========================================================================
   components.css — les éléments de l'interface
   ==========================================================================
   Onglets, boutons, sélecteurs (modèle, couleurs), pop-ups, cartes, champs
   de saisie, liste des CV sauvegardés, tailles de police, résultats
   d'analyse. Jamais de règle sur la feuille du CV (cv.css) ni sur les outils
   posés dessus (affordances.css).

   Design system « Néomorphisme » (tokens.css) : tout est taillé dans la même
   matière (--surface). En relief (ombre sombre en bas à droite, blanche en
   haut à gauche) ce sur quoi on agit, en creux ce dans quoi on écrit. Pas de
   bordure : seul le relief découpe les zones. */

@layer components {

/* ---------- Boutons ----------
   Tout <button> de l'interface est un bouton en relief. Les boutons posés
   sur la feuille (✕ ↑ ↓, « + Ajouter… », « + Photo », « … tirets masqués »)
   en sont exclus : ce sont des affordances (affordances.css), qui ne doivent
   jamais prendre la place ni la hauteur d'un bouton d'interface. :where()
   garde la règle sans spécificité : chaque variante ci-dessous l'emporte.

   Le dégradé diagonal (20 / 60 / 20 %) va de --g0 (haut gauche) à --g1 (bas
   droit) : chaque variante ne change que ces deux couleurs. Sans classe, un
   bouton est l'action principale de sa zone (plein, accent). */
:where(button:not(.icon-btn, .add-bullet, .add-exp, .add-edu, .add-project, .add-link,
  .add-contact, .add-group, .add-interest, .photo-placeholder, .bullet-more, .qr-add, .kcard-main, .st-chip, .pop-item, .app-cv-link)) {
  --g0: var(--accent-fill-start);
  --g1: var(--accent-fill-end);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--on-accent);
  background: linear-gradient(to bottom right,
    var(--g0) 0%,
    color-mix(in srgb, var(--g0) 56%, var(--g1)) 20%,
    color-mix(in srgb, var(--g0) 44%, var(--g1)) 80%,
    var(--g1) 100%);
  border: 0;
  border-radius: var(--radius-14);
  box-shadow: var(--raised-fill);
  cursor: pointer;
  transition:
    box-shadow calc(var(--neo-t) * 0.526),
    color calc(var(--neo-t) * 0.526),
    filter calc(var(--neo-t) * 0.526);
}

:where(button:not(.icon-btn, .add-bullet, .add-exp, .add-edu, .add-project, .add-link,
  .add-contact, .add-group, .add-interest, .photo-placeholder, .bullet-more, .qr-add, .kcard-main, .st-chip, .pop-item, .app-cv-link)):hover {
  filter: brightness(1.07);
}

:where(button:not(.icon-btn, .add-bullet, .add-exp, .add-edu, .add-project, .add-link,
  .add-contact, .add-group, .add-interest, .photo-placeholder, .bullet-more, .qr-add, .kcard-main, .st-chip, .pop-item, .app-cv-link)):active {
  box-shadow: var(--pressed-fill);
}

/* display: inline-flex ci-dessus l'emporterait sur l'attribut hidden
   (feuille du navigateur) : on rétablit explicitement le masquage. */
button[hidden] { display: none; }

/* Bouton neutre : même matière que la page, libellé en accent. */
button.ghost {
  --g0: var(--surface-btn-start);
  --g1: var(--surface-btn-end);
  color: var(--accent);
  box-shadow: var(--raised-md);
}

button.ghost:hover { color: var(--accent-strong); filter: none; }

button.ghost:active {
  background: var(--surface);
  box-shadow: var(--inset-md);
}

/* Action destructrice : jamais de fond rouge, seulement son libellé. */
button.ghost.danger { color: var(--danger); }

/* Bouton de confirmation d'une action destructrice dans la boîte de dialogue
   générique (ex. suppression). Scopé par id : un simple « .danger » entrerait
   en conflit avec les boutons « ghost danger » (Réinitialiser, Supprimer…).
   Neutre en relief, libellé rouge : le design system ne remplit jamais de
   rouge. */
#confirmOkBtn.danger {
  --g0: var(--surface-btn-start);
  --g1: var(--surface-btn-end);
  color: var(--danger);
  box-shadow: var(--raised-md);
}

#confirmOkBtn.danger:hover { filter: none; color: #861d1d; }
#confirmOkBtn.danger:active { background: var(--surface); box-shadow: var(--inset-md); }

/* « Annuler » des pop-ups : neutre, libellé dans l'encre des boutons. */
button.cancel {
  --g0: var(--surface-btn-start);
  --g1: var(--surface-btn-end);
  color: var(--ink-body);
  box-shadow: var(--raised-md);
}

button.cancel:hover { color: var(--ink-hover); filter: none; }
button.cancel:active { background: var(--surface); box-shadow: var(--inset-md); }

/* ---------- Onglets « Mon profil » / « Nouveau CV » / « Mes CVs » ----------
   Une dalle en relief, polie (reflet en haut à gauche) ; l'onglet actif y est
   enfoncé. L'enfoncement est porté par deux pseudo-éléments flous (bords
   doux), le léger rétrécissement par transform : rien ne bouge autour. */

.tabs {
  --rout: var(--radius-28);
  --pad: 12px;
  --rin: max(0px, calc(var(--rout) - var(--pad)));
  position: relative;
  isolation: isolate;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: var(--pad);
  border-radius: var(--rout);
  background: var(--surface);
  box-shadow: var(--raised-nav);
}

.tabs::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 140% at 14% 0%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.3), rgba(163, 173, 194, 0.22));
}

.tab-btn {
  position: relative;
  isolation: isolate;
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink-muted);
  background: transparent;
  border-radius: var(--rin);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform: scale(1);
  transition:
    transform calc(var(--neo-t) * 2.2) cubic-bezier(0.3, 1.7, 0.5, 1),
    color var(--neo-t) ease;
}

.tab-btn::before,
.tab-btn::after {
  content: '';
  position: absolute;
  inset: calc(var(--neo-ef) * 0.5);
  z-index: -1;
  border-radius: max(0px, calc(var(--rin) - var(--neo-ef) * 0.5));
  pointer-events: none;
  filter: blur(calc(var(--neo-ef) * 0.3));
}

.tab-btn::before {
  box-shadow: inset 0 0 0 rgba(163, 173, 194, 0), inset 0 0 0 rgba(255, 255, 255, 0);
  transition: box-shadow calc(var(--neo-t) * 1.6) cubic-bezier(0.2, 0.8, 0.3, 1);
}

.tab-btn::after {
  opacity: 0;
  background:
    radial-gradient(ellipse closest-side at 50% 50%, rgba(120, 133, 160, 0.3) 0%, rgba(140, 153, 180, 0.2) 38%, rgba(163, 173, 194, 0.07) 78%, rgba(163, 173, 194, 0) 100%),
    linear-gradient(145deg, rgba(120, 133, 160, 0.2), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.3));
  transition: opacity calc(var(--neo-t) * 1.4) ease;
}

.tab-btn:hover { filter: none; }
.tab-btn:not(.active):hover { color: var(--ink); }
.tab-btn:active { box-shadow: none; }

.tab-btn.active { color: var(--accent-strong); }

.tab-btn.active,
.tab-btn:active {
  transform: scale(0.965);
  transition:
    transform calc(var(--neo-t) * 0.9) cubic-bezier(0.2, 0.9, 0.3, 1),
    color var(--neo-t) ease;
}

.tab-btn.active::before,
.tab-btn:active::before {
  box-shadow: var(--inset-tab);
  transition: box-shadow calc(var(--neo-t) * 0.9) cubic-bezier(0.2, 0.9, 0.3, 1);
}

.tab-btn.active::after,
.tab-btn:active::after { opacity: 1; }

/* ---------- Historique (annuler / rétablir) ----------
   Boutons ronds en icône, calés contre le bord droit de la barre au-dessus
   du CV. */
.history-ctl {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

button.icon-btn-history {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink-body);
}

button.icon-btn-history svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- État vide de l'onglet « Nouveau CV » ----------
   Prend la place de la feuille CV tant qu'aucun CV n'a été créé (voir
   updateTabs/showCvInCreateTab, app.js). Centré comme un point de départ,
   pas comme un simple panneau d'information. */
#createEmptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 300px;
  justify-content: center;
  text-align: center;
}

#createEmptyState .hint { max-width: 46ch; margin: 0 0 6px; }

/* display: flex ci-dessus l'emporterait sur [hidden] (même spécificité,
   déclaré avant) : on rétablit explicitement le masquage, comme pour les
   autres blocs à display non-initial de l'application (.photo-crop-empty…). */
#createEmptyState[hidden] { display: none; }

/* ---------- Segment Design / Pro ----------
   Un creux ; un curseur en relief (.seg-thumb) y glisse sous le modèle
   choisi. --i est l'index du bouton actif, déduit de la classe .active posée
   par app.js. */
.seg {
  --pad: 5px;
  --rout: var(--radius-18);
  --rin: max(0px, calc(var(--rout) - var(--pad)));
  --n: 2;
  --i: 0;
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: var(--pad);
  border-radius: var(--rout);
  background: var(--surface);
  box-shadow: var(--inset-md);
}

.seg:has(.seg-btn ~ .seg-btn.active) { --i: 1; }

.seg-thumb {
  position: absolute;
  top: var(--pad);
  bottom: var(--pad);
  left: var(--pad);
  width: calc((100% - var(--pad) * 2) / var(--n));
  border-radius: var(--rin);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform calc(var(--neo-t) * 0.789) cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Tant qu'aucun modèle n'est marqué actif (premier rendu), pas de curseur. */
.seg:not(:has(.seg-btn.active)) .seg-thumb { display: none; }

.seg-btn {
  position: relative;
  z-index: 1;
  min-height: 44px;
  padding: 0 26px;
  font-size: 15px;
  color: var(--ink-muted);
  background: transparent;
  border-radius: var(--rin);
  box-shadow: none;
  transition: color calc(var(--neo-t) * 0.658);
}

.seg-btn:hover { filter: none; color: var(--ink); }
.seg-btn:active { box-shadow: none; }

.seg-btn.active,
.seg-btn.active:hover { color: var(--accent); }

/* ---------- Couleur du bandeau et des titres ---------- */

.side-color {
  position: relative; /* ancre l'encadré de couleur libre sous la pipette */
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Masqué sur le modèle « pro », qui n'a pas de bandeau */
.side-color[hidden] { display: none; }

/* Étiquette en capitales espacées (« Bandeau », « Titres »). */
.side-color-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.title-color {
  position: relative; /* ancre l'encadré de couleur libre quand il sert aux titres */
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Menu déroulant creux, flèche dessinée (le natif est masqué). */
.title-color select,
.ai-onboarding-source-row select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 40px 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background:
    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='%234a566b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 16px center,
    var(--surface);
  border: 0;
  border-radius: var(--radius-14);
  box-shadow: var(--inset-md);
  cursor: pointer;
}

.title-color[hidden] { display: none; }

.swatches {
  display: flex;
  gap: 8px;
}

/* Pastille de couleur : un bouton rond en relief, la teinte en point central
   (pseudo-élément). Choisie, elle s'enfonce et le point prend un anneau. */
.swatch,
.swatch-custom {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 0;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--raised-sm);
}

.swatch::before,
.swatch-custom::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--swatch, #000);
  transition: box-shadow calc(var(--neo-t) * 0.526);
}

.swatch-custom::before {
  position: absolute;
  background: var(--swatch, var(--surface-chip));
}

.swatch:hover,
.swatch-custom:hover { filter: none; }

.swatch-custom[hidden] { display: none; }

.swatch:active,
.swatch-custom:active,
.swatch.active,
.swatch-custom.active { box-shadow: var(--inset-sm); }

.swatch.active::before,
.swatch-custom.active::before {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--accent);
}

/* Dernières couleurs utilisées : séparées de la palette fixe par un sillon,
   invisibles tant qu'aucune couleur libre n'a été employée */
.swatches-recent:not(:empty) {
  padding-left: 12px;
  box-shadow: inset 1px 0 0 var(--shadow-dark), inset 2px 0 0 var(--shadow-light);
}

/* Icône pipette par-dessus la couleur courante : blanche avec un liseré
   sombre, lisible sur toute teinte. Ne capte pas les clics. */
.swatch-custom .pipette-icon {
  position: relative;
  width: 12px;
  height: 12px;
  fill: #fff;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* ---------- Encadré de couleur libre ----------
   Ouvert par la pipette : sélecteur de couleur maison + « OK ». (Le
   sélecteur natif du navigateur ne peut pas accueillir de bouton.) */
.color-popover {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 260px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-24);
  box-shadow: var(--raised-xl);
}

.color-popover[hidden] { display: none; }

/* Zone de nuances : blanc → teinte en X, transparent → noir en Y */
.cp-sv {
  position: relative;
  height: 130px;
  border-radius: var(--radius-14);
  cursor: crosshair;
  touch-action: none; /* le glisser ne doit pas faire défiler la page */
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--cp-hue, 0), 100%, 50%));
  box-shadow: var(--inset-sm);
}

.cp-sv-cursor {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cp-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

button.cp-eyedrop {
  --g0: var(--surface-btn-start);
  --g1: var(--surface-btn-end);
  flex: none;
  width: 34px;
  min-height: 0;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  box-shadow: var(--raised-sm);
}

button.cp-eyedrop:hover { filter: none; }
button.cp-eyedrop:active { background: var(--surface); box-shadow: var(--inset-sm); }

.cp-eyedrop svg {
  width: 15px;
  height: 15px;
  fill: var(--ink-body);
}

.cp-preview {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--surface), var(--raised-sm);
}

/* Curseur de teinte : piste arc-en-ciel enfoncée, poignée ronde */
#cpHue {
  flex: 1;
  min-width: 0;
  height: 12px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-full);
  background: linear-gradient(to right,
    #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#cpHue::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: hsl(var(--cp-hue, 0), 100%, 50%);
  box-shadow: 2px 2px 4px var(--shadow-dark);
}

#cpHue::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: hsl(var(--cp-hue, 0), 100%, 50%);
  box-shadow: 2px 2px 4px var(--shadow-dark);
}

/* Champs R / G / B */
.cp-rgb {
  justify-content: space-between;
}

.cp-rgb label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

/* Champ HEX, sur toute la largeur sous R/G/B */
.cp-hex label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  /* Sans cela, la taille minimale du champ (size par défaut ≈ 20 caractères)
     empêche le libellé de rétrécir et le champ déborde de l'encadré. */
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

.cp-rgb input { width: 62px; text-align: center; }

.cp-hex input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}

.color-popover #sideColorOkBtn { align-self: stretch; }

/* ---------- Champs creux ----------
   On écrit dans un creux : même matière que la page, ombre intérieure.
   Champs compacts (36px) dans les réglages, pleins (44px) ailleurs. */

#jobText,
.ai-response-textarea,
.current-cv input,
input.version-rename,
.proposal-save-row input,
.link-field input,
.cp-rgb input,
.cp-hex input,
.fs-input {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-14);
  box-shadow: var(--inset-md);
}

.current-cv input,
.proposal-save-row input,
.link-field input {
  min-height: 44px;
  padding: 0 16px;
}

.cp-rgb input,
.cp-hex input,
.fs-input {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-10);
  box-shadow: var(--inset-sm);
}

#jobText,
.ai-response-textarea {
  display: block;
  width: 100%;
  padding: 14px 18px;
  line-height: 1.5;
  border-radius: var(--radius-18);
  resize: vertical;
}

/* Réponse JSON d'un chatbot : en chasse fixe. Le texte d'exemple, lui, reste
   dans la police de l'interface. */
.ai-response-textarea {
  font-family: var(--font-mono);
  font-size: 13px;
}

.ai-response-textarea::placeholder { font-family: var(--font-ui); }

:is(#jobText, .ai-response-textarea, .current-cv input,
input.version-rename, .proposal-save-row input,
  .link-field input, .cp-rgb input, .cp-hex input, .fs-input)::placeholder {
  color: var(--ink-placeholder);
  opacity: 1;
}

/* ---------- Pop-ups in-app (photo, lien, confirmation…) ---------- */

/* Fond + carte, partagés par toutes les pop-ups de l'application. */
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 40, 55, 0.45);
}

.app-modal[hidden] { display: none; }

/* Posée sur un voile sombre, la carte ne peut pas jouer du reflet blanc :
   elle garde la matière et une ombre portée simple. */
.app-modal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 360px;
  max-width: 100%;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-28);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.35);
}

.app-modal-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.app-modal-hint {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Message de la boîte de confirmation générique : plus lisible que
   .app-modal-hint, c'est ici le seul contenu de la pop-up. */
.app-modal-message {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-body);
}

.app-modal-actions {
  display: flex;
  flex-wrap: wrap; /* trois boutons (ex. photo) ne tiennent pas toujours sur une ligne */
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
}

.app-modal-actions-right {
  display: flex;
  gap: 14px;
  margin-left: auto; /* reste calé à droite même quand il passe sous le bouton de gauche */
}

.app-modal-actions button { white-space: nowrap; }

/* La confirmation peut porter trois boutons (Annuler / Ne pas sauvegarder /
   Sauvegarder et remplacer) : carte plus large pour les garder sur une ligne,
   retour à la ligne des boutons (pas de leurs libellés) sur écran étroit. */
#confirmModal .app-modal-card { width: 580px; }
#confirmModal .app-modal-actions-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* --- Pop-up de choix du point de départ (« Créer un nouveau CV ») ---
   Plus large que la carte par défaut : elle doit accueillir le nom de chaque
   CV sauvegardé sans le tronquer à outrance. */
.create-choice-card { width: 460px; }

.create-choice-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 50vh;
  overflow-y: auto;
  /* Marge intérieure pour que l'ombre et l'anneau de focus des options (qui
     touchent les bords de la liste) ne soient pas rognés par overflow ;
     compensée en négatif pour ne rien déplacer. */
  padding: 10px 14px 32px 10px;
  margin: -10px -14px -32px -10px;
  /* Une liste qui défile se fond vers le bas au lieu d'être coupée net ; la
     marge du bas laisse le dernier élément sortir du fondu une fois la liste
     déroulée jusqu'au bout. */
  mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent);
}

button.create-choice-option {
  --g0: var(--surface-btn-start);
  --g1: var(--surface-btn-end);
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 18px;
  color: var(--ink);
  text-align: left;
  border-radius: var(--radius-16);
  box-shadow: var(--raised-sm);
}

button.create-choice-option:hover { filter: none; }
button.create-choice-option:hover .create-choice-name { color: var(--accent); }
button.create-choice-option:active { background: var(--surface); box-shadow: var(--inset-sm); }

.create-choice-name { font-weight: 700; font-size: 15px; color: var(--ink); }

.create-choice-hint { font-size: 13px; font-weight: 500; color: var(--ink-muted); }

/* --- Pop-up de la photo de profil (recadrage / centrage) --- */

/* Cadre de recadrage : un creux rond, image déplaçable au glisser, débord
   masqué. */
.photo-crop {
  position: relative;
  align-self: center;
  width: 260px;
  height: 260px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--inset-lg);
  cursor: grab;
  touch-action: none; /* le glisser ne doit pas faire défiler la page */
  user-select: none;
}

.photo-crop.dragging { cursor: grabbing; }

/* Retour visuel pendant le survol d'un fichier à déposer. */
.photo-crop.drop-over {
  box-shadow: inset 0 0 0 3px var(--accent), var(--inset-lg);
}

.photo-crop img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none; /* les tailles sont imposées en pixels par app.js */
  pointer-events: none;
  user-select: none;
}

.photo-crop-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--ink-muted);
}

/* Les règles display: flex ci-dessus/dessous priment sur l'attribut hidden :
   on rétablit explicitement le masquage. */
.photo-crop-empty[hidden],
.photo-zoom[hidden] { display: none; }

.photo-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 15px;
}

.photo-zoom input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}

/* --- Pop-up d'adresse de lien --- */

.link-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.link-field input {
  letter-spacing: normal;
  text-transform: none;
}

/* ---------- Avis au-dessus de la feuille ---------- */

/* Dépassement de page (modèle « design ») : rempli par app.js. Une note
   enfoncée, libellé rouge (jamais de fond rouge). */
#overflowNotice {
  margin: 0 0 18px;
  padding: 12px 18px;
  border-radius: var(--radius-14);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}

/* Le CV affiché est encore l'exemple (onglet « Mes CVs »), rempli par
   index.html / app.js (updateExampleMarkers). Une note enfoncée, neutre. */
#exampleNotice {
  margin: 0 0 18px;
  padding: 12px 18px;
  border-radius: var(--radius-14);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
#exampleNotice[hidden] { display: none; }

/* Nombre de pages A4 (modèle « pro »), rempli par app.js. */
#pageCount {
  margin: 0 0 18px;
  padding: 10px 18px;
  border-radius: var(--radius-14);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

/* ---------- Cartes ---------- */

#versionsPanel {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.panel-box {
  padding: 28px 30px 30px;
  border-radius: var(--radius-28);
  background: var(--surface);
  box-shadow: var(--raised-2xl);
}

.panel-box h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

/* Export/import complet puis réinitialisation totale : tout en bas de
   l'onglet « Mon profil », loin des autres actions (voir index.html
   #dataPanel et libExportBtn/libImportFile/resetBtn dans app.js). La
   réinitialisation (destructrice) est isolée sous un sillon pour ne pas se
   lire comme une suite de l'export/import. */
.data-panel-reset-hint {
  margin: 28px 0 14px;
  padding-top: 22px;
  box-shadow: var(--groove);
}

.panel-box .hint {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.panel-box .hint strong { color: var(--ink); font-weight: 700; }

/* Rappel important (onglet « Mon profil ») : rien n'est stocké dans le
   cloud. Une note : triangle ambre en tête, texte dans l'encre des notes —
   pas un encadré d'erreur, juste un rappel (voir libIntro dans index.html). */
.hint.hint-important {
  position: relative;
  padding-left: 30px;
  color: var(--ink-body);
}

.hint.hint-important::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  background: var(--warning);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 3.9 1.8 18.4A2 2 0 0 0 3.5 21.4h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0ZM12 9a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Zm0 8.3a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.3 3.9 1.8 18.4A2 2 0 0 0 3.5 21.4h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0ZM12 9a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Zm0 8.3a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Parcours « Remplir avec l'IA » : une carte comme les autres. */
.ai-onboarding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-onboarding-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-chip);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.ai-onboarding-privacy {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.ai-onboarding-source-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
}

.ai-onboarding-source-row select {
  flex: 1;
  min-width: 100px;
}

.ai-onboarding-source-row button { flex: none; }

.ai-onboarding-actions { align-items: center; margin-bottom: 0; }
/* Sur écran étroit, c'est le statut qui passe à la ligne, jamais le libellé
   du bouton (sinon « Remplir mon profil » s'écrase sur trois lignes). */
.ai-onboarding-actions button { flex: none; }
.ai-onboarding-status { font-size: 13px; color: var(--success); font-weight: 700; }
.ai-onboarding-status.error { color: var(--danger); }

/* Étape 2 « Comment adapter votre CV ? » : deux cartes-onglets (radiogroup),
   une seule dépliée. La carte ouverte est creuse (on y saisit), la fermée en
   relief (on la choisit). */
.method-cards { display: flex; flex-direction: column; gap: 16px; }

.method-card {
  border-radius: var(--radius-24);
  background: var(--surface);
  box-shadow: var(--raised-sm);
}

.method-card.open { box-shadow: var(--inset-md); }

.method-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 16px 14px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: var(--radius-24);
  box-shadow: none;
  cursor: pointer;
}

.method-head:hover { filter: none; background: var(--surface-hover); }
.method-head:active { box-shadow: none; }
.method-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.method-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-strong);
}

/* Pastille de choix, façon radio. */
.method-title::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  box-shadow: var(--inset-sm);
}

.method-head[aria-checked='true'] .method-title::before {
  background: radial-gradient(circle, var(--accent) 0 38%, transparent 42%);
}

.method-sub {
  padding-left: 24px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-muted);
}

.method-body { padding: 4px 14px 16px; }
.method-body[hidden] { display: none; }
.method-body > :first-child { margin-top: 0; }

.method-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }

.method-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.method-step-title label { font: inherit; color: inherit; }

.method-step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface-chip);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.ai-copy-row { margin: 0; }

/* Infobulle sur l'enveloppe d'un bouton désactivé (qui ne reçoit pas le survol) :
   visible au survol ou au focus de l'enveloppe, tant que .tip-on est posé. */
.tip-wrap { position: relative; display: inline-block; border-radius: var(--radius-16); }
.tip-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.tip-wrap .tip {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translate(-50%, -4px);
  z-index: 5;
  width: max-content;
  max-width: min(260px, 80vw);
  padding: 8px 14px;
  border-radius: var(--radius-14);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease, visibility 0s .15s;
}
.tip-wrap.tip-on:hover .tip,
.tip-wrap.tip-on:focus .tip {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) { .tip-wrap .tip { transition: none; } }
.ai-prompt-summary { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
/* L'infobulle s'ouvre par-dessus cette ligne, qui dit la même chose : on la
   masque le temps du survol plutôt que de la laisser dépasser sous la bulle. */
.ai-copy-row:has(.tip-wrap.tip-on:hover, .tip-wrap.tip-on:focus) + .ai-prompt-summary { visibility: hidden; }
.ai-prompt-summary.error { color: var(--danger); font-weight: 700; }
.ai-prompt-preview { margin-top: 8px; font-size: 13px; color: var(--accent); }
.ai-prompt-preview[hidden] { display: none; }
.ai-prompt-preview summary { cursor: pointer; font-weight: 700; }
.ai-prompt-preview pre {
  max-height: 220px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.5 var(--font-mono);
  color: var(--ink-body);
  border-radius: var(--radius-14);
  box-shadow: var(--inset-sm);
}

.ai-onboarding-source-row { margin-bottom: 14px; }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0 4px;
}

/* Résultat de « Remplir la page » (panneau Taille des textes), avec son
   lien « Annuler ». Même note enfoncée que #pageCount. */
#fillStatus {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-14);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

#fillStatus button.link-btn { min-height: 28px; margin-left: 2px; vertical-align: baseline; }

/* ---------- CV en cours + CV enregistrés ---------- */

/* Carte « CV en cours » : nom (modifiable), état, puis l'unique action
   « Enregistrer ». Champ creux (on y tape), boutons en relief. */
.current-cv {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.current-cv input { width: 100%; min-width: 0; }

/* L'état se lit sans la couleur seule : texte + coche / point. */
.version-status {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
}

.version-status.clean { color: var(--success); }

.version-status.dirty { color: var(--warning); }

.version-status.dirty::before {
  content: '● ';
  font-size: 10px;
  vertical-align: 1px;
}

.current-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.current-actions button:disabled { cursor: default; }

.version-list-title {
  margin: 30px 0 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

#versionList {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Une carte en relief par CV ; celui qui est ouvert est enfoncé. La
   miniature occupe la colonne de gauche, nom, date et actions la droite. */
.version-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  column-gap: 16px;
  padding: 16px 18px 18px;
  border-radius: var(--radius-24);
  background: var(--surface);
  box-shadow: var(--raised-md);
}

.version-item > :not(.version-thumb) { grid-column: 2; }

/* Miniature (décorative) : une page blanche au format A4, le bandeau à la
   couleur du CV (--band, posée par app.js) pour le modèle « design ». */
.version-thumb {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  width: 58px;
  height: 82px;
}

.version-thumb .pg {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(80, 95, 125, 0.2), 0 8px 16px rgba(80, 95, 125, 0.2);
}

.version-thumb .bd { width: 30%; background: var(--band, #213a5c); }

.version-thumb .tx {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px;
}

.version-thumb i { display: block; height: 2px; background: #cdd3dd; }
.version-thumb i.h { height: 4px; width: 72%; background: var(--ink); }
.version-thumb i.a { height: 3px; width: 48%; margin-top: 3px; background: #9aa3b2; }

.version-item.active { box-shadow: var(--inset-md); }

/* Nom puis menu « ⋯ » (à droite, jamais coupé). */
.version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.version-name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 5px;
  overflow-wrap: anywhere;
}

input.version-rename {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}

.version-menu-wrap { position: relative; flex: none; }

/* Petits boutons des cartes (Ouvrir, ⋯, entrées du menu). */
button.version-menu-btn,
.version-actions button,
.version-menu button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-10);
  box-shadow: var(--raised-sm);
}

button.version-menu-btn {
  min-width: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

button.version-menu-btn:active,
.version-actions button:active,
.version-menu button:active { box-shadow: var(--inset-sm); }

.version-actions button:not(.ghost):active { box-shadow: var(--pressed-fill); }

.version-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
  padding: 10px;
  border-radius: var(--radius-16);
  background: var(--surface);
  box-shadow: var(--raised-lg);
}

.version-menu[hidden] { display: none; }

.version-menu button { justify-content: flex-start; width: 100%; }

.version-meta {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 4px 0 14px;
}

/* La ligne ouverte dit aussi, en toutes lettres, qu'elle a des modifications
   non enregistrées. */
.version-item.active.dirty .version-meta::after {
  content: ' · non enregistré';
  color: var(--warning);
  font-weight: 700;
}

.version-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 34px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--success);
  box-shadow: var(--inset-sm);
}

/* Message « supprimé · Annuler » : en bas de l'écran, au-dessus de tout sauf
   des fenêtres modales. */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px 12px 20px;
  border-radius: var(--radius-16);
  background: var(--surface);
  box-shadow: var(--raised-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.undo-toast[hidden] { display: none; }

.undo-toast span { overflow-wrap: anywhere; }

.undo-toast button { min-height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------- Tailles de police ----------
   Une ligne par type de texte : intitulé à gauche, champ compact à droite.
   Les groupes (bandeau / colonne principale) ne s'affichent que quand le
   modèle en compte plusieurs — le modèle « pro » n'a pas de titre de groupe. */

#fontControls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.fs-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.fs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.fs-label {
  flex: none;
  width: 104px;
  font-size: 14px;
  color: var(--ink-body);
}

/* Curseur : réglage rapide à la souris, le champ chiffré restant là pour une
   valeur précise. Les deux se suivent (voir syncFontRow dans app.js). Piste
   creuse, poignée en relief. */
.fs-slider {
  flex: 1;
  min-width: 60px;
  height: 8px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  cursor: pointer;
}

.fs-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(to bottom right, var(--accent-fill-start), var(--accent-fill-end));
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.fs-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(to bottom right, var(--accent-fill-start), var(--accent-fill-end));
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.fs-input {
  flex: none;
  width: 66px;
  padding: 0 8px;
  text-align: right;
}

.fs-unit {
  flex: none;
  width: 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Résultats d'analyse ---------- */

#results { margin-top: 20px; }

.keywords-box { margin-bottom: 18px; }

.keywords-box .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

/* Puces : un ton plus bas que la matière, sans ombre. */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  margin: 0 8px 8px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-chip);
  border-radius: var(--radius-10);
}

.chip.small { min-height: 24px; padding: 0 9px; font-size: 12px; }

/* ---------- Couverture de l'offre ----------
   Réordonner ne peut pas faire apparaître une compétence absente du CV :
   cet encadré liste ce qu'il manque, pour que l'utilisateur sache quoi
   AJOUTER (pas seulement réorganiser). */
.coverage-box { margin-bottom: 18px; }

.coverage-box .label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.coverage-hint {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin-bottom: 10px;
}

/* Mot-clé manquant : creux, libellé rouge (jamais de fond rouge). */
.chip.missing {
  background: var(--surface);
  box-shadow: var(--inset-sm);
  color: var(--danger);
}

/* Encadré « Nouveau CV proposé » : un creux dans la carte de l'offre. */

.proposal-box {
  padding: 20px 22px;
  margin-bottom: 6px;
  border-radius: var(--radius-24);
  background: var(--surface);
  box-shadow: var(--inset-lg);
}

.proposal-box h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.proposal-box .hint { margin-bottom: 14px; }

.proposal-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.proposal-actions button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: var(--radius-14);
}

.proposal-exp-line {
  font-size: 13.5px;
  color: var(--ink-muted);
  padding: 3px 0;
}

.proposal-exp-line strong { color: var(--ink); font-weight: 700; }

/* CTA : nom + enregistrement du nouveau CV, plus l'action secondaire
   « Ignorer ». Collée en bas du panneau qui défile (#createLeft) : l'action
   principale reste toujours atteignable sans avoir à faire défiler après une
   analyse. Même matière que l'encadré, séparée par un sillon : elle se lit
   comme un prolongement du creux, pas un élément flottant indépendant. Elle
   est le dernier enfant de .proposal-rest (et non de .proposal-box) :
   « sticky » ne peut pas sortir du cadre de son parent, donc elle ne remonte
   jamais au-dessus de ce bloc et ne recouvre pas le titre « Nouveau CV
   proposé » ni son explication. */
.proposal-save {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px -22px -20px;
  padding: 16px 22px 20px;
  background: var(--surface);
  border-radius: 0 0 var(--radius-24) var(--radius-24);
  box-shadow: var(--groove);
}

/* Fondu au-dessus de la barre : le texte qui défile dessous s'efface dans la
   matière au lieu d'être coupé net. Superposition pure (absolue, sans
   événements) : aucun espace dans le flux. */
.proposal-save::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 20px;
  background: linear-gradient(to bottom, rgba(228, 232, 238, 0), var(--surface));
  pointer-events: none;
}

.proposal-save-row {
  display: flex;
  /* Le champ prend toute la ligne et le bouton passe en dessous : les noms
     proposés sont dérivés de l'offre (« Swan — Product Manager Growth »),
     et « Enregistrer ce nouveau CV » mange à lui seul les deux tiers du
     panneau — partager la ligne tronquerait le nom à ~107px. */
  flex-wrap: wrap;
  gap: 14px;
}

.proposal-save-row input {
  flex: 1 1 100%;
  min-width: 100px;
}

.proposal-save-row button { white-space: nowrap; }

/* « Ignorer la proposition » : action secondaire — un lien d'action plat
   pour ne pas concurrencer l'enregistrement, tout en restant un vrai
   <button> (focus visible, clavier). */
button.link-btn {
  align-self: flex-start;
  min-height: 34px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  background: transparent;
  border-radius: var(--radius-10);
  box-shadow: none;
}

button.link-btn:hover { color: var(--ink); background: var(--surface-hover); filter: none; }
button.link-btn:active { box-shadow: var(--inset-sm); }

.apply-note { color: var(--success); font-size: 14px; font-weight: 700; }

.empty-note { font-size: 14px; color: var(--ink-muted); }

/* ---------- Candidatures : tableau, pastille, fenêtres ----------
   Kanban : une colonne en creux par statut, des cartes en relief. Le tableau
   défile latéralement (six colonnes de largeur fixe, accrochage au bord) ;
   un fondu et les boutons ‹ › disent qu'il y a une suite. */

.st-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--st-c, var(--st-closed));
}
.st-draft { --st-c: var(--st-draft); }
.st-applied { --st-c: var(--st-applied); }
.st-interview { --st-c: var(--st-interview); }
.st-offer { --st-c: var(--st-offer); }
.st-rejected { --st-c: var(--st-rejected); }
.st-closed { --st-c: var(--st-closed); }

.apps-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.apps-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; min-width: 0; }
.apps-title h2 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; color: var(--ink); }
.apps-title p { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.apps-title p:empty { display: none; }

/* Flèches ‹ › : deux boutons ronds en relief, une colonne par clic. Masquées
   quand tout le tableau tient (hidden posé par updateBoardEdges). */
.board-nav { display: flex; align-items: center; gap: 12px; flex: none; }
.board-nav[hidden] { display: none; }
.board-nav button {
  flex: none;
  width: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 24px;
  line-height: 1;
}
.board-nav button:disabled { opacity: 0.45; cursor: default; box-shadow: var(--raised-sm); }
/* Colonne courante : réservée au mobile (layout.css). */
.board-pos { display: none; margin: 0; }
.board-dots { display: none; }
.hint-short { display: none; }

.apps-hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-subtle); }
.apps-hint[hidden] { display: none; }

#applicationsEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 260px;
  justify-content: center;
  text-align: center;
}
#applicationsEmpty h2 { margin: 0; }
#applicationsEmpty .hint { max-width: 52ch; margin: 0 0 6px; }
#applicationsEmpty[hidden] { display: none; }

.board-wrap { position: relative; margin: 0 calc(var(--gutter) * -1); }
.board-wrap[hidden] { display: none; }

/* Fondu sur le bord qui cache une suite (jamais sur un bord déjà atteint). */
.board-wrap::before,
.board-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 22px;
  width: calc(var(--gutter) + 40px);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--neo-t) ease;
}
.board-wrap::before { left: 0; background: linear-gradient(to right, var(--surface), transparent); }
.board-wrap::after { right: 0; background: linear-gradient(to left, var(--surface), transparent); }
.board-wrap.can-prev::before,
.board-wrap.can-next::after { opacity: 1; }

/* Marges négatives + padding : les ombres des cartes et des colonnes ne sont
   pas rognées par l'overflow du défilement. */
.board-scroll {
  container-type: inline-size; /* 100cqw = largeur utile : colonne mobile pleine largeur */
  overflow-x: auto;
  padding: 8px var(--gutter) 22px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.board-scroll::-webkit-scrollbar { display: none; }
.board-scroll.is-dragging { scroll-snap-type: none; }

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 244px;
  gap: 18px;
  width: max-content;
}

.col {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  padding: 14px;
  border-radius: var(--radius-24);
  background: var(--surface);
  box-shadow: var(--inset-md);
  transition: box-shadow var(--neo-t) ease;
}

.col.over { box-shadow: var(--inset-md), 0 0 0 3px var(--accent); }

.col-head { display: flex; align-items: center; gap: 9px; padding: 4px 6px 0; }
.col-head h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink); }
.col-count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--surface-chip);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-body);
  font-variant-numeric: tabular-nums;
}

.col-body { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.col-empty {
  margin: 0;
  padding: 22px 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-subtle);
}

.kcard {
  position: relative;
  display: block;
  border-radius: var(--radius-18);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  cursor: grab;
  transition: box-shadow var(--neo-t) ease, opacity var(--neo-t) ease;
}
.kcard:hover { box-shadow: var(--raised-md); }
.kcard.dragging { opacity: 0.4; }

.kcard-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  padding: 14px 40px 13px 15px;
  border: 0;
  border-radius: inherit;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--ink-body);
  cursor: inherit;
  -webkit-tap-highlight-color: transparent;
}
.kcard-main:hover { color: var(--ink-body); }
.kcard-company { font-size: 14.5px; font-weight: 800; line-height: 1.3; color: var(--ink-strong); overflow-wrap: anywhere; }
.kcard-role { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.kcard-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
}

/* Poignée de glisser au doigt : une zone de 36 px dans le coin de la carte,
   seule à bloquer le défilement du tableau (le reste de la carte est un tap). */
.kcard-grip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-10);
  color: var(--ink-subtle);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.kcard-grip::before {
  content: '';
  width: 12px;
  height: 16px;
  background:
    radial-gradient(circle, currentColor 1.4px, transparent 1.8px) 0 0 / 6px 6px;
  opacity: 0.7;
}

/* Pastille « Statut ▾ » de la ligne de réglages au-dessus de la feuille + son menu. */
.status-wrap { position: relative; display: flex; }
.status-pill { gap: 9px; white-space: nowrap; }
.status-pill .st-dot { width: 9px; height: 9px; }
.status-pill-caret { font-size: 12px; margin-left: 2px; }

.status-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  z-index: 50;
  width: min(260px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border-radius: var(--radius-24);
  background: var(--surface);
  box-shadow: var(--raised-lg);
}
.status-menu[hidden] { display: none; }
.status-menu hr { border: 0; height: 2px; box-shadow: var(--groove); margin: 6px 8px; }

.pop-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-14);
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  color: var(--ink-body);
  cursor: pointer;
}
.pop-item:hover { background: var(--surface-hover); }
.pop-item[aria-checked="true"] { box-shadow: var(--inset-sm); color: var(--ink-strong); }

/* Fenêtres des candidatures. */
.app-card { width: 460px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.app-offer-card { width: 620px; }

.app-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.app-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.app-field input,
.app-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-14);
  box-shadow: var(--inset-md);
}
.app-field input::placeholder { color: var(--ink-placeholder); opacity: 1; }

.app-select { position: relative; display: block; }
.app-select select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.app-select::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--ink-subtle);
  border-bottom: 2px solid var(--ink-subtle);
  transform: rotate(45deg);
  pointer-events: none;
}

.app-save-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: var(--radius-14);
  box-shadow: var(--inset-sm);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-body);
  cursor: pointer;
}
.app-save-box input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.app-save-box small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; color: var(--ink-subtle); }

.app-form-error { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--danger); }
.app-form-error[hidden] { display: none; }

.st-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.st-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-body);
  background: linear-gradient(to bottom right, var(--surface-btn-start), var(--surface-btn-end));
  box-shadow: var(--raised-sm);
  cursor: pointer;
}
.st-chip:hover { color: var(--ink-strong); }
.st-chip[aria-checked="true"] { background: var(--surface); box-shadow: var(--inset-sm); color: var(--ink-strong); }

.app-cv-line { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-muted); overflow-wrap: anywhere; }
.app-cv-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}
.app-cv-link:hover { text-decoration: underline; }

.app-sheet-actions { align-items: flex-end; }
.app-sheet-tools { display: flex; flex-wrap: wrap; gap: 12px; }
.app-sheet-actions button { min-height: 40px; padding: 0 14px; font-size: 13.5px; }


.app-offer-text {
  margin: 0;
  max-height: min(50dvh, 420px);
  overflow: auto;
  padding: 16px 18px;
  border-radius: var(--radius-14);
  box-shadow: var(--inset-md);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-body);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--surface-chip);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-body);
  vertical-align: 1px;
}
.tab-count[hidden] { display: none; }

.app-toast { z-index: 95; }
.app-toast[hidden] { display: none; }

/* ---------- Bouton désactivé ----------
   Enfoncé dans la matière, sans couleur. En fin de couche pour primer sur
   toutes les variantes ci-dessus (même spécificité, déclaré après). */
button:disabled:not(:where(.icon-btn, .add-bullet, .add-exp, .add-edu, .add-project,
  .add-link, .add-contact, .add-group, .add-interest, .photo-placeholder, .bullet-more, .qr-add, .kcard-main, .st-chip, .pop-item, .app-cv-link)),
button:disabled:not(:where(.icon-btn, .add-bullet, .add-exp, .add-edu, .add-project,
  .add-link, .add-contact, .add-group, .add-interest, .photo-placeholder, .bullet-more, .qr-add, .kcard-main, .st-chip, .pop-item, .app-cv-link)):hover {
  color: var(--ink-disabled);
  background: var(--surface);
  box-shadow: var(--inset-sm);
  cursor: default;
  filter: none;
}

} /* @layer components */
