/* NOTIFICATIONS EN DIRECT (29/09/2026) — encarts en surimpression, coin bas droit.
   Au-dessus des modales (100), de la palette (120). Les <dialog> natifs sont dans la couche
   supérieure du navigateur, hors d'atteinte d'un z-index : depuis le 09/10/2026, la zone est
   DÉPLACÉE dans la fenêtre native ouverte au premier plan (_notifications.html.twig). La zone laisse
   passer les clics là où il n'y a pas d'encart. */
.kl-notifs {
  position: fixed; right: 16px; bottom: 16px; z-index: 130;
  width: min(360px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.kl-notifs:empty { display: none; }
.kl-notif {
  pointer-events: auto; position: relative;
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border-lit); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--lift), var(--glow);
}
.kl-notif-message { border-left-color: var(--accent-2); }
/* Demande d'un formulaire de klorel.fr (03/10/2026) ; une urgence en rouge. */
.kl-notif-demande { border-left-color: var(--success); }
.kl-notif-urgent { border-left-color: var(--danger); }
.kl-notif-argent { border-left-color: var(--success); }
.kl-notif-alerte { border-left-color: var(--warn); }
.kl-notif-neuve { animation: kl-notif-entree .28s ease-out; }
@keyframes kl-notif-entree { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kl-notif-neuve { animation: none; } }

