body {
  font-family: sans-serif;
  margin: 20px;
  background: #f6f6f3;
  color: #222;
}

h1 {
  font-size: 18px;
  margin-bottom: 12px;
}

/* ───────── controls ───────── */

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

textarea {
  width: 100%;
  box-sizing: border-box;

  min-height: 120px;
  padding: 10px;

  font-family: monospace;
  font-size: 13px;

  border: 1px solid #ccc;
  border-radius: 6px;

  resize: vertical;
}

.swap-btn {
  width: fit-content;
  padding: 0px 4px;
  background: #2a6e3f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.swap-btn:hover {
  opacity: 0.9;
}

.swap-btn-inline {
    background: transparent;
    border: none;
    color: #888; /* Gris discret par défaut */
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    transition: transform 0.2s, color 0.2s;
}

.swap-btn-inline:hover {
    color: #000; /* Devient noir (ou autre couleur) au survol */
    transform: scale(1.2);
}

#status {
  font-size: 12px;
  color: #666;
}

/* ───────── output layout ───────── */

#output {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================
   Sentence
   ========================================================== */

.sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;

  width: 100%;
  box-sizing: border-box;

  padding: 10px;

  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;

  overflow-x: auto;
}
/* Permet d'aligner la liaison au milieu des groupes de mots */
.sentence {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

/* Le conteneur de liaison inter-boîtes */
/* Le conteneur qui sépare les deux mots */
.liaison-separator {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: stretch;
    user-select: none;
    padding: 0;
    margin: 0 -5px; /* Rapproche légèrement les colonnes pour un effet de lien serré */
    text-align: center;
    width: 20px;    /* Largeur fixe pour stabiliser l'espacement */
}

/* 1. Aligner le symbole '‿' exactement à la hauteur de la ligne de texte (1ère ligne) */
.liaison-separator .liaison-symbol {
    height: 32px;       /* Doit correspondre EXACTEMENT à la hauteur de votre bloc .token-word */
    line-height: 32px;  /* Centre le caractère verticalement dans cette zone */
    font-size: 1.4rem;  /* Taille du caractère courbe */
    color: #e67e22;     /* Couleur orange pour la liaison */
    font-family: serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 2. Aligner le phonème '[z]' exactement à la hauteur de la ligne phonétique (2e ligne) */
.liaison-separator .liaison-phoneme {
    height: 24px;       /* Doit correspondre EXACTEMENT à la hauteur de votre bloc .token-ipa */
    line-height: 24px;
    font-size: 0.8rem;
    font-family: monospace;
    font-weight: bold;
    color: #d35400;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================
   One token
   ========================================================== */

.token-group {
    display: inline-grid;
    grid-template-rows: repeat(5, auto);

    justify-items: center;
    align-items: start;

    flex: 0 0 auto;

    padding: 4px 6px;

    border-right: 1px solid #eee;
}

.token-group:last-child {
  border-right: none;
}

.token-group:hover {
  background: #f3f6fb;
}

.token-group.punct {
    width: auto;
    min-width: 2em;
}

.token-word {
    white-space: pre;
//    white-space: pre-wrap;
}

/* ==========================================================
   Common token style
   ========================================================== */

.token {
  white-space: nowrap;
  text-align: center;
  padding: 2px 4px;
}

/* ==========================================================
   Word
   ========================================================== */

.token-word {
  font-weight: 700;
  color: #222;
  border-bottom: 1px solid #bbb;
  margin-bottom: 2px;
}

/* ==========================================================
   POS
   ========================================================== */

.token-pos {
  font-size: .72rem;
  color: #0b5ea8;
}

/* ==========================================================
   TAG
   ========================================================== */

.token-tag {
    font-size: .70rem;
    color: #8a5ab8;
}

/* ==========================================================
   Dependency
   ========================================================== */

.token-dep {
  font-size: .72rem;
  color: #2d7a2d;
}


/* ==========================================================
   Lemma
   ========================================================== */

.token-lemma {
  font-size: .70rem;
  color: #888;
  font-style: italic;
}

.token-ipa {
    color: #007acc; /* Couleur distincte pour l'API (ex: bleu doux) */
    font-family: "DejaVu Sans", "Lucida Sans Unicode", "Arial", sans-serif; /* Importante pour bien afficher les caractères IPA */
    font-size: 0.9em;
    font-weight: bold;
    font-style: italic;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: .2s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: .2s;
}

input:checked + .slider {
    background: #4caf50;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .8rem;
    flex-wrap: wrap;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: .6rem;
}

#btn_run {
    margin-left: auto;
}