.cgn-page {
  padding: 28px 28px 56px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ───── Page header (matches the real page eyebrow + title + desc) ───── */
.cgn-header {
  margin-bottom: 24px;
}
.cgn-header-eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--snp-accent-deep);
  margin: 0 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cgn-header-eyebrow::before {
  content: "";
  width: 22px; height: 3px;
  background: var(--gt-red);
}
.cgn-header-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--snp-text);
  margin: 0 0 8px;
}
.cgn-header-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--snp-text-2);
  margin: 0;
  max-width: 720px;
}
.cgn-header-desc strong { color: var(--snp-text); font-weight: 600; }

/* ───── Composer card ───── */
.cgn-card {
  background: var(--snp-surface);
  border: 1px solid var(--snp-line);
  border-radius: 14px;
  overflow: hidden;
}

.cgn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 820px) {
  .cgn-grid { grid-template-columns: 1fr; }
}
.cgn-col {
  padding: 24px 26px 8px;
  min-width: 0;
}
.cgn-col + .cgn-col { border-left: 1px solid var(--snp-line); }
@media (max-width: 820px) {
  .cgn-col + .cgn-col { border-left: 0; border-top: 1px solid var(--snp-line); }
}

/* ───── Section ───── */
.cgn-section { margin-bottom: 22px; }
.cgn-section + .cgn-section {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px dashed var(--snp-line);
}
.cgn-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.cgn-section-eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--snp-text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cgn-section-eyebrow::before {
  content: "";
  width: 18px; height: 3px;
  background: var(--gt-red);
}
.cgn-section-opt {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--snp-text-3);
  letter-spacing: 0;
  text-transform: none;
}

/* Collapsible (facultatif) */
.cgn-section--toggle .cgn-section-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
  gap: 10px;
  color: var(--snp-text);
  margin-bottom: 14px;
}
.cgn-section--toggle .chev {
  margin-left: auto;
  color: var(--snp-text-3);
  transition: transform .15s var(--ease-std);
}
.cgn-section--collapsed .chev { transform: rotate(-90deg); }
.cgn-section--collapsed .cgn-section-toggle { margin-bottom: 0; }
.cgn-section--collapsed .cgn-section-content { display: none; }

/* ───── Field ───── */
.cgn-field { margin-bottom: 14px; }
.cgn-field:last-child { margin-bottom: 0; }
.cgn-field-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-height: 18px;
}
.cgn-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--snp-text);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cgn-field-info {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--snp-bg);
  border: 1px solid var(--snp-line);
  color: var(--snp-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  user-select: none;
}
.cgn-field-info:hover { color: var(--snp-text); border-color: var(--snp-text-3); }
.cgn-field-head .spacer { flex: 1; }

/* Suggérer pill */
.cgn-suggest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: var(--snp-accent-soft);
  color: var(--snp-accent-deep);
  border: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all .12s var(--ease-std);
}
.cgn-suggest:hover {
  background: var(--snp-accent);
  color: var(--snp-accent-on);
}
.cgn-suggest svg { stroke-width: 2.2; }

/* ───── Inputs ───── */
.cgn-input,
.cgn-textarea,
.cgn-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--snp-line-strong);
  border-radius: 9px;
  background: var(--snp-surface);
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--snp-text);
  outline: 0;
  transition: border-color .12s var(--ease-std), box-shadow .12s var(--ease-std);
}
.cgn-textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: var(--font-body);
}
.cgn-input::placeholder,
.cgn-textarea::placeholder {
  color: var(--snp-text-3);
  font-style: italic;
}
.cgn-input:focus,
.cgn-textarea:focus,
.cgn-select:focus {
  border-color: var(--snp-accent);
  box-shadow: 0 0 0 3px var(--snp-accent-soft);
}

/* Modern native select w/ chevron (kept for any remaining selects) */
.cgn-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
.cgn-select:hover { border-color: var(--snp-text-3); }