.kl-notif-lien {
  flex: 1 1 auto; min-width: 0;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 6px 10px 12px; color: var(--fg); text-decoration: none;
}
.kl-notif-lien:hover { text-decoration: none; }
.kl-notif-lien:hover .kl-notif-texte, .kl-notif-lien:focus-visible .kl-notif-texte { color: var(--accent); }
.kl-notif-ico { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.kl-notif-message .kl-notif-ico { color: var(--accent-2); }
.kl-notif-demande .kl-notif-ico { color: var(--success); }
.kl-notif-urgent .kl-notif-ico { color: var(--danger); }
.kl-notif-argent .kl-notif-ico { color: var(--success); }
.kl-notif-alerte .kl-notif-ico { color: var(--warn); }
.kl-notif-ico .ic { width: 20px; height: 20px; display: block; }
.kl-notif-corps { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.kl-notif-titre { font-size: 11px; color: var(--muted); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-notif-titre .nom-propre { color: var(--fg); }
.kl-notif-texte {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--fg);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.kl-notif-detail { font-size: 11px; color: var(--dim); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
/* Le site, en bas à gauche, toujours en entier (13/10/2026) : il passe à la ligne plutôt que d'être coupé. */
.kl-notif-site { color: var(--fg); font-weight: 700; font-size: 11.5px; letter-spacing: .02em; overflow-wrap: anywhere; }
.kl-notif-fermer {
  flex: 0 0 auto; align-self: flex-start;
  width: 32px; height: 32px; margin: 4px 4px 0 0;
  background: none; border: 0; border-radius: 6px;
  color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.kl-notif-fermer:hover, .kl-notif-fermer:focus-visible { color: var(--fg); background: var(--accent-soft); }
.kl-notif-pied {
  pointer-events: auto; align-self: flex-end;
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px 4px 3px 12px;
}
.kl-notif-pied:not(:has(span)) { padding-left: 4px; }
.kl-notif-tout {
  background: none; border: 0; border-radius: 999px; padding: 4px 10px;
  color: var(--accent); font-size: 11.5px; cursor: pointer;
}
.kl-notif-tout:hover, .kl-notif-tout:focus-visible { background: var(--accent-soft); }

/* Téléphone : au-dessus des deux barres basses du HUD (rail + raccourcis, ~104 px). */
@media (max-width: 767px) {
  .kl-notifs { right: 12px; left: 12px; width: auto; bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .kl-notif-fermer { width: 44px; height: 44px; margin: 0; }
  .kl-notif-tout { min-height: 36px; }
}

/* Proposition d'activer les notifications macOS (DELMAK installé en app, 01/10/2026). */
.kl-notif-offre .kl-notif-corps { padding: 10px 12px; gap: 4px; }
.kl-notif-offre .kl-notif-texte { font-weight: 500; font-size: 13px; -webkit-line-clamp: 4; }
.kl-notif-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }

/* ==========================================================================
   DÉTAIL D'UNE NOTIFICATION (Franck, 18/10/2026 : « Clic sur une notification → le détail de la
   notification (comme sur le cockpit), pas la liste ») — templates/notifications/detail.html.twig, ouvert
   dans la fenêtre du hub. Mobile d'abord : une colonne, les actions passent à la ligne, cibles de 44 px au
   doigt ; ‹ › en tête pour passer aux voisines sans fermer la fenêtre.
   ========================================================================== */
.nt-detail { max-width: 760px; }
.nt-detail-h1 { margin: 0 0 12px; }
.nt-detail-absente { color: var(--muted); }
.nt-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.nt-nav-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
  border: 1px solid var(--border-lit); border-radius: 999px; background: var(--bg-2);
  color: var(--fg); font-size: 12px; text-decoration: none; white-space: nowrap;
}
a.nt-nav-btn:hover, a.nt-nav-btn:focus-visible { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.nt-nav-btn[aria-disabled="true"] { opacity: .35; }
.nt-nav-btn > span[aria-hidden] { font-size: 16px; line-height: 1; }
.nt-nav-rang { font: 600 11px var(--font-num); color: var(--muted); letter-spacing: .04em; }
.nt-fiche {
  position: relative; padding: 14px 16px 16px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border-lit); border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
}
.nt-fiche.nt-message { border-left-color: var(--accent-2); }
.nt-fiche.nt-demande { border-left-color: var(--success); }
.nt-fiche.nt-urgent { border-left-color: var(--danger); }
.nt-fiche.nt-alerte { border-left-color: var(--warn); }
.nt-fiche-tete { display: flex; align-items: flex-start; gap: 10px; }
.nt-fiche-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.nt-fiche.nt-message .nt-fiche-ico { color: var(--accent-2); background: rgba(124, 108, 246, .14); }
.nt-fiche.nt-demande .nt-fiche-ico { color: var(--success); background: rgba(52, 211, 153, .12); }
.nt-fiche.nt-urgent .nt-fiche-ico { color: var(--danger); background: rgba(251, 95, 122, .13); }
.nt-fiche.nt-alerte .nt-fiche-ico { color: var(--warn); background: rgba(251, 191, 36, .12); }
.nt-fiche-ico .ic { width: 17px; height: 17px; }
.nt-fiche-meta { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-top: 5px; font-size: 12px; color: var(--muted); }
/* Le site en entier, jamais tronqué (même règle que l'encart, 13/10/2026). */
.nt-fiche-site { color: var(--fg); font-weight: 700; letter-spacing: .02em; overflow-wrap: anywhere; }
.nt-fiche-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nt-fiche-origine { color: var(--dim); overflow-wrap: anywhere; }
.nt-fiche-lue {
  flex: none; margin-top: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(53, 208, 242, .35);
}
.nt-fiche-lue[hidden] { display: none; }
.nt-fiche-texte { margin: 12px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.nt-fiche-complet { margin: 8px 0 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; font-size: 13.5px; }
.nt-objet { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 255, 255, .02); }
.nt-objet-genre { margin: 0; font: 600 10.5px var(--font-brand); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.nt-objet-titre { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.nt-detail .nt-lignes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; margin: 8px 0 0; font-size: 13px; }
.nt-detail .nt-lignes dt { color: var(--muted); }
.nt-detail .nt-lignes dd { margin: 0; overflow-wrap: anywhere; }
.nt-fiche-lignes { margin-top: 14px !important; padding-top: 10px; border-top: 1px solid var(--border); }
.nt-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.nt-detail-actions .btn { min-height: 38px; justify-content: center; }
.nt-detail-actions [hidden] { display: none; }
@media (max-width: 599px) {
  .nt-nav-lib { display: none; }
  .nt-nav-btn { min-width: 44px; min-height: 44px; justify-content: center; }
  .nt-fiche { padding: 12px; }
  /* Les libellés sont courts (« Écrit depuis » au plus) : deux colonnes même au téléphone, la valeur passe à la ligne. */
  .nt-detail .nt-lignes { gap: 4px 10px; }
  .nt-detail-actions .btn { min-height: 44px; flex: 1 1 100%; }
}
