/* =============================================================================
   Habillage commun des outils GEO.

   Les cinq outils embarquaient chacun leur propre bloc <style> avec les mêmes
   valeurs en dur (#6B3DF5, #E4E4E7, radius 12px, Inter). Cinq copies à
   maintenir, et un rendu qui ne suivait aucun changement de charte.

   Ce fichier reprend les noms de classes existants — donc aucun JavaScript
   à toucher — et les rebranche sur les jetons du site. Le choix des sélecteurs
   par attribut `data-*` plutôt que par classe, côté JS, est ce qui rend cette
   substitution possible sans risque.
   ============================================================================= */

/* ------------------------------------------------------------- Conteneurs */
.rti-tool,
.gsf-tool,
.glt-tool,
.otm-tool,
.shm-tool {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.15rem, 3vw, 1.75rem);
  box-shadow: none;
}

.rti-tool *,
.gsf-tool *,
.glt-tool *,
.otm-tool *,
.shm-tool * {
  box-sizing: border-box;
}

/* Le titre interne de l'outil fait doublon avec le H1 de la page :
   on le masque visuellement tout en le gardant pour les lecteurs d'écran
   et pour le cas où l'outil serait réutilisé seul, hors du site. */
.rti-tool > h3,
.gsf-tool > h3,
.glt-tool > h3,
.otm-tool > h3,
.shm-tool > h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Sur-titres en Archivo plutôt qu'en mono capitales : c'est ce qui restait
   de « deux sites cousus ensemble » entre les pages éditoriales et les outils. */
.rti-tool h4,
.gsf-tool h4,
.glt-tool h4,
.otm-tool h4,
.shm-tool h4,
.snip-tool h4 {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  margin: 1.75rem 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.rti-tool h4:first-of-type,
.gsf-tool h4:first-of-type,
.glt-tool h4:first-of-type,
.otm-tool h4:first-of-type,
.shm-tool h4:first-of-type {
  margin-top: 0;
}

/* ------------------------------------------------------------- Formulaires */
.rti-tool label,
.gsf-tool label,
.glt-tool label,
.otm-tool label,
.shm-tool label {
  display: block;
  font-size: var(--t-small);
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.rti-tool input[type="text"],
.rti-tool textarea,
.gsf-tool input[type="text"],
.gsf-tool textarea,
.glt-tool input[type="text"],
.glt-tool textarea,
.otm-tool input[type="text"],
.otm-tool textarea,
.shm-tool textarea,
.shm-tool select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.65rem;
}

.shm-tool select {
  width: auto;
  min-width: 12rem;
}

.rti-tool textarea,
.gsf-tool textarea,
.glt-tool textarea,
.otm-tool textarea {
  min-height: 5rem;
  resize: vertical;
}

.shm-tool textarea {
  min-height: 11rem;
  resize: vertical;
}

.rti-tool input:focus,
.rti-tool textarea:focus,
.gsf-tool input:focus,
.gsf-tool textarea:focus,
.glt-tool input:focus,
.glt-tool textarea:focus,
.otm-tool input:focus,
.otm-tool textarea:focus,
.shm-tool textarea:focus,
.shm-tool select:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--ink);
}

/* ---------------------------------------------------------------- Boutons */
.rti-btn,
.gsf-btn,
.glt-btn,
.otm-btn,
.shm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-ui);
  font-size: var(--t-small);
  font-weight: 600;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.55rem 1rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.rti-btn:hover,
.gsf-btn:hover,
.glt-btn:hover,
.otm-btn:hover,
.shm-btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.gsf-btn-primary,
.glt-btn-primary,
.shm-btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.gsf-btn-small,
.glt-btn-small {
  padding: 0.3rem 0.6rem;
  font-size: var(--t-micro);
  font-weight: 500;
}

.rti-actions,
.gsf-actions,
.glt-actions,
.otm-actions,
.shm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

/* --------------------------------------------------- Sorties « fichier » */
/* Geste signature : la sortie d'un outil est un artefact qu'on emporte,
   présentée comme un fichier plutôt que comme une zone de texte. */
.rti-out,
.gsf-out,
.glt-out,
.otm-out,
.shm-out {
  width: 100%;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink);
  border-radius: 2px;
  padding: 1rem 1.15rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 30rem;
  tab-size: 2;
}

/* ------------------------------------------------------------- Alertes */
/* Le stylo rouge : une alerte doit se distinguer de la couleur de marque,
   sinon elle se lit comme une simple information. */
.rti-warn,
.gsf-alerts li,
.glt-alerts li,
.shm-alerts li {
  font-size: var(--t-small);
  line-height: 1.5;
  color: var(--ink);
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  border-radius: 0 2px 2px 0;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
}

.gsf-alerts,
.glt-alerts,
.shm-alerts {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.otm-checks {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.otm-checks li {
  font-size: var(--t-small);
  padding: 0.5rem 0.8rem;
  border-left: 3px solid var(--rule-strong);
  background: var(--sunk);
  border-radius: 0 2px 2px 0;
  margin-bottom: 0.4rem;
}

/* ------------------------------------------------------- Blocs et groupes */
.rti-group,
.gsf-pair,
.glt-section {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--paper);
}

.glt-link {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--raised);
}

.gsf-pair-head,
.glt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.gsf-pair-head span,
.glt-meta {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-faint);
}