/* ───── Mode éditorial — icon card grid (4x2) ───── */
.cgn-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 1000px) {
  .cgn-modes { grid-template-columns: repeat(2, 1fr); }
}
.cgn-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 10px 9px;
  border: 1px solid var(--snp-line-strong);
  background: var(--snp-surface);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--snp-text-2);
  transition: all .12s var(--ease-std);
  min-height: 64px;
}
.cgn-mode:hover {
  border-color: var(--snp-text-3);
  color: var(--snp-text);
}
.cgn-mode.is-on {
  border-color: var(--snp-text);
  background: var(--gt-ink);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,0.4);
}
.cgn-mode .ico {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--snp-surface-2);
  color: var(--snp-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .12s var(--ease-std);
}
.cgn-mode:hover .ico { color: var(--snp-text); }
.cgn-mode.is-on .ico {
  background: rgba(0,180,216,0.2);
  color: var(--gt-cyan);
}
.cgn-mode .t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: -0.005em;
  line-height: 1.2;
  text-wrap: pretty;
}
.cgn-mode .check {
  position: absolute;
  top: 8px; right: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gt-cyan);
  color: #06222a;
  display: none;
  align-items: center;
  justify-content: center;
}
.cgn-mode.is-on .check { display: inline-flex; }

/* ───── Platform — brand pill chips ───── */
.cgn-pf {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
@media (max-width: 1000px) {
  .cgn-pf { grid-template-columns: repeat(3, 1fr); }
}
.cgn-pf-btn {
  --p: var(--snp-text-3);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--snp-line-strong);
  background: var(--snp-surface);
  cursor: pointer;
  font: inherit;
  color: var(--snp-text-2);
  transition: all .12s var(--ease-std);
}
.cgn-pf-btn[data-p="linkedin"]   { --p: #0a66c2; }
.cgn-pf-btn[data-p="newsletter"] { --p: var(--gt-cyan-deep); }
.cgn-pf-btn[data-p="blog"]       { --p: var(--gt-ink); }
.cgn-pf-btn[data-p="facebook"]   { --p: #1778f2; }
.cgn-pf-btn[data-p="instagram"]  { --p: #d62976; }

.cgn-pf-btn:hover {
  border-color: var(--p);
  color: var(--snp-text);
  transform: translateY(-1px);
}
.cgn-pf-btn .pf-ico {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--snp-surface-2);
  color: var(--p);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s var(--ease-std);
}
.cgn-pf-btn .pf-name {
  font-size: 11.5px;
  font-weight: 600;
}
.cgn-pf-btn.is-on {
  border-color: var(--p);
  background: color-mix(in oklab, var(--p) 8%, var(--snp-surface));
  color: var(--snp-text);
}
.cgn-pf-btn.is-on .pf-ico {
  background: var(--p);
  color: #fff;
}
.cgn-pf-btn.is-on::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  border: 1.5px solid var(--p);
  pointer-events: none;
}

/* ───── Format — text chips (dynamic by platform) ───── */
.cgn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cgn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--snp-line-strong);
  background: var(--snp-surface);
  color: var(--snp-text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s var(--ease-std);
}
.cgn-chip:hover { color: var(--snp-text); border-color: var(--snp-text-3); }
.cgn-chip.is-on {
  background: var(--gt-ink);
  color: #fff;
  border-color: var(--gt-ink);
}

