/* Koyeba Prompt : charte « Le Point » (orange #FE7F04, noir #0B0B0B, blanc #FFFFFF), version claire */
:root {
  --fond: #FFFFFF;
  --doux: #F6F6F4;
  --encre: #0B0B0B;
  --encre-2: #55534E;
  --encre-3: #8D8A85;
  --ligne: #E6E5E2;
  --ligne-forte: #CFCDC8;
  --orange: #FE7F04;
  --orange-texte: #B35400;
  --orange-doux: #FFF3E6;
  --vert: #2F8F57;
  --rouge: #C2412D;
  --rayon: 14px;
  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --titre: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); margin: 0; text-wrap: balance; }
p { margin: 0; }
.pt { color: var(--orange); }

/* ---------- barre du haut ---------- */
.barre {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--fond);
  border-bottom: 1px solid var(--ligne);
}
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); }
.marque img { height: 24px; width: auto; display: block; }
.produit { font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--encre-2); padding-left: 10px; border-left: 1px solid var(--ligne-forte); }
.barre-droite { display: flex; align-items: center; gap: 10px; }
.compteur {
  border: 0; background: none; border-radius: 999px; padding: 6px 8px;
  font-size: 0.85rem; color: var(--encre-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.compteur:hover { background: var(--doux); }
.compteur b { color: var(--encre); }
.compteur.vide b { color: var(--rouge); }
.compteur.illimite b { color: var(--orange-texte); font-size: 1.15em; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bouton-fin {
  border: 1px solid var(--ligne-forte);
  background: var(--fond);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}
.bouton-fin:hover { border-color: var(--encre); }
.bouton-noir {
  border: 0;
  background: var(--encre);
  color: var(--fond);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}
.bouton-principal {
  border: 0;
  background: var(--orange);
  color: var(--encre);
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.98rem;
}
.bouton-principal:hover { filter: brightness(0.96); }
.bouton-principal:disabled { background: var(--doux); color: var(--encre-3); cursor: not-allowed; }

/* ---------- page ---------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding-block: 40px 120px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.intro { display: grid; gap: 12px; max-width: 680px; margin-bottom: 40px; }
.intro h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; }
.intro p { color: var(--encre-2); font-size: 1.05rem; max-width: 60ch; }

.atelier { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.colonne { display: grid; gap: 48px; min-width: 0; }
.etape { display: grid; gap: 18px; min-width: 0; }
.etape h2 { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; letter-spacing: -0.02em; }
.num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--encre); color: var(--fond);
  font: 700 0.85rem/1 var(--titre);
}
.aide { color: var(--encre-2); font-size: 0.95rem; max-width: 62ch; }

/* ---------- étape 1 : type ---------- */
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.type {
  text-align: left;
  border: 1.5px solid var(--ligne);
  background: var(--fond);
  border-radius: var(--rayon);
  padding: 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.type b { font-family: var(--titre); font-size: 1.05rem; letter-spacing: -0.01em; }
.type span { color: var(--encre-2); font-size: 0.86rem; line-height: 1.4; }
.type:hover { border-color: var(--ligne-forte); }
.type[aria-pressed="true"] { border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre); }

/* ---------- puces (métiers, choix) ---------- */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  border: 1px solid var(--ligne-forte);
  background: var(--fond);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
}
.puce:hover { border-color: var(--encre); }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--fond); }

/* ---------- étape 3 : infos ---------- */
.vide-etat { color: var(--encre-3); font-size: 0.95rem; padding: 18px; border: 1.5px dashed var(--ligne-forte); border-radius: var(--rayon); }
.formulaire { display: grid; gap: 22px; }
.bloc-images { background: var(--doux); border-radius: var(--rayon); padding: 18px; display: grid; gap: 12px; }
.bloc-images h3 { font-size: 1rem; letter-spacing: -0.01em; }
.bloc-images p { color: var(--encre-2); font-size: 0.9rem; }
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.case {
  display: flex; align-items: center; gap: 10px;
  background: var(--fond);
  border: 1px solid var(--ligne);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}
.case input { width: 18px; height: 18px; accent-color: var(--encre); flex: none; margin: 0; }
.case:has(input:checked) { border-color: var(--encre); }

