/* Bouton « Ajouter à alpha » : petite fenêtre (ajouter.php), « Ajouts récents » (ajouts.php),
   guide « Ajouter des liens » (installer-bouton.php) et le rappel discret du tableau.
   S'appuie sur les variables de panneaux.css (clair et sombre). Gros caractères, gros boutons. */

.aj-ico { width: 20px; height: 20px; flex: none; }
.pn [hidden], .aj-rappel[hidden] { display: none !important; }

/* ---------- Petite fenêtre ---------- */
body.aj-fenetre { font-size: 17px; }
.aj-corps { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.aj-form { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.aj-haut { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 10px; }

.aj-site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aj-fav {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-doux); color: var(--navy); font-weight: 700; font-size: 15px; overflow: hidden;
}
.aj-fav img { position: absolute; inset: 6px; width: 20px; height: 20px; background: var(--accent-doux); }
.aj-site-txt { min-width: 0; display: flex; flex-direction: column; }
.aj-dom { font-weight: 700; color: var(--navy); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aj-url { font-size: 13px; color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.aj-champ { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; color: var(--texte-doux); }
.aj-champ input, .aj-champ select, .aj-filtre input, .aj-classer select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--carte); color: var(--texte); font: inherit; font-size: 17px; font-weight: 400;
}
.aj-champ input:focus, .aj-champ select:focus, .aj-filtre input:focus, .aj-classer select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.aj-note { font-size: 14px; color: var(--texte-doux); }
.aj-erreur { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--danger); color: var(--danger); font-size: 15px; }
.aj-ok { padding: 8px 12px; border-radius: 10px; background: var(--accent-doux); color: var(--navy); font-size: 15px; }

.aj-ou { flex: 1; margin: 0; padding: 4px 16px 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.aj-ou legend { padding: 0; margin-bottom: 8px; font-size: 18px; font-weight: 700; color: var(--navy); float: left; width: 100%; }
.aj-filtre { position: relative; display: block; clear: both; }
.aj-filtre .aj-ico { position: absolute; left: 11px; top: 12px; color: var(--texte-doux); pointer-events: none; }
.aj-filtre input { padding-left: 38px; }
.aj-liste { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; clear: both; }
.aj-groupe { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.aj-groupe-nom { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-doux); }

.aj-choix {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--bord);
  border-radius: 12px; background: var(--carte); cursor: pointer;
}
.aj-choix:hover { border-color: var(--accent); }
.aj-choix input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.aj-choix:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); box-shadow: inset 0 0 0 1px var(--accent); }
.aj-choix:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.aj-choix-txt { display: flex; flex-direction: column; min-width: 0; }
.aj-choix-nom { font-weight: 600; color: var(--texte); overflow-wrap: anywhere; }
.aj-choix-aide { font-size: 13.5px; color: var(--texte-doux); }
.aj-choix-tard .aj-choix-nom { color: var(--navy); }

.aj-rien { font-size: 15px; color: var(--texte-doux); }
.aj-rien .pn-lien-btn { display: block; padding: 6px 0 0; font-size: 15px; text-align: left; }
.aj-nouvelle { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.aj-nouvelle-champs { display: flex; flex-direction: column; gap: 8px; padding: 0 2px 0 34px; }

.aj-bas {
  position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--fond) 92%, transparent); border-top: 1px solid var(--bord);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.aj-ajouter { width: 100%; min-height: 50px; font-size: 18px; }
.aj-ajouter:disabled { opacity: .6; cursor: progress; }