/* ───── Ton — character pills with mini bar ───── */
.cgn-tones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .cgn-tones { grid-template-columns: repeat(2, 1fr); }
}
.cgn-tone {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--snp-line-strong);
  background: var(--snp-surface);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--snp-text-2);
  text-align: left;
  transition: all .12s var(--ease-std);
}
.cgn-tone:hover { color: var(--snp-text); border-color: var(--snp-text-3); }
.cgn-tone .bar {
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--snp-line-strong);
  flex-shrink: 0;
  transition: all .12s var(--ease-std);
}
.cgn-tone[data-t="formel"]       .bar { background: #6b7c8d; }
.cgn-tone[data-t="direct"]       .bar { background: var(--gt-red); }
.cgn-tone[data-t="provocateur"]  .bar { background: #d62976; }
.cgn-tone[data-t="pedagogique"]  .bar { background: var(--gt-cyan-deep); }
.cgn-tone[data-t="inspirant"]    .bar { background: #f59e0b; }
.cgn-tone[data-t="analytique"]   .bar { background: #6b8e6e; }
.cgn-tone.is-on {
  border-color: var(--snp-text);
  background: var(--snp-surface);
  color: var(--snp-text);
  box-shadow: 0 1px 0 var(--snp-text) inset, 0 4px 10px -6px rgba(0,0,0,0.15);
}
.cgn-tone.is-on .bar {
  width: 4px;
  height: 22px;
}

/* ───── Émotion — color-tinted swatches ───── */
.cgn-emotions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cgn-emotion {
  --c: var(--snp-text-3);
  --bg: var(--snp-surface);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 12px 10px;
  border: 1px solid var(--snp-line-strong);
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--snp-text-2);
  transition: all .12s var(--ease-std);
  overflow: hidden;
}
.cgn-emotion[data-e="confiance"]    { --c: #1f8a5b; }
.cgn-emotion[data-e="curiosite"]    { --c: var(--gt-cyan-deep); }
.cgn-emotion[data-e="urgence"]      { --c: var(--gt-red); }
.cgn-emotion[data-e="satisfaction"] { --c: #f59e0b; }
.cgn-emotion[data-e="empathie"]     { --c: #d62976; }
.cgn-emotion[data-e="aspiration"]   { --c: #7c4dff; }

.cgn-emotion::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--c);
  opacity: 0;
  transition: opacity .12s var(--ease-std);
}
.cgn-emotion:hover { color: var(--snp-text); border-color: var(--c); }
.cgn-emotion:hover::before { opacity: 0.4; }

.cgn-emotion.is-on {
  border-color: var(--c);
  background: color-mix(in oklab, var(--c) 6%, var(--snp-surface));
  color: var(--snp-text);
}
.cgn-emotion.is-on::before { opacity: 1; }
.cgn-emotion .e-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--snp-text);
}
.cgn-emotion .e-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c);
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.cgn-emotion .e-desc {
  font-size: 10.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--snp-text-3);
}

/* ───── Slider (Longueur) ───── */
.cgn-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--snp-line-strong);
  border-radius: 999px;
  outline: 0;
  margin: 12px 0 6px;
}
.cgn-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--snp-accent);
  cursor: pointer;
  border: 3px solid var(--snp-surface);
  box-shadow: 0 0 0 1px var(--snp-accent), 0 2px 4px rgba(0,0,0,0.15);
}
.cgn-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--snp-accent);
  cursor: pointer;
  border: 3px solid var(--snp-surface);
  box-shadow: 0 0 0 1px var(--snp-accent), 0 2px 4px rgba(0,0,0,0.15);
}
.cgn-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--snp-text-3);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.cgn-slider-ticks span.is-active {
  color: var(--snp-accent-deep);
  font-weight: 700;
}

/* ───── Footer action bar (matches reality: 2 checkboxes + generate button) ───── */
.cgn-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 26px;
  background: var(--snp-surface-2);
  border-top: 1px solid var(--snp-line);
  flex-wrap: wrap;
}
.cgn-foot-spacer { flex: 1; }

.cgn-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--snp-text-2);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}
.cgn-check input { display: none; }
.cgn-check-box {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--snp-line-strong);
  background: var(--snp-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all .12s var(--ease-std);
}
.cgn-check:hover .cgn-check-box { border-color: var(--snp-text-3); }
.cgn-check.is-on .cgn-check-box {
  background: var(--snp-accent);
  border-color: var(--snp-accent);
  color: var(--snp-accent-on);
}
.cgn-check.is-on { color: var(--snp-text); }