/* --------------------------------------------------------- Robots.txt */
.rti-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.rti-presets label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--t-micro);
  font-family: var(--font-mono);
  font-weight: 500;
  margin: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.45rem 0.7rem;
  background: var(--paper);
  cursor: pointer;
}

.rti-presets label:hover {
  border-color: var(--ink);
}

.rti-presets input {
  accent-color: var(--red);
}

.rti-bot {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: var(--t-small);
  font-weight: 400;
  padding: 0.4rem 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}

.rti-bot:last-child {
  border-bottom: 0;
}

.rti-bot input {
  margin-top: 0.25rem;
  accent-color: var(--red);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.rti-bot code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
}

.rti-bot small {
  color: var(--ink-faint);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ------------------------------------------------- Title & Meta : jauges */
.otm-gauge {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-faint);
  margin: 0 0 1rem;
}

.otm-gauge b {
  color: var(--ink);
}

.otm-over {
  color: var(--red);
  font-weight: 600;
}

.otm-bar {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--sunk);
  margin-top: 0.4rem;
  overflow: hidden;
}

.otm-bar span {
  display: block;
  height: 4px;
  background: var(--ink);
  width: 0;
}

.otm-previews {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .otm-previews {
    grid-template-columns: 1fr 1fr;
  }
}

.otm-card {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1rem;
  background: var(--paper);
}

.otm-card h5 {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
  font-weight: 500;
}

/* L'aperçu SERP doit ressembler à un vrai résultat Google, pas au site :
   c'est un simulateur, sa fidélité prime sur la cohérence de charte. */
.otm-serp-url {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0 0 0.15rem;
}

.otm-serp-title {
  font-family: Arial, sans-serif;
  font-size: 1.125rem;
  color: #1a0dab;
  margin: 0 0 0.25rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.otm-serp-desc {
  font-family: Arial, sans-serif;
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}

.otm-ia {
  font-family: var(--font-prose);
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--ink);
}

.otm-ia cite {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-style: normal;
}

/* ------------------------------------------------------- llms.txt : dépôt */
.glt-drop {
  border: 2px dashed var(--rule-strong);
  border-radius: 3px;
  padding: 1.5rem;
  text-align: center;
  font-size: var(--t-small);
  color: var(--ink-soft);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.glt-drop:hover {
  border-color: var(--ink);
  background: var(--sunk);
}

/* ------------------------------------------------------- Snippet IA */
.snip-tool {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.15rem, 3vw, 1.75rem);
}
.snip-tool h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.snip-tool h4:first-of-type {
  margin-top: 0;
}
.snip-tool select,
.snip-tool textarea {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.55rem 0.7rem;
}
.snip-tool textarea {
  width: 100%;
  min-height: 12rem;
  resize: vertical;
  line-height: 1.6;
}
.snip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.snip-preview {
  margin-top: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
}

/* ------------------------------------------------------- Checklist GEO */
.chk-tool {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.15rem, 3vw, 1.75rem);
}
.chk-tool > h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.chk-layout {
  display: grid;
  gap: 1.75rem;
}
@media (min-width: 980px) {
  .chk-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    align-items: start;
  }
  /* Le score reste visible pendant qu'on coche : c'est le retour immédiat
     qui rend la checklist utilisable, pas la liste elle-même. */
  .chk-score {
    position: sticky;
    top: 5rem;
  }
}
.chk-group {
  margin-bottom: 1.75rem;
}
.chk-group h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.chk-group__lede {
  font-family: var(--font-prose);
  font-size: var(--t-small);
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}
.chk-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.chk-item:last-child {
  border-bottom: 0;
}
.chk-item input {
  margin-top: 0.3rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--red);
  flex-shrink: 0;
}
.chk-item__label {
  font-size: var(--t-small);
  font-weight: 600;
  line-height: 1.4;
}
.chk-item__weight {
  display: inline-block;
  margin-left: 0.35em;
  padding: 0.05em 0.4em;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: 0.12em;
  background: var(--sunk);
  color: var(--ink-soft);
}
.chk-item__weight[data-w="3"] {
  background: var(--red-soft);
  color: var(--red);
}
.chk-item__weight[data-w="2"] {
  background: var(--highlight);
  color: var(--mark-ink);
}
.chk-item__help {
  display: block;
  font-family: var(--font-prose);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
.chk-item__help code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--sunk);
  padding: 0.05em 0.3em;
  border-radius: 2px;
}
.chk-score {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink);
  border-radius: 2px;
  padding: 1.15rem;
}
.chk-score__number {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
.chk-score__number > span:first-child {
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background-image: linear-gradient(transparent 62%, var(--highlight) 62%, var(--highlight) 92%, transparent 92%);
}
.chk-score__total {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.chk-score__verdict {
  font-weight: 600;
  font-size: var(--t-small);
  margin-top: 0.4rem;
}
.chk-score__bars {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.chk-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
}
.chk-bar__label {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.chk-bar__value {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
}
.chk-bar__track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 3px;
  background: var(--sunk);
  overflow: hidden;
}
.chk-bar__fill {
  display: block;
  height: 5px;
  background: var(--ink);
  transition: width 200ms ease;
}

.otm-card__title {
  font-family: var(--font-mono) !important;
  font-size: var(--t-micro) !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: var(--ink-faint) !important;
  border-bottom: 0 !important;
  margin: 0 0 0.75rem !important;
  padding-bottom: 0 !important;
}
