/* ============================================================
   Maquette "Paramètres > Enrichissement intelligent" (Voice Record)
   Charte lemonapp (sidebar, header jaune) + composants du formulaire
   de paramétrage de l'auto-remplissage du picker + aperçu live.
   React pur (htm), aucun build : ce fichier est servi tel quel.
   ============================================================ */

:root {
  --ll-blue: #2f80ed;
  --ll-blue-dark: #1157d0;
  --ll-yellow: #fdbe00;
  --ll-yellow-nav: #fae100;
  --ll-text: #2d2e2f;
  --ll-muted: #6d7481;
  --ll-border: #e4e5e6;
  --ll-bg: #f5f5f5;
}

/* ========== Reset ========== */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}
html {
  height: 100%;
}
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Albert Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--ll-bg);
  color: var(--ll-text);
}
a {
  color: inherit;
  text-decoration: none;
}

/* ========== Sidebar ========== */
#sidebar-toggle {
  position: fixed;
  z-index: 11;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  padding: 10px;
  color: #b2b2b2;
  cursor: pointer;
  border-radius: 100%;
  transition: color 0.3s ease, background-color 0.3s ease;
  background: transparent;
  border: none;
}
#sidebar-toggle:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.1);
}
#sidebar-toggle svg {
  width: 20px;
  height: 20px;
}
#sidebar-toggle svg * {
  fill: currentColor;
}
body.--full #sidebar-toggle {
  color: #333;
}

#side-bar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  height: 100%;
  background-color: #fff;
  box-shadow: 1px 0 #e6e6e6;
  transition: transform 0.3s, box-shadow 0.3s ease;
}
body.--full #side-bar {
  transform: translateX(-100%);
  box-shadow: 1px 0 0 transparent;
}

#side-bar #header {
  height: 200px;
  position: relative;
}
#side-bar #header .logo {
  width: 150px;
  margin-left: 40px;
  margin-top: 60px;
  margin-bottom: 25px;
}
#side-bar #header select {
  position: absolute;
  top: 18px;
  right: 25px;
  width: 64px;
  height: 32px;
  padding-left: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  border: 1px solid var(--ll-border);
  border-radius: 4px;
  outline: none;
  background: #fff;
  cursor: pointer;
}

#side-bar #menu {
  flex-grow: 1;
  overflow-y: auto;
}
#side-bar #menu .accordion {
  width: 100%;
  overflow: hidden;
  border-top: solid 1px rgb(228, 229, 230);
  list-style: none;
}
#side-bar #menu .accordion:has(.tooltip) {
  overflow: visible;
}
#side-bar #menu .accordion .sub li:has(.tooltip) {
  overflow: visible;
}

#side-bar #menu .accordion .analytics-trial-badge {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #2b72ee;
  vertical-align: baseline;
  overflow: visible;
}
#side-bar #menu .accordion .analytics-trial-badge::before {
  content: "";
  position: absolute;
  inset: 0 10px 0 0;
  background: #fff395;
  border-radius: 8px;
  z-index: -1;
}

#side-bar #menu .accordion ul {
  list-style: none;
}
#side-bar #menu .accordion li {
  display: block;
}
#side-bar #menu .accordion label {
  cursor: pointer;
  display: block;
  padding: 0 24px;
  overflow: hidden;
  height: 48px;
  line-height: 48px;
  border-bottom: 1px solid rgb(228, 229, 230);
  font-size: 14px;
  color: var(--ll-text);
}
#side-bar #menu .accordion label:hover {
  background-color: #f1f1f1;
}
#side-bar #menu .accordion label .project-name {
  font-weight: 400;
  font-style: italic;
  font-size: 12px;
  margin-left: 5px;
  float: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  width: 155px;
}

#side-bar #menu .accordion input[type="radio"],
#side-bar #menu .accordion input[type="checkbox"] {
  display: none;
}

#side-bar #menu .accordion .sub li {
  cursor: pointer;
  overflow: hidden;
  height: 0;
  margin: 0;
  opacity: 0;
  font-size: 12px;
  transition: all 0.25s ease-in-out;
  text-transform: uppercase;
  letter-spacing: 0.48px;
  color: #88898a;
}
#side-bar #menu .accordion .sub li.active {
  color: #126fd3;
  font-weight: 700;
}
#side-bar #menu .accordion .sub li:hover {
  margin-left: 0.5em;
}

#side-bar #menu .accordion input:checked ~ .sub li {
  position: relative;
  height: 30px;
  opacity: 1;
}
#side-bar #menu .accordion input:checked ~ .sub li a {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px 0 0 45px;
}
#side-bar #menu .accordion input:checked + label {
  border-left: 4px solid #157ad8;
  font-weight: 700;
}
#side-bar #menu .accordion input:checked ~ ul {
  border-bottom: 1px solid rgb(228, 229, 230);
  padding: 10px 0;
}

#side-bar .disabled-link {
  pointer-events: none;
  opacity: 0.6;
}

/* ========== Offset contenu ========== */
.main-content {
  margin-left: 260px;
  transition: margin-left 0.3s;
  min-height: 100vh;
}
body.--full .main-content {
  margin-left: 0;
}

/* ========== Barre jaune ========== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background-color: var(--ll-yellow-nav);
  padding: 10px 24px;
}
body.--full .top-header {
  padding-left: 60px;
}
.top-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.top-header-center {
  position: relative;
  width: 450px;
  height: 40px;
  margin: 0 auto;
  flex-shrink: 1;
}
.top-header-search {
  width: 100%;
  height: 40px;
  padding: 0 140px 0 16px;
  border: none;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.top-header-search::placeholder {
  color: #999;
}
.search-context {
  position: absolute;
  right: 0;
  top: 0;
  height: 40px;
  width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 13px;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  user-select: none;
}
.top-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ========== Barre d'outils blanche (#tool-bar) ========== */
.tool-bar {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background-color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}
.tool-bar h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.64px;
  text-transform: uppercase;
  color: #333;
  line-height: 50px;
}

