/* ==========================================================
   WeddingPart — App Shell (PWA install + Notifications)
   Style SaaS, palette brand respectée (rose poudré + champagne + sauge)
   ========================================================== */

:root {
  --idd-z-bell-panel: 1300;
  --idd-z-ios-modal:  1400;
  --idd-z-banner:     900;
}

/* ==========================================================
   Bouton "Installer l'app" (header)
   ========================================================== */
.idd-install-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--wp-brand-border, rgba(181,99,122,.22));
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: var(--text-sm, .875rem);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.idd-install-btn:hover {
  background: var(--wp-brand, #B5637A);
  color: #fff;
  border-color: var(--wp-brand, #B5637A);
  transform: translateY(-1px);
}
.idd-install-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--wp-brand-soft, rgba(181,99,122,.18));
}
.idd-install-btn__icon { flex-shrink: 0; }

/* Variante mobile : icône seule */
@media (max-width: 640px) {
  .idd-install-btn { padding: .45rem .6rem; gap: 0; }
  .idd-install-btn__label { display: none; }
}

/* Cache si déjà en mode standalone (PWA installée) */
@media all and (display-mode: standalone) {
  .idd-install-btn { display: none !important; }
}

/* ==========================================================
   Cloche de notifications (header)
   ========================================================== */
.idd-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--wp-soft, #6E5A60);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.idd-bell:hover {
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
  border-color: var(--wp-brand-border, rgba(181,99,122,.22));
}
.idd-bell:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--wp-brand-soft, rgba(181,99,122,.18));
}
.idd-bell svg { width: 20px; height: 20px; }
.idd-bell.is-active {
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
}

/* Badge compteur non-lus — collé en haut-droite DANS le bouton, par-dessus
   le coin haut-droit de l'icône cloche.
   Le bouton fait 40 × 40 px, l'icône SVG est centrée à l'intérieur.
   On ancre le badge à 4 px du coin haut-droit du bouton — il chevauche
   visuellement le sommet droit de la cloche sans déborder du bouton.
   Le liseré blanc est un box-shadow (n'agrandit pas la boîte), donc le
   badge ne dépasse jamais. */