.cgn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--snp-accent);
  color: var(--snp-accent-on);
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0,180,216,0.6);
  transition: all .12s var(--ease-std);
}
.cgn-generate:hover { background: var(--gt-cyan-deep); transform: translateY(-1px); }
.cgn-generate svg { stroke-width: 2.2; }

/* ───── Radio/checkbox-driven active states (inputs live inside the labels) ───── */
.cgn-mode:has(input:checked) {
  border-color: var(--snp-text); background: var(--gt-ink); color: #fff;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,0.4);
}
.cgn-mode:has(input:checked) .ico { background: rgba(0,180,216,0.2); color: var(--gt-cyan); }
.cgn-mode:has(input:checked) .check { display: inline-flex; }

.cgn-pf-btn:has(input:checked) {
  border-color: var(--p);
  background: color-mix(in oklab, var(--p) 8%, var(--snp-surface));
  color: var(--snp-text);
}
.cgn-pf-btn:has(input:checked) .pf-ico { background: var(--p); color: #fff; }
.cgn-pf-btn:has(input:checked)::after {
  content: ""; position: absolute; inset: -1px; border-radius: 10px;
  border: 1.5px solid var(--p); pointer-events: none;
}

.cgn-chip:has(input:checked) { background: var(--gt-ink); color: #fff; border-color: var(--gt-ink); }

.cgn-tone:has(input:checked) {
  border-color: var(--snp-text); color: var(--snp-text);
  box-shadow: 0 1px 0 var(--snp-text) inset, 0 4px 10px -6px rgba(0,0,0,0.15);
}
.cgn-tone:has(input:checked) .bar { width: 4px; height: 22px; }

.cgn-emotion:has(input:checked) {
  border-color: var(--c);
  background: color-mix(in oklab, var(--c) 6%, var(--snp-surface));
  color: var(--snp-text);
}
.cgn-emotion:has(input:checked)::before { opacity: 1; }

.cgn-check:has(input:checked) { color: var(--snp-text); }
.cgn-check:has(input:checked) .cgn-check-box {
  background: var(--snp-accent); border-color: var(--snp-accent); color: var(--snp-accent-on);
}

/* Hide native inputs; the <label> is the control */
.cgn-mode input, .cgn-pf-btn input, .cgn-chip input,
.cgn-tone input, .cgn-emotion input, .cgn-check input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
/* Keyboard focus visibility */
.cgn-mode:focus-within, .cgn-pf-btn:focus-within, .cgn-chip:focus-within,
.cgn-tone:focus-within, .cgn-emotion:focus-within, .cgn-check:focus-within {
  outline: 2px solid var(--snp-accent); outline-offset: 2px;
}

/* Full-width collapsible "Détails" sits below the 2-col grid */
.cgn-card > .cgn-col { border-top: 1px solid var(--snp-line); }

/* Options désactivées visuellement (plateformes/formats hors focus) */
.cgn-pf-btn:has(input:disabled),
.cgn-chip:has(input:disabled) {
  opacity: 0.4;
  pointer-events: none;
}

/* ───────── Mobile (≤768px) — chantier docs/specs/responsive ─────────
   Pas d'aperçu live dans ce composer (les 2 colonnes = formulaire ; le résultat
   s'affiche dans la modale). Donc pas d'onglets : on empile (déjà à 820px), on
   compresse, on rend les puces tactiles, et on épingle la barre Générer en bas. */
@media (max-width: 768px) {
  .cgn-page {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 128px; /* dégage la barre Générer fixe */
  }
  /* Barre Générer toujours atteignable */
  .cgn-foot {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.14);
  }
  .cgn-foot-spacer { display: none; }
  .cgn-generate { width: 100%; justify-content: center; }
  /* Cibles tactiles ≥44px sur les puces de sélection */
  .cgn-mode, .cgn-pf-btn, .cgn-chip, .cgn-tone, .cgn-emotion { min-height: 44px; }
}