/* ========== Zone de contenu ========== */
.content {
  min-height: calc(100vh - 60px);
  background-color: var(--ll-bg);
  padding: 24px 32px 48px;
}

/* ========== Onglets ========== */
.ll-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ll-border);
  margin-bottom: 24px;
}
.ll-tab {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #5f6b7a;
  padding: 14px 18px;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.ll-tab:hover {
  color: #2d2e2f;
}
.ll-tab.active {
  color: var(--ll-blue);
}
.ll-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 3px;
  background: var(--ll-blue);
  border-radius: 2px 2px 0 0;
}

/* ========== Carte générique ========== */
.card {
  background: #fff;
  border: 1px solid var(--ll-border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card--empty {
  min-height: 90px;
}

/* ========== Layout paramétrage + aperçu ========== */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Sections de réglages ========== */
.section {
  padding: 20px 22px;
  margin-bottom: 20px;
}
.section:last-child {
  margin-bottom: 0;
}
.section-head {
  margin-bottom: 16px;
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #808080;
}
.section-sub {
  font-size: 12.5px;
  color: var(--ll-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid #f0f0f1;
}
.field:first-of-type {
  border-top: none;
}
.field-text .field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ll-text);
}
.field-text .field-help {
  font-size: 12px;
  color: var(--ll-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.field-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ========== Interrupteur (switch) ========== */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cdd2da;
  border-radius: 22px;
  transition: background 0.2s ease;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.switch input:checked + .slider {
  background: var(--ll-blue);
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* ========== Contrôle segmenté ========== */
.segmented {
  display: inline-flex;
  background: #f1f3f6;
  border: 1px solid var(--ll-border);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.segmented button {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ll-muted);
  padding: 7px 16px;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.segmented button.on {
  background: #fff;
  color: var(--ll-blue);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* ========== Sélecteur de couleur ========== */
.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-control.off {
  opacity: 0.4;
  pointer-events: none;
}
.color-swatch {
  position: relative;
  width: 34px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--ll-border);
  overflow: hidden;
  cursor: pointer;
}
.color-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}
.color-hex {
  font-size: 12px;
  font-weight: 600;
  color: var(--ll-muted);
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
  min-width: 58px;
}

/* ========== Aperçu live ========== */
.preview {
  position: sticky;
  top: 84px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ll-blue);
  background: #eaf2fe;
  padding: 4px 10px;
  border-radius: 20px;
}
.preview-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}
.preview-stage {
  position: relative;
  min-height: 340px;
  background: #fbfbfc;
  border: 1px solid var(--ll-border);
  border-radius: 10px;
  padding: 48px 26px 40px;
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 0);
  background-size: 18px 18px;
}
/* Voile uniforme et léger : tout le mock est grisé au même niveau ; seule la bulle reste nette */
.stage-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: rgba(36, 45, 64, 0.05);
  pointer-events: none;
}
/* Toggle discret de scénario, à l'intérieur du cadre d'aperçu */
.stage-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--ll-border);
  border-radius: 7px;
}
.stage-toggle button {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #9aa0aa;
  padding: 4px 11px;
  border-radius: 5px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-ico {
  display: inline-flex;
  opacity: 0.85;
}
.stage-toggle button.on {
  background: var(--ll-blue);
  color: #fff;
}

/* Mock "page" : éléments tous grisés de façon UNIFORME (état inactif sous le voile) */
.mock-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mock-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 96%;
}
.mock-row > label {
  flex-shrink: 0;
  width: 118px;
  font-size: 13px;
  font-weight: 600;
  color: #9aa0aa;
  white-space: nowrap;
}
.mock-input {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 140px;
  background: #f3f4f6;
  border: 1px solid #e1e3e7;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  color: #aab0b9;
}
.mock-btnrow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mock-btn {
  background: #e8eaed;
  color: #9aa0aa;
  border-radius: 6px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
}
/* Ancre : porte la bulle, positionnée pile sous l'élément ciblé */
.mock-anchor {
  position: relative;
  display: flex;
  flex: 1;
}
.mock-btnrow .mock-anchor {
  flex: 0 0 auto;
}

/* Bulle d'étape — style par défaut Lemon (bordure + flèche jaunes), pointe l'élément ciblé */
.bubble {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 290px;
  background: #fff;
  border: 2px solid var(--ll-yellow);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 30, 50, 0.2);
  padding: 12px 16px 14px;
}
.bubble::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 2px solid var(--ll-yellow);
  border-top: 2px solid var(--ll-yellow);
  transform: translateX(-50%) rotate(45deg);
}
.bubble-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bubble-move {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  color: #b8bcc4;
  cursor: move;
}
.bubble-move:hover {
  color: #8a8f98;
}
.bubble-close {
  color: #b8bcc4;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.bubble-text {
  font-size: 14px;
  line-height: 1.5;
  color: #2d2e2f;
}
.bubble-bar {
  height: 4px;
  border-radius: 3px;
  background: #e9ebee;
  overflow: hidden;
  margin-top: 16px;
}
.bubble-bar-fill {
  width: 25%;
  height: 100%;
  border-radius: 3px;
  background: var(--ll-blue);
}
.bubble-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 6px;
  padding: 8px 18px;
}
.btn-primary {
  background: var(--ll-yellow);
  color: #2d2e2f;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 11.5px;
}

/* Le rendu du texte généré dans la bulle */
.gen-verb,
.gen-target {
  transition: color 0.12s ease;
}
