/* ---------- PD-CHAT : assistant FAQ (client-side, no API) ---------- */
.pd-chat-root{
  --pd-chat-bg: var(--paper, #f6f1e6);
  --pd-chat-bg-alt: var(--paper-warm, #efe6d3);
  --pd-chat-ink: var(--ink, #1c1c1a);
  --pd-chat-ink-soft: var(--ink-soft, #4a473e);
  --pd-chat-line: var(--line, rgba(28,28,26,0.12));
  --pd-chat-accent: var(--green-deep, #173226);
  --pd-chat-brass: var(--brass, #c9a227);
  --pd-chat-brass-light: var(--brass-light, #e3c568);
  font-family:'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color:var(--pd-chat-ink);
}

.pd-chat-toggle{
  position:fixed; right:22px; bottom:76px; z-index:60;
  width:56px; height:56px; border-radius:50%;
  border:2px solid var(--pd-chat-brass);
  background:var(--pd-chat-accent); color:#f6f1e6;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:0 10px 28px rgba(0,0,0,0.28);
  transition:transform .2s ease, background .2s ease;
}
.pd-chat-toggle:hover{ transform:translateY(-2px); background:var(--green-mid, #22462f); }
.pd-chat-toggle:focus-visible{ outline:3px solid var(--pd-chat-brass-light); outline-offset:3px; }
.pd-chat-toggle svg{ width:26px; height:26px; }
.pd-chat-toggle .pd-chat-icon-close{ display:none; }
.pd-chat-root.pd-chat-open .pd-chat-toggle .pd-chat-icon-open{ display:none; }
.pd-chat-root.pd-chat-open .pd-chat-toggle .pd-chat-icon-close{ display:block; }

.pd-chat-panel{
  position:fixed; right:22px; bottom:144px; z-index:61;
  padding:0; margin:0; /* le site applique section{padding:100px 0} */
  width:370px; max-width:calc(100vw - 32px);
  height:540px; max-height:calc(100vh - 170px);
  max-height:calc(100dvh - 170px);
  display:flex; flex-direction:column;
  background:var(--pd-chat-bg);
  border:1px solid var(--pd-chat-line);
  border-radius:14px; overflow:hidden;
  box-shadow:0 22px 60px rgba(0,0,0,0.3);
  opacity:0; transform:translateY(12px) scale(.98); visibility:hidden;
  transition:opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
/* au-dessus du bandeau cookies (80) quand le chat est ouvert */
.pd-chat-root.pd-chat-open .pd-chat-panel,
.pd-chat-root.pd-chat-open .pd-chat-toggle{ z-index:90; }
.pd-chat-root.pd-chat-open .pd-chat-panel{
  opacity:1; transform:none; visibility:visible;
  transition:opacity .2s ease, transform .2s ease;
}

.pd-chat-header{
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; background:var(--pd-chat-accent); color:#f6f1e6;
  border-bottom:3px solid var(--pd-chat-brass);
}
.pd-chat-avatar{
  width:36px; height:36px; flex:0 0 36px; border-radius:50%;
  background:var(--pd-chat-brass); color:#173226;
  display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces', Georgia, serif; font-weight:700; font-size:1.1rem;
}
.pd-chat-title{ flex:1; min-width:0; }
.pd-chat-title strong{ display:block; font-family:'Fraunces', Georgia, serif; font-weight:600; font-size:1.05rem; }
.pd-chat-title span{ display:block; font-size:0.8rem; color:var(--pd-chat-brass-light); }
.pd-chat-close{
  background:transparent; border:0; color:#f6f1e6; cursor:pointer;
  width:36px; height:36px; border-radius:8px; font-size:1.4rem; line-height:1;
}
.pd-chat-close:hover{ background:rgba(255,255,255,0.12); }
.pd-chat-close:focus-visible{ outline:2px solid var(--pd-chat-brass-light); outline-offset:1px; }

.pd-chat-log{
  flex:1; overflow-y:auto; padding:16px 14px 8px;
  display:flex; flex-direction:column; gap:10px;
  background:var(--pd-chat-bg-alt);
  overscroll-behavior:contain;
}
.pd-chat-msg{
  max-width:86%; padding:10px 13px; border-radius:12px;
  font-size:0.93rem; line-height:1.5; word-wrap:break-word;
}
.pd-chat-msg p{ margin:0 0 6px; }
.pd-chat-msg p:last-child{ margin-bottom:0; }
.pd-chat-msg ul{ margin:4px 0 6px; padding-left:18px; }
.pd-chat-msg li{ margin:2px 0; }
.pd-chat-msg a{ color:inherit; font-weight:600; text-decoration:underline; text-underline-offset:2px; }
.pd-chat-bot{
  align-self:flex-start; background:var(--pd-chat-bg); color:var(--pd-chat-ink);
  border:1px solid var(--pd-chat-line); border-bottom-left-radius:4px;
}
.pd-chat-bot a{ color:var(--brick, #a8452f); }
.pd-chat-user{
  align-self:flex-end; background:var(--pd-chat-accent); color:#f6f1e6;
  border-bottom-right-radius:4px;
}
.pd-chat-typing{ display:inline-flex; gap:4px; align-items:center; }
.pd-chat-typing i{
  width:6px; height:6px; border-radius:50%; background:var(--pd-chat-ink-soft);
  animation:pd-chat-blink 1s infinite ease-in-out;
}
.pd-chat-typing i:nth-child(2){ animation-delay:.15s; }
.pd-chat-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes pd-chat-blink{ 0%,80%,100%{opacity:.25;} 40%{opacity:1;} }

.pd-chat-chips{
  display:flex; flex-wrap:wrap; gap:6px; padding:8px 14px 10px;
  background:var(--pd-chat-bg-alt);
}
.pd-chat-chips:empty{ display:none; }
.pd-chat-chip{
  font:inherit; font-size:0.82rem; font-weight:500;
  padding:6px 11px; border-radius:999px; cursor:pointer;
  background:var(--pd-chat-bg); color:var(--pd-chat-ink);
  border:1px solid var(--pd-chat-brass);
  transition:background .15s ease, color .15s ease;
}
.pd-chat-chip:hover{ background:var(--pd-chat-brass); color:#1c1c1a; }
.pd-chat-chip:focus-visible{ outline:2px solid var(--pd-chat-accent); outline-offset:2px; }

.pd-chat-form{
  display:flex; gap:8px; padding:10px 12px;
  border-top:1px solid var(--pd-chat-line); background:var(--pd-chat-bg);
}
.pd-chat-input{
  flex:1; min-width:0; font:inherit; font-size:16px; /* 16px avoids iOS zoom */
  padding:10px 12px; border-radius:10px;
  border:1px solid var(--pd-chat-line); background:var(--pd-chat-bg-alt); color:var(--pd-chat-ink);
}
.pd-chat-input:focus{ outline:2px solid var(--pd-chat-brass); outline-offset:0; border-color:transparent; }
.pd-chat-send{
  flex:0 0 auto; border:0; border-radius:10px; cursor:pointer;
  padding:0 14px; background:var(--pd-chat-accent); color:#f6f1e6;
  display:flex; align-items:center; justify-content:center;
}
.pd-chat-send:hover{ background:var(--green-mid, #22462f); }
.pd-chat-send:focus-visible{ outline:2px solid var(--pd-chat-brass); outline-offset:2px; }
.pd-chat-send svg{ width:20px; height:20px; }
.pd-chat-note{
  font-size:0.7rem; color:var(--pd-chat-ink-soft); text-align:center;
  padding:0 12px 8px; background:var(--pd-chat-bg);
}
.pd-chat-sr{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* Teaser bubble above the launcher (shown once per session, see chatbot.js) */
.pd-chat-teaser{
  position:fixed; right:22px; bottom:144px; z-index:61; /* launcher 76 + 56 + 12 */
  display:flex; align-items:flex-start;
  width:max-content; max-width:min(320px, calc(100vw - 44px));
  background:var(--pd-chat-bg); color:var(--pd-chat-ink);
  border:1px solid var(--pd-chat-line); border-top:3px solid var(--pd-chat-brass);
  border-radius:14px; border-bottom-right-radius:4px;
  box-shadow:0 14px 36px rgba(0,0,0,0.22);
  opacity:0; transform:translateY(8px) scale(.96); transform-origin:100% 100%;
  transition:opacity .22s ease, transform .26s cubic-bezier(.2,.8,.2,1);
}
.pd-chat-teaser.pd-chat-teaser-in{ opacity:1; transform:none; }
/* small tail pointing at the launcher */
.pd-chat-teaser::after{
  content:""; position:absolute; right:20px; bottom:-7px; width:12px; height:12px;
  background:var(--pd-chat-bg); border-right:1px solid var(--pd-chat-line); border-bottom:1px solid var(--pd-chat-line);
  transform:rotate(45deg);
}
.pd-chat-teaser-msg{
  flex:1; min-width:0; display:flex; align-items:center; gap:10px;
  font:inherit; font-size:0.92rem; line-height:1.4; text-align:left;
  color:inherit; background:transparent; border:0; cursor:pointer;
  padding:12px 4px 12px 12px; border-radius:12px 0 0 4px;
}
.pd-chat-teaser-msg:hover .pd-chat-teaser-text{ text-decoration:underline; text-underline-offset:2px; text-decoration-color:var(--pd-chat-brass); }
.pd-chat-teaser-avatar{
  width:28px; height:28px; flex:0 0 28px; border-radius:50%;
  background:var(--pd-chat-accent); color:var(--pd-chat-brass-light);
  display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces', Georgia, serif; font-weight:700; font-size:0.9rem;
}
.pd-chat-teaser-text{ min-width:0; overflow-wrap:break-word; }
.pd-chat-teaser-x{
  flex:0 0 auto; width:32px; height:32px; margin:4px 4px 0 0;
  display:flex; align-items:center; justify-content:center;
  font:inherit; font-size:1.25rem; line-height:1; color:var(--pd-chat-ink-soft);
  background:transparent; border:0; border-radius:8px; cursor:pointer;
}
.pd-chat-teaser-x:hover{ background:var(--pd-chat-bg-alt); color:var(--pd-chat-ink); }
.pd-chat-teaser-msg:focus-visible,
.pd-chat-teaser-x:focus-visible{ outline:2px solid var(--pd-chat-brass); outline-offset:-2px; }
.pd-chat-root.pd-chat-open .pd-chat-teaser{ display:none; }

/* Mobile: full-width panel */
@media (max-width:560px){
  .pd-chat-toggle{ right:16px; bottom:70px; width:56px; height:56px; }
  .pd-chat-panel{
    left:0; right:0; bottom:0; width:100%; max-width:100%;
    height:100%; max-height:100%;
    height:100dvh; max-height:100dvh;
    border-radius:0; border:0;
  }
  .pd-chat-root.pd-chat-open .pd-chat-toggle{ display:none; }
  .pd-chat-teaser{ right:16px; bottom:136px; max-width:calc(100vw - 32px); } /* launcher 70 + 56 + 10 */
}

@media (prefers-reduced-motion: reduce){
  .pd-chat-toggle, .pd-chat-panel, .pd-chat-chip{ transition:none; }
  .pd-chat-teaser{ transform:none; transition:opacity .2s ease; } /* fade only */
  .pd-chat-typing i{ animation:none; opacity:.6; }
}

@media print{ .pd-chat-root{ display:none !important; } }