/* « Ajouté » et écrans courts de la fenêtre */
.aj-fait, .aj-connexion {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 24px 20px; text-align: center;
}
.aj-fait h1, .aj-connexion h1 { font-size: 24px; }
.aj-fait-ico {
  align-self: center; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-doux); color: var(--accent);
}
.aj-fait-ico .aj-ico { width: 36px; height: 36px; stroke-width: 2; }
.aj-fait-titre { font-weight: 700; color: var(--navy); overflow-wrap: anywhere; }
.aj-fait-ferme { font-size: 14px; color: var(--texte-doux); }
.aj-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.aj-actions .pn-btn { min-height: 48px; font-size: 16px; }
.aj-marque { font-weight: 800; font-size: 20px; color: var(--navy); letter-spacing: -.01em; }
.aj-connexion .aj-site { justify-content: center; text-align: left; }
.aj-titre-lu { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Ajouts récents ---------- */
.pn .aj-fil { margin-bottom: 10px; font-size: 14px; }
.aj-recents h1, .aj-installer h1 { font-size: 30px; margin-bottom: 8px; }
.aj-recents .pn-lead { margin-bottom: 16px; color: var(--texte-doux); }
.aj-recents .aj-ok, .aj-recents .aj-erreur { margin-bottom: 14px; }
.aj-section { margin-top: 22px; }
.aj-section h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.aj-compte {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  background: var(--accent-doux); color: var(--navy); font-size: 14px;
}
.aj-lignes { display: flex; flex-direction: column; gap: 8px; }
.aj-ligne {
  display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--carte); box-shadow: var(--ombre); scroll-margin-top: 80px;
}
.aj-ligne:target { border-color: var(--accent); }
.aj-ligne-lien { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit !important; }
.aj-ligne-lien:hover .aj-ligne-nom { color: var(--accent); text-decoration: underline; }
.aj-ligne-txt { display: flex; flex-direction: column; min-width: 0; }
.aj-ligne-nom { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.aj-ligne-meta { font-size: 14px; color: var(--texte-doux); overflow-wrap: anywhere; }
.aj-ligne-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aj-classer { display: flex; flex: 1 1 220px; gap: 8px; margin: 0; min-width: 0; }
.aj-classer label { flex: 1; min-width: 0; }
.aj-classer select { font-size: 16px; }
.aj-suppr { margin: 0; }
.aj-suppr-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--bord);
  border-radius: 10px; background: var(--carte); color: var(--texte-doux); font: inherit; font-size: 14px; cursor: pointer;
}
.aj-suppr-btn:hover { border-color: var(--danger); color: var(--danger); }
.aj-vide { padding: 14px; border: 1px dashed var(--bord); border-radius: var(--rayon); color: var(--texte-doux); margin-bottom: 12px; }
.pn .aj-pied-lien { margin-top: 28px; font-size: 14px; color: var(--texte-doux); }
@media (min-width: 720px) {
  .aj-ligne { flex-direction: row; align-items: center; justify-content: space-between; }
  .aj-ligne-lien { flex: 1; }
  .aj-ligne-actions { flex: 0 0 auto; flex-wrap: nowrap; width: 360px; }
}

/* ---------- Installer le bouton (même encart que « Suivant ») ---------- */
.aj-signet {
  display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; margin-top: 14px; padding: 16px;
  border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre);
}
@media (min-width: 900px) { .aj-signet { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 26px; padding: 18px 22px; } }
.pn .aj-signet-intro { margin-top: 8px; color: var(--texte-doux); }
.aj-favori .aj-ico { width: 18px; height: 18px; }
.aj-glisser { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
.pn .aj-discret { margin-top: 14px; font-size: 14px; color: var(--texte-doux); }
.pn .aj-tactile { display: none; margin-top: 14px; padding: 14px; border: 1px dashed var(--bord); border-radius: var(--rayon); color: var(--texte-doux); }
@media (hover: none) {
  .aj-signet { display: none !important; }
  .pn .aj-tactile { display: block; }
}

/* ---------- Rappel discret sur le tableau ---------- */
.aj-rappel { margin: 6px 12px 4px; font-size: 13px; }
.aj-rappel a {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border: 1px solid var(--bord, #dfe5ea);
  border-radius: 999px; color: var(--accent, #2f6f94); text-decoration: none; background: transparent;
}
.aj-rappel a:hover { border-color: var(--accent, #2f6f94); }
.aj-rappel .aj-ico { width: 16px; height: 16px; }

/* ---------- Guide « Ajouter des liens » (installer-bouton.php) ---------- */
.aj-guide { max-width: 1100px; }
.pn .aj-g-lead { max-width: 760px; color: var(--texte-doux); }
.pn .aj-g-compte { margin-top: 10px; font-size: 15px; }
.aj-g-sommaire { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 4px; }
.aj-g-sommaire a {
  padding: 5px 12px; border: 1px solid var(--bord); border-radius: 999px; font-size: 14px;
  color: var(--texte); text-decoration: none; background: var(--carte);
}
.aj-g-sommaire a:hover { border-color: var(--accent); color: var(--accent); }
.aj-g-section { margin-top: 28px; scroll-margin-top: 70px; }
.aj-g-section > h2 { display: flex; align-items: center; gap: 8px; font-size: 20px; margin-bottom: 4px; }
.aj-g-section > h2 svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.aj-g-section .aj-signet { margin-top: 8px; }
.aj-g-carte {
  margin-top: 8px; padding: 16px 18px; border: 1px solid var(--bord); border-radius: var(--rayon);
  background: var(--carte); box-shadow: var(--ombre); max-width: 760px;
}
.pn .aj-g-intro { color: var(--texte-doux); margin-bottom: 12px; }
.aj-g-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; }
.aj-g-etapes { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.aj-g-etapes li { padding-left: 2px; }
.pn .aj-g-note { margin-top: 12px; font-size: 14px; color: var(--texte-doux); }
.aj-g-liens { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