.champ { display: grid; gap: 8px; min-width: 0; }
.champ > label, .champ > .etiquette { font-weight: 600; font-size: 0.92rem; }
.champ .requis { color: var(--orange-texte); font-weight: 700; margin-left: 2px; }
.champ input[type="text"], .champ input[type="tel"], .champ textarea, .retouche-detail textarea {
  width: 100%;
  border: 1px solid var(--ligne-forte);
  border-radius: 10px;
  padding: 11px 12px;
  background: var(--fond);
  font-size: 16px;
  line-height: 1.45;
}
.champ textarea, .retouche-detail textarea { resize: vertical; min-height: 76px; }
.champ input:focus, .champ textarea:focus, .retouche-detail textarea:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre); }
.champ input::placeholder, .champ textarea::placeholder, .retouche-detail textarea::placeholder { color: var(--encre-3); }
.champ .lu { font-size: 0.85rem; color: var(--vert); font-weight: 500; }
.champ.signale input, .champ.signale textarea { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-doux); }

.palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.palette { display: inline-flex; align-items: center; gap: 8px; }
.palette .ronds { display: inline-flex; }
.palette .ronds i { width: 16px; height: 16px; border-radius: 50%; margin-right: -4px; box-shadow: 0 0 0 2px var(--fond), inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.palette .ronds i:last-child { margin-right: 0; }
.puce[aria-pressed="true"] .ronds i { box-shadow: 0 0 0 2px var(--encre), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }

.liste-pages { display: grid; gap: 6px; }
.liste-pages .case { align-items: flex-start; }
.liste-pages .case input { margin-top: 2px; }
.liste-pages .case span b { font-weight: 600; }
.liste-pages .case span { color: var(--encre-2); }

/* ---------- ce qui manque ---------- */
.manque { position: sticky; top: 84px; }
.manque-carte { border: 1.5px solid var(--encre); border-radius: 18px; padding: 18px; display: grid; gap: 14px; background: var(--fond); }
.manque details { display: grid; gap: 12px; }
.manque summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.manque summary::-webkit-details-marker { display: none; }
.score-ligne { display: grid; gap: 2px; }
.score-ligne b { font-family: var(--titre); font-size: 1.35rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score-ligne span { color: var(--encre-2); font-size: 0.9rem; }
.chevron { width: 10px; height: 10px; border-right: 2px solid var(--encre-2); border-bottom: 2px solid var(--encre-2); transform: rotate(45deg); margin-top: -4px; transition: transform 0.2s ease; display: none; }
details[open] .chevron { transform: rotate(-135deg); margin-top: 4px; }
.barre-score { height: 6px; background: var(--doux); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.barre-score i { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 999px; transition: width 0.3s ease; }
.barre-score i.complet { background: var(--vert); }
.liste-manque { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; }
.liste-manque li button {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  border: 0; background: none; padding: 0; text-align: left;
  font-size: 0.9rem; line-height: 1.4; color: var(--encre);
}
.liste-manque li button::before {
  content: "+"; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--orange); display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; line-height: 1; margin-top: 0;
}
.liste-manque li button:hover { text-decoration: underline; }
.liste-manque li.ok { display: flex; gap: 10px; align-items: center; color: var(--vert); font-size: 0.9rem; font-weight: 500; }
.liste-manque li.ok::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; background: var(--vert); color: #FFFFFF; display: grid; place-items: center; font-size: 0.72rem; flex: none; }
.reste { color: var(--encre-2); font-size: 0.85rem; text-align: center; font-variant-numeric: tabular-nums; }
.reste.vide { color: var(--rouge); font-weight: 600; }

/* ---------- résultat ---------- */
.sortie { border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.sortie-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; background: var(--doux); border-bottom: 1px solid var(--ligne); font-size: 0.88rem; font-weight: 600; color: var(--encre-2); }
.prompt {
  margin: 0;
  padding: 18px;
  font: 400 0.84rem/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 460px;
  overflow: auto;
  background: var(--fond);
}
.mode-emploi { display: grid; gap: 10px; }
.mode-emploi h3, .images h3 { font-size: 1rem; letter-spacing: -0.01em; }
.mode-emploi ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--encre-2); }
.mode-emploi a { color: var(--encre); font-weight: 600; }
.images { background: var(--orange-doux); border-radius: var(--rayon); padding: 18px; display: grid; gap: 14px; }
.images p { color: var(--encre-2); font-size: 0.92rem; }
.images ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 0.92rem; }
.image-ia { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--fond); border-radius: 10px; padding: 12px; font-size: 0.88rem; }
.image-ia span { min-width: 0; }
.image-ia button { flex: none; }