.idd-bell__badge {
  position: absolute;
  top: 4px; right: 4px;
  transform-origin: 100% 0%;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--wp-danger, #EF4444);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
  display: none;
  animation: idd-bell-pop .25s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
  /* Liseré blanc + ombre portée via box-shadow → n'élargit pas la boîte
     (contrairement à un border 2px qui aurait fait grossir le badge et
     l'aurait fait déborder du bouton). */
  box-shadow: 0 0 0 2px var(--wp-bg, #FDFAF8), 0 1px 3px rgba(0,0,0,.18);
  z-index: 2;
}
.idd-bell.has-unread .idd-bell__badge { display: block; }

@keyframes idd-bell-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Sur mobile : bouton cloche et badge agrandis pour rester visibles
   sur écrans haute densité (Retina) où 14×14 px paraît minuscule. */
@media (max-width: 768px) {
  .idd-bell {
    width: 44px;
    height: 44px;
  }
  .idd-bell svg { width: 22px; height: 22px; }
  .idd-bell__badge {
    top: 5px; right: 5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 18px;
  }
}

/* Dot subtle si > 0 mais non-numérique (mobile cas spécial) */
.idd-bell__dot {
  position: absolute;
  top: 9px; right: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wp-brand, #B5637A);
  border: 2px solid var(--wp-bg, #FDFAF8);
  box-sizing: content-box;
  display: none;
}

/* ==========================================================
   Panel notifications — desktop dropdown
   ========================================================== */
.idd-notif-panel {
  position: fixed;
  top: calc(var(--header-h, 64px) + 12px);
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: min(560px, calc(100dvh - var(--header-h, 64px) - 32px));
  background: #fff;
  border: 1px solid var(--wp-line, #EDE0E4);
  border-radius: 20px;
  box-shadow: 0 24px 64px -12px rgba(29,24,25,.22), 0 0 0 1px rgba(181,99,122,.04);
  z-index: var(--idd-z-bell-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s cubic-bezier(.22,.61,.36,1), transform .2s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
  visibility: hidden;
}
.idd-notif-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}
body.admin-bar .idd-notif-panel { top: calc(var(--header-h, 64px) + 12px + 32px); }
@media (max-width: 782px) {
  body.admin-bar .idd-notif-panel { top: calc(var(--header-h, 64px) + 12px + 46px); }
}

/* Header panel */
.idd-notif-panel__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wp-line, #EDE0E4);
  background: linear-gradient(to bottom, var(--wp-bg, #FDFAF8), #fff);
}
/* Le titre prend tout l'espace dispo → mark-all et close se collent à droite */
.idd-notif-panel__head .idd-notif-panel__title { flex: 1 1 auto; min-width: 0; }
.idd-notif-panel__title {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--wp-ink, #1D1819);
  letter-spacing: -.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.idd-notif-panel__count {
  font-family: var(--font-sans, 'DM Sans', system-ui, sans-serif);
  font-size: 11px;
  font-weight: 700;
  background: var(--wp-brand, #B5637A);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.idd-notif-panel__mark-all {
  background: transparent;
  border: 0;
  color: var(--wp-brand, #B5637A);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s ease;
  font-family: inherit;
}
.idd-notif-panel__mark-all:hover { background: var(--wp-brand-soft, rgba(181,99,122,.09)); }
.idd-notif-panel__mark-all:disabled { opacity: .4; cursor: not-allowed; }

/* Bouton X de fermeture du panneau notifications — rouge cercle */
.idd-notif-panel__close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #FEE2E2;            /* rouge très clair en fond */
  color: #DC2626;                  /* rouge vif pour l'icône */
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.idd-notif-panel__close svg {
  width: 18px;
  height: 18px;
  display: block;
}
.idd-notif-panel__close:hover {
  background: #DC2626;
  color: #fff;
  transform: scale(1.05);
}
.idd-notif-panel__close:focus-visible {
  outline: 2px solid #DC2626;
  outline-offset: 2px;
}
.idd-notif-panel__close:active {
  transform: scale(0.96);
}

/* Body scrollable */
.idd-notif-panel__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
}

/* Item */
.idd-notif-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  transition: background .15s ease;
  cursor: pointer;
  position: relative;
  align-items: start;
}
.idd-notif-item:hover { background: var(--wp-surface-2, #FAF5F3); }
.idd-notif-item.is-unread {
  background: linear-gradient(to right, var(--wp-brand-soft, rgba(181,99,122,.09)) 0%, rgba(181,99,122,.03) 100%);
}
.idd-notif-item.is-unread:hover {
  background: var(--wp-brand-soft, rgba(181,99,122,.13));
}
.idd-notif-item + .idd-notif-item { margin-top: 2px; }

.idd-notif-item__icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
}
.idd-notif-item__icon svg { width: 18px; height: 18px; }
.idd-notif-item[data-type="success"] .idd-notif-item__icon { background: var(--wp-success-bg, rgba(16,185,129,.10)); color: var(--wp-success, #059669); }
.idd-notif-item[data-type="warning"] .idd-notif-item__icon { background: var(--wp-warning-bg, rgba(245,158,11,.10)); color: var(--wp-warning, #F59E0B); }
.idd-notif-item[data-type="billing"] .idd-notif-item__icon { background: rgba(201,168,124,.18); color: var(--wp-gold-dark, #B0926A); }
.idd-notif-item[data-type="tool"]    .idd-notif-item__icon { background: var(--wp-sage-light, #E6EFE7); color: var(--wp-sage-dark, #5F8066); }
.idd-notif-item[data-type="system"]  .idd-notif-item__icon { background: rgba(59,130,246,.10); color: var(--wp-info, #3B82F6); }

.idd-notif-item__body { min-width: 0; }
.idd-notif-item__title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--wp-ink, #1D1819);
  line-height: 1.35;
  margin: 0 0 2px;
}
.idd-notif-item__text {
  font-size: .82rem;
  color: var(--wp-soft, #6E5A60);
  line-height: 1.45;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.idd-notif-item__hero {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--wp-line, #EDE0E4);
  margin: 4px 0 8px;
}
.idd-notif-item.has-hero .idd-notif-item__text { -webkit-line-clamp: 3; }
.idd-notif-item__action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--wp-brand, #B5637A);
  text-decoration: none;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--wp-brand-border, rgba(181,99,122,.22));
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.idd-notif-item__action:hover {
  background: var(--wp-brand, #B5637A);
  color: #fff;
  border-color: var(--wp-brand, #B5637A);
}
.idd-notif-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.idd-notif-item__time {
  font-size: 11px;
  color: var(--wp-muted, #A08D93);
  white-space: nowrap;
}
.idd-notif-item__close {
  background: transparent;
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--wp-muted, #A08D93);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.idd-notif-item:hover .idd-notif-item__close { opacity: 1; }
.idd-notif-item__close:hover { background: var(--wp-danger-bg, rgba(239,68,68,.10)); color: var(--wp-danger, #EF4444); }
.idd-notif-item__close svg { width: 12px; height: 12px; }

/* Dot non-lu (overlay sur l'icône) */
.idd-notif-item.is-unread::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: var(--wp-brand, #B5637A);
}

/* Empty state */
.idd-notif-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--wp-soft, #6E5A60);
}
.idd-notif-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}
.idd-notif-empty__icon svg { width: 26px; height: 26px; }
.idd-notif-empty__title {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wp-ink, #1D1819);
  margin: 0 0 4px;
}
.idd-notif-empty__text {
  font-size: .85rem;
  margin: 0;
}

/* Loading skeleton */
.idd-notif-skel { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.idd-notif-skel__row {
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(90deg,
    var(--wp-surface-2, #FAF5F3) 25%,
    var(--wp-line, #EDE0E4) 50%,
    var(--wp-surface-2, #FAF5F3) 75%);
  background-size: 200% 100%;
  animation: idd-shimmer 1.4s infinite linear;
}
@keyframes idd-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Footer panel (préférences + dashboard) */
.idd-notif-panel__foot {
  flex-shrink: 0;
  padding: 10px;
  border-top: 1px solid var(--wp-line, #EDE0E4);
  display: flex;
  justify-content: space-around;
  gap: 12px;
}
.idd-notif-panel__foot a {
  font-size: .8rem;
  font-weight: 600;
  color: var(--wp-brand, #B5637A);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background .15s;
}
.idd-notif-panel__foot a:hover {
  background: rgba(181, 99, 122, 0.08);
}

/* Overlay (mobile) */
.idd-notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29,24,25,.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: calc(var(--idd-z-bell-panel) - 1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  display: none;
}

/* ==========================================================
   Panel mobile : bottom-sheet plein écran
   Breakpoint à 768px pour couvrir aussi les tablettes en portrait
   et les téléphones Plus en paysage (sinon le panel garde le layout
   dropdown 380px et déborde à droite).
   ========================================================== */
@media (max-width: 768px) {
  /* Le sélecteur double force la spécificité au-dessus de
     `body.admin-bar .idd-notif-panel` (0,2,1). Sans ça, l'admin-bar
     écrasait `top` et le panel restait planté en haut au lieu de
     remonter en bottom-sheet, débordant l'écran. */
  .idd-notif-panel,
  body.admin-bar .idd-notif-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    /* Hauteur calculée en dur depuis le bas : on garde une zone safe
       en haut (50px) pour laisser respirer + voir le contexte derrière. */
    max-height: calc(100dvh - 50px);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transform-origin: bottom center;
    /* Safe area iOS (notch / home indicator). */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .idd-notif-panel.is-open,
  body.admin-bar .idd-notif-panel.is-open { transform: translateY(0); }

  .idd-notif-panel__head {
    padding: 18px 20px 14px;
    position: relative;
  }
  /* Handle de bottom-sheet (la petite barre grise centrée tout en haut). */
  .idd-notif-panel__head::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 42px; height: 4px;
    border-radius: 2px;
    background: var(--wp-line-strong, #DECFD5);
  }

  .idd-notif-overlay { display: block; }
  .idd-notif-overlay.is-open { opacity: 1; pointer-events: auto; }

  /* Toujours afficher la croix sur mobile (pas de hover) */
  .idd-notif-item__close { opacity: .5; }
}

/* ==========================================================
   Modal iOS "Comment installer"
   ========================================================== */
.idd-ios-modal {
  position: fixed;
  inset: 0;
  z-index: var(--idd-z-ios-modal);
  display: grid;
  place-items: center;
  padding: 16px;
}
.idd-ios-modal[hidden] { display: none; }

.idd-ios-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(29,24,25,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.idd-ios-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 24px;
  max-width: 420px;
  width: 100%;
  padding: 32px 24px 24px;
  box-shadow: 0 24px 80px rgba(29,24,25,.3);
  animation: idd-modal-in .25s cubic-bezier(.22,.61,.36,1);
}
@keyframes idd-modal-in {
  from { opacity: 0; transform: scale(.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.idd-ios-modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--wp-surface-2, #FAF5F3);
  color: var(--wp-soft, #6E5A60);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease, color .15s ease;
}
.idd-ios-modal__close:hover { background: var(--wp-brand-soft, rgba(181,99,122,.09)); color: var(--wp-brand, #B5637A); }

.idd-ios-modal__head { text-align: center; margin-bottom: 24px; }
.idd-ios-modal__head img {
  width: 64px; height: 64px;
  border-radius: 18px;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(29,24,25,.12);
}
.idd-ios-modal__head h2 {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--wp-ink, #1D1819);
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.idd-ios-modal__head p {
  color: var(--wp-soft, #6E5A60);
  font-size: .9rem;
  line-height: 1.45;
  margin: 0;
}

.idd-ios-modal__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.idd-ios-modal__steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--wp-surface-2, #FAF5F3);
  padding: 12px 14px;
  border-radius: 14px;
}
.idd-ios-step__num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--wp-brand, #B5637A);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.idd-ios-step__text {
  font-size: .88rem;
  color: var(--wp-ink, #1D1819);
  line-height: 1.5;
}

/* ==========================================================
   Bandeau dashboard : "Installe l'app pour..."
   ========================================================== */
.idd-install-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--wp-brand-soft, rgba(181,99,122,.09)) 0%, var(--wp-gold-light, #F7EFE3) 100%);
  border: 1px solid var(--wp-brand-border, rgba(181,99,122,.22));
  border-radius: 18px;
  padding: 18px 20px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}
.idd-install-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(181,99,122,.08), transparent 60%);
  pointer-events: none;
}
.idd-install-banner__icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--wp-brand, #B5637A);
  border: 1px solid var(--wp-brand-border, rgba(181,99,122,.22));
}
.idd-install-banner__icon svg { width: 28px; height: 28px; }
.idd-install-banner__body { flex: 1; min-width: 0; position: relative; }
.idd-install-banner__title {
  font-family: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--wp-ink, #1D1819);
  margin: 0 0 2px;
  letter-spacing: -.01em;
}
.idd-install-banner__text {
  color: var(--wp-soft, #6E5A60);
  font-size: .87rem;
  margin: 0;
  line-height: 1.45;
}
.idd-install-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}
.idd-install-banner__cta {
  background: var(--wp-brand, #B5637A);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  font-family: inherit;
  white-space: nowrap;
}
.idd-install-banner__cta:hover { background: var(--wp-brand-dark, #9A4F65); transform: translateY(-1px); }
.idd-install-banner__dismiss {
  background: transparent;
  border: 0;
  color: var(--wp-soft, #6E5A60);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.idd-install-banner__dismiss:hover { background: rgba(0,0,0,.04); }

@media (max-width: 600px) {
  .idd-install-banner { flex-direction: column; text-align: center; padding: 20px 16px; }
  .idd-install-banner__icon { margin: 0 auto; }
  .idd-install-banner__actions { width: 100%; justify-content: center; }
}

/* Masque le bandeau si app installée */
@media all and (display-mode: standalone) {
  .idd-install-banner { display: none !important; }
}

/* ==========================================================
   Toast (notification temporaire en bas — visuel de feedback)
   ========================================================== */
.idd-toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.idd-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--wp-line, #EDE0E4);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(29,24,25,.18);
  font-size: .87rem;
  color: var(--wp-ink, #1D1819);
  font-weight: 500;
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  animation: idd-toast-in .25s cubic-bezier(.22,.61,.36,1);
}
.idd-toast.is-leaving { animation: idd-toast-out .2s ease forwards; }
.idd-toast__icon {
  width: 28px; height: 28px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--wp-success-bg, rgba(16,185,129,.10));
  color: var(--wp-success, #059669);
}
.idd-toast__icon svg { width: 16px; height: 16px; }
.idd-toast[data-type="error"]   .idd-toast__icon { background: var(--wp-danger-bg, rgba(239,68,68,.10)); color: var(--wp-danger, #EF4444); }
.idd-toast[data-type="info"]    .idd-toast__icon { background: var(--wp-brand-soft, rgba(181,99,122,.09)); color: var(--wp-brand, #B5637A); }
.idd-toast[data-type="warning"] .idd-toast__icon { background: var(--wp-warning-bg, rgba(245,158,11,.10)); color: var(--wp-warning, #F59E0B); }

@keyframes idd-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes idd-toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 640px) {
  .idd-toast-stack { left: 12px; right: 12px; bottom: 12px; }
  .idd-toast { min-width: 0; width: 100%; max-width: 100%; }
}

/* ==========================================================
   Réduit la motion si user le demande
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .idd-notif-panel,
  .idd-ios-modal__panel,
  .idd-toast,
  .idd-bell__badge,
  .idd-notif-skel__row {
    animation: none !important;
    transition: opacity .1s linear !important;
    transform: none !important;
  }
}

/* ==========================================================
   Push prompt — encart dans le panel notifs pour activer les notifs OS
   ========================================================== */
.idd-push-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px;
  padding: 12px;
  background: linear-gradient(135deg, var(--wp-brand-soft, rgba(181,99,122,.09)) 0%, var(--wp-gold-light, #F7EFE3) 100%);
  border: 1px solid var(--wp-brand-border, rgba(181,99,122,.22));
  border-radius: 12px;
  position: relative;
}
.idd-push-prompt[hidden] { display: none; }
.idd-push-prompt__icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #fff;
  color: var(--wp-brand, #B5637A);
  flex-shrink: 0;
}
.idd-push-prompt__icon svg { width: 18px; height: 18px; }
.idd-push-prompt__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.idd-push-prompt__body strong {
  font-size: .82rem;
  color: var(--wp-ink, #1D1819);
  font-weight: 700;
}
.idd-push-prompt__body span {
  font-size: .72rem;
  color: var(--wp-soft, #6E5A60);
  line-height: 1.3;
}
.idd-push-prompt__btn {
  background: var(--wp-brand, #B5637A);
  color: #fff;
  border: 0;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s ease;
}
.idd-push-prompt__btn:hover { background: var(--wp-brand-dark, #9A4F65); }
.idd-push-prompt__dismiss {
  background: transparent;
  border: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--wp-muted, #A08D93);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.idd-push-prompt__dismiss:hover {
  background: rgba(0,0,0,.06);
  color: var(--wp-ink, #1D1819);
}
.idd-push-prompt__dismiss svg { width: 12px; height: 12px; }

/* ==========================================================
   MODE PWA — quand body.is-pwa est posé (display-mode standalone)
   Expérience app pure : pas de menu marketing, pas de footer site,
   header minimal axé outils.
   ========================================================== */
html.is-pwa,
body.is-pwa {
  /* Safe area pour iOS notch */
  --idd-safe-top: env(safe-area-inset-top, 0px);
  --idd-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Cache le menu marketing principal (desktop + offcanvas mobile garde le menu outils) */
body.is-pwa .nav__menu--desktop { display: none !important; }

/* Cache le footer du site marketing (s'il existe) */
body.is-pwa .site-footer,
body.is-pwa footer.site-footer {
  display: none !important;
}

/* Cache le bouton "Installer l'app" : on est déjà dans l'app */
body.is-pwa .idd-install-btn,
body.is-pwa .idd-install-banner { display: none !important; }

/* Cache le bouton "Commencer gratuitement" + le lien Connexion (redondant en mode app) */
body.is-pwa .nav__actions .btn--primary { display: none !important; }
body.is-pwa .nav__actions .nav__login:not(.nav__login--account) { display: none !important; }

/* Le header devient plus compact en PWA */
body.is-pwa .site-header {
  padding-top: var(--idd-safe-top);
}
body.is-pwa .site-header::after { display: none; } /* scroll progress bar inutile en app */

/* Tab bar inférieure facultative (pas activée par défaut mais réservée) */
body.is-pwa { padding-bottom: var(--idd-safe-bottom); }

/* Cache l'admin bar WP même côté CSS au cas où elle aurait été injectée avant le filtre */
body.is-pwa #wpadminbar { display: none !important; }
html.is-pwa { margin-top: 0 !important; }

/* Quand on est en PWA, le burger reste utile (menu outils via offcanvas) */
body.is-pwa .nav__toggle { display: inline-flex !important; }

/* Cache spécifiquement les items "marketing" du menu mobile (tag par classe CSS de leur item)
   — si l'admin a tagué des items "is-marketing" dans WP Admin → Apparence → Menus, ils disparaissent.
   Sinon, le menu mobile reste tel quel (l'utilisateur navigue librement). */
body.is-pwa .menu--mobile li.is-marketing,
body.is-pwa .menu--mobile li.menu-marketing { display: none !important; }

/* ==========================================================
   FIX MOBILE LAYOUT
   ========================================================== */

/* Sur très petit écran : bouton install caché (le bandeau du dashboard prend le relais) */
@media (max-width: 420px) {
  .idd-install-btn { display: none !important; }
}

/* Resserre les gaps du header sur mobile pour éviter l'overflow */
@media (max-width: 640px) {
  .site-header .nav__actions { gap: 6px !important; }
  .idd-bell { width: 38px; height: 38px; }
  .idd-bell svg { width: 18px; height: 18px; }
}

/* Si admin bar masquée mais classe encore là, force le top */
body.is-pwa.admin-bar .site-header,
html.is-pwa body.admin-bar .site-header {
  top: var(--idd-safe-top, 0) !important;
}
body.is-pwa.admin-bar,
html.is-pwa body.admin-bar { margin-top: 0 !important; }

/* Garde le panel notifs aligné sous le header même sans variable */
.idd-notif-panel {
  top: 72px;
}
body.is-pwa .idd-notif-panel {
  top: calc(60px + var(--idd-safe-top, 0px));
}
@media (max-width: 640px) {
  .idd-notif-panel {
    /* Sur mobile c'est un bottom-sheet, top n'a pas d'effet */
    top: auto !important;
  }
}

/* Splash : pas de header parasite si le thème injecte qq chose après */
html.idd-splash body > header,
html.idd-splash body > .site-header,
html.idd-splash body > footer { display: none !important; }

/* ==========================================================
   Menu outils dans l'offcanvas mobile (mode PWA)
   Injecté en JS par pwa-shell.js
   ========================================================== */
.idd-app-nav { padding: 0; }
.idd-app-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.idd-app-nav__item { margin: 0; }
.idd-app-nav__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--wp-ink, #1D1819);
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  min-height: 52px;
}
.idd-app-nav__link:hover,
.idd-app-nav__link:focus-visible {
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
  outline: none;
}
.idd-app-nav__item.is-active .idd-app-nav__link {
  background: var(--wp-brand-soft, rgba(181,99,122,.12));
  color: var(--wp-brand, #B5637A);
  border-color: var(--wp-brand-border, rgba(181,99,122,.25));
}
.idd-app-nav__icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--wp-brand-soft, rgba(181,99,122,.09));
  color: var(--wp-brand, #B5637A);
  transition: background .15s ease, color .15s ease;
}
.idd-app-nav__icon svg { width: 18px; height: 18px; }
.idd-app-nav__item.is-active .idd-app-nav__icon {
  background: var(--wp-brand, #B5637A);
  color: #fff;
}
.idd-app-nav__label { flex: 1; min-width: 0; }

/* ==========================================================
   ADAPTATIONS — Cloche & Install button dans le template outils
   (.app-header__actions a son propre design system)
   ========================================================== */

/* Cloche : harmonise avec les autres boutons de la barre outils */
.app-header__actions .idd-bell {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--app-line, var(--wp-line, #EDE0E4));
  background: var(--app-surface, #fff);
  color: var(--app-ink, var(--wp-ink, #1D1819));
}
.app-header__actions .idd-bell:hover {
  background: var(--app-brand-soft, var(--wp-brand-soft, rgba(181,99,122,.09)));
  border-color: var(--app-brand-border, var(--wp-brand-border, rgba(181,99,122,.22)));
  color: var(--app-brand-dark, var(--wp-brand-dark, #9A4F65));
}
.app-header__actions .idd-bell.is-active {
  background: var(--app-brand-soft, var(--wp-brand-soft, rgba(181,99,122,.09)));
  color: var(--app-brand-dark, var(--wp-brand-dark, #9A4F65));
}
.app-header__actions .idd-bell svg { width: 20px; height: 20px; stroke-width: 1.8; }

/* Mobile WCAG : 44x44 minimum */
@media (max-width: 768px) {
  .app-header__actions .idd-bell { width: 44px; height: 44px; }
}

/* Bouton install : même taille que les autres boutons du header outils */
.app-header__actions .idd-install-btn {
  height: 42px;
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid var(--app-brand-border, var(--wp-brand-border));
  background: var(--app-brand-soft, var(--wp-brand-soft));
  color: var(--app-brand-dark, var(--wp-brand-dark, #9A4F65));
  font-size: 13px;
  font-weight: 700;
}
.app-header__actions .idd-install-btn:hover {
  background: var(--app-brand, var(--wp-brand, #B5637A));
  color: #fff;
  border-color: var(--app-brand, var(--wp-brand, #B5637A));
}
@media (max-width: 768px) {
  .app-header__actions .idd-install-btn { height: 44px; padding: 0 10px; }
  .app-header__actions .idd-install-btn__label { display: none; } /* gain de place */
}

/* Badge "non-lu" : ancré sur le coin haut-droit de l'icône cloche,
   à L'INTÉRIEUR des bornes du bouton 42×42 radius 12 (pour ne pas être clipé
   ni paraître flotter au-dessus du bouton). Légèrement agrandi pour rester
   lisible (font 10px line-height 16px) et liseré blanc plus marqué. */
.app-header__actions .idd-bell__badge {
  top: 6px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
  border: 0;
  box-shadow: 0 0 0 2px var(--app-surface, #fff), 0 1px 3px rgba(0,0,0,.22);
}
@media (max-width: 768px) {
  .app-header__actions .idd-bell__badge {
    top: 7px;
    right: 7px;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 18px;
  }
}

/* ==========================================================
   PANEL NOTIFICATIONS — positionnement contextuel
   Sur la page outils, le header fait 68px et est sticky.
   Le panel doit s'aligner sous le bouton cloche.
   ========================================================== */
body.idd-tools-body .idd-notif-panel {
  /* L'.app-header est sticky top:0 hauteur 68px */
  top: 80px;
}
@media (max-width: 768px) {
  body.idd-tools-body .idd-notif-panel { top: 76px; }
}

/* Sur la version mobile bottom-sheet (≤640px), la position absolute bottom
   doit primer sur les overrides top */
@media (max-width: 640px) {
  body.idd-tools-body .idd-notif-panel {
    top: auto !important;
    bottom: 0 !important;
  }
}

/* ==========================================================
   MOBILE — Header outils ne déborde pas
   On masque le brand-tag et le tools-btn label pour gagner de la place
   ========================================================== */
@media (max-width: 480px) {
  /* Le label "Vos outils mariage" du brand prend trop de place */
  .app-header__brand-tag { display: none !important; }
  /* L'eyebrow "OUTIL" au-dessus du titre courant aussi */
  .app-header__current-eyebrow { display: none !important; }
  /* Réduit le gap pour serrer */
  .app-header__actions { gap: 6px !important; }
}

@media (max-width: 360px) {
  /* Sur ultra-small : cache l'install (la cloche reste prioritaire) */
  .app-header__actions .idd-install-btn { display: none; }
  /* Avatar plus compact */
  .app-header__account-name { display: none; }
}

/* ==========================================================
   PWA mode : header outils gagne du safe-area (notch iOS)
   ========================================================== */
body.is-pwa .app-header {
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--app-header-h, 68px) + env(safe-area-inset-top, 0px));
}