/* ---------- retouches ---------- */
.retouche-detail { display: grid; gap: 10px; background: var(--doux); border-radius: var(--rayon); padding: 16px; }
.retouche-detail label { font-weight: 600; font-size: 0.92rem; }
.retouche-detail .bouton-principal { justify-self: start; }
.puce.changements { border-color: var(--orange); }
.historique { display: grid; gap: 8px; }
.historique h3 { font-size: 0.95rem; color: var(--encre-2); font-family: var(--police); font-weight: 600; }
.historique ul { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--ligne); }
.historique li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ligne); font-size: 0.9rem; }
.historique li span { min-width: 0; }
.historique li small { color: var(--encre-3); margin-left: 6px; }

/* ---------- fenêtres ---------- */
.fenetre {
  border: 0;
  border-radius: 20px;
  padding: 24px;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
  color: var(--encre);
}
.fenetre::backdrop { background: rgba(11, 11, 11, 0.45); }
.fenetre[open] { display: grid; gap: 16px; }
.fenetre h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
.fenetre p { color: var(--encre-2); }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fenetre-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.note { font-size: 0.88rem; color: var(--orange-texte) !important; }
.code-zone { display: grid; gap: 12px; }
.form-code { display: flex; flex-wrap: wrap; gap: 8px; }
.form-code input {
  flex: 1 1 200px; min-width: 0;
  border: 1px solid var(--ligne-forte); border-radius: 10px; padding: 11px 12px;
  font: 500 16px var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
}
.form-code input:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre); }
.form-code .bouton-principal { padding-block: 11px; }
.message-code { color: var(--rouge) !important; font-size: 0.9rem; }
.code-ok { color: var(--encre) !important; font-weight: 600; }
.infini { color: var(--orange-texte); font-size: 1.3em; margin-right: 4px; }
.liste-projets { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--ligne); }
.liste-projets li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.liste-projets li > span { display: grid; min-width: 0; }
.liste-projets li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-projets li small { color: var(--encre-3); font-size: 0.82rem; }
.liste-projets .actions { display: flex; gap: 6px; flex: none; }
.liste-projets .courant b::after { content: " · ouvert"; color: var(--orange-texte); font-weight: 500; font-size: 0.82rem; }
.bouton-texte { border: 0; background: none; padding: 6px 4px; font-size: 0.85rem; color: var(--encre-2); text-decoration: underline; }
.bouton-texte.danger { color: var(--rouge); }
.bouton-texte:hover:not(:disabled) { color: var(--encre); }
.bouton-texte:disabled { color: var(--ligne-forte); text-decoration: none; cursor: default; }
.outils-choix { display: flex; justify-content: space-between; gap: 8px; margin-top: -4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--encre);
  color: var(--fond);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.4);
}

/* ---------- téléphone ---------- */
@media (max-width: 900px) {
  .atelier { grid-template-columns: minmax(0, 1fr); }
  .manque {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    z-index: 30;
    padding: 0 max(10px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }
  .manque-carte { border-radius: 18px; padding: 12px 14px; gap: 10px; box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.25); }
  .chevron { display: block; }
  .score-ligne b { font-size: 1.1rem; }
  .bouton-principal#fabriquer { padding: 12px 18px; }
  .reste { display: none; }
  .outils-choix { margin-top: -6px; }
  .outils-choix .bouton-texte { padding-block: 2px; }
  .page { padding-bottom: 230px; }
  .toast { bottom: calc(190px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .types { grid-template-columns: minmax(0, 1fr); }
  .type { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
  .type span { grid-column: 1 / -1; }
  .cases { grid-template-columns: minmax(0, 1fr); }
  .compteur .jour { display: none; }
  .barre .bouton-fin { padding: 7px 12px; }
  .intro { margin-bottom: 28px; }
  .colonne { gap: 40px; }
}
/* Petits téléphones : « ∞ prompts » et « Mes projets » tiennent sur la ligne du logo */
@media (max-width: 400px) {
  .barre { gap: 8px; }
  .barre-droite { gap: 4px; }
  .compteur { padding: 6px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
