/* Diginou Help Chat: floating DiginouBot button + chat panel.
   Every rule is scoped to #dg-chat-root and buttons/fields are reset first,
   so the theme's own button styles (e.g. Hello Elementor's pink-purple hover) never leak in. */
#dg-chat-root {
  --dgc-ink: #101820;
  --dgc-ink-2: #1b2631;
  --dgc-lime: #cdde00;
  --dgc-lime-hover: #bccb00;
  --dgc-bg: #f4f6ef;
  --dgc-card: #ffffff;
  --dgc-line: #dfe3d6;
  --dgc-muted: #5b6570;
  --dgc-link: #4f5a00;
  font-family: "Comfortaa", system-ui, sans-serif;
  color: var(--dgc-ink);
}
#dg-chat-root *, #dg-chat-root *::before, #dg-chat-root *::after { box-sizing: border-box; }
#dg-chat-root button, #dg-chat-root textarea { all: unset; box-sizing: border-box; font-family: inherit; }
#dg-chat-root svg { display: block; }

/* Floating button */
#dg-chat-root .dgc-fab {
  position: fixed; right: calc(22px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 9990;
  width: 64px; height: 64px; border-radius: 50%; background: var(--dgc-ink); color: var(--dgc-lime);
  box-shadow: 0 0 0 2px var(--dgc-lime), 0 10px 28px rgba(16, 24, 32, .35);
  display: grid; place-items: center; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease;
}
#dg-chat-root .dgc-fab:hover, #dg-chat-root .dgc-fab:focus { background: var(--dgc-ink); color: var(--dgc-lime); transform: translateY(-2px); box-shadow: 0 0 0 2px var(--dgc-lime), 0 0 0 7px rgba(205, 222, 0, .22), 0 14px 32px rgba(16, 24, 32, .38); }
#dg-chat-root .dgc-fab:active { transform: translateY(0); }
#dg-chat-root .dgc-fab[aria-expanded="true"] .dgc-fab-bot { display: none; }
#dg-chat-root .dgc-fab[aria-expanded="false"] .dgc-fab-close { display: none; }
#dg-chat-root .dgc-fab-bot { width: 46px; height: 46px; }
#dg-chat-root .dgc-fab-close { width: 24px; height: 24px; }

/* One-time nudge beside the button */
#dg-chat-root .dgc-nudge {
  position: fixed; right: calc(98px + env(safe-area-inset-right, 0px)); bottom: calc(36px + env(safe-area-inset-bottom, 0px)); z-index: 9989;
  background: var(--dgc-card); color: var(--dgc-ink); border: 1px solid var(--dgc-line); border-radius: 14px 14px 4px 14px;
  padding: 9px 14px; font-size: 13.5px; font-weight: 700; box-shadow: 0 8px 22px rgba(16, 24, 32, .16);
  opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; white-space: nowrap;
}
#dg-chat-root .dgc-nudge.is-on { opacity: 1; transform: none; }

/* Panel */
#dg-chat-root .dgc-panel {
  position: fixed; right: calc(22px + env(safe-area-inset-right, 0px)); bottom: calc(100px + env(safe-area-inset-bottom, 0px)); z-index: 9991;
  width: 390px; max-width: calc(100vw - 32px); height: min(620px, calc(100dvh - 130px));
  background: var(--dgc-bg); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(16, 24, 32, .34), 0 0 0 1px rgba(16, 24, 32, .06);
  transform-origin: bottom right; animation: dgc-in .2s ease;
}
#dg-chat-root .dgc-panel[hidden] { display: none; }
@keyframes dgc-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

#dg-chat-root .dgc-head { background: var(--dgc-ink); padding: 14px 12px 14px 16px; display: flex; align-items: center; gap: 12px; }
#dg-chat-root .dgc-avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--dgc-ink-2); box-shadow: inset 0 0 0 1.5px rgba(205, 222, 0, .45); display: grid; place-items: center; flex: none; }
#dg-chat-root .dgc-avatar-bot { width: 38px; height: 38px; }
#dg-chat-root .dgc-head-text { flex: 1; min-width: 0; }
#dg-chat-root .dgc-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--dgc-lime); letter-spacing: .01em; line-height: 1.2; }
#dg-chat-root .dgc-sub { margin: 3px 0 0; font-size: 12px; color: #b9c2ca; line-height: 1.35; display: flex; align-items: center; gap: 6px; }
#dg-chat-root .dgc-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dgc-lime); flex: none; box-shadow: 0 0 0 3px rgba(205, 222, 0, .18); }
#dg-chat-root .dgc-close { width: 38px; height: 38px; border-radius: 11px; color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; background: transparent; }
#dg-chat-root .dgc-close:hover, #dg-chat-root .dgc-close:focus { background: rgba(255, 255, 255, .1); color: #fff; }
#dg-chat-root .dgc-close svg { width: 20px; height: 20px; }

#dg-chat-root .dgc-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.55; scroll-behavior: smooth; }
#dg-chat-root .dgc-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; overflow-wrap: anywhere; }
#dg-chat-root .dgc-msg-bot { align-self: flex-start; background: var(--dgc-card); border: 1px solid var(--dgc-line); border-bottom-left-radius: 5px; color: var(--dgc-ink); }
#dg-chat-root .dgc-msg-user { align-self: flex-end; background: var(--dgc-ink); color: #fff; border-bottom-right-radius: 5px; }
#dg-chat-root .dgc-msg p { margin: 0 0 7px; } #dg-chat-root .dgc-msg p:last-child { margin-bottom: 0; }
#dg-chat-root .dgc-msg ol, #dg-chat-root .dgc-msg ul { margin: 4px 0 8px; padding-left: 20px; }
#dg-chat-root .dgc-msg li { margin: 3px 0; }
#dg-chat-root .dgc-msg strong { font-weight: 700; }
#dg-chat-root .dgc-msg a { color: var(--dgc-link); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
#dg-chat-root .dgc-msg a:hover { color: var(--dgc-ink); }
#dg-chat-root .dgc-note { font-size: 12px; color: var(--dgc-muted); }
#dg-chat-root .dgc-sources { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--dgc-line); font-size: 12.5px; }
#dg-chat-root .dgc-sources b { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dgc-muted); margin-bottom: 5px; }
#dg-chat-root .dgc-sources a { display: block; margin: 4px 0; }

#dg-chat-root .dgc-typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--dgc-muted); font-size: 12.5px; padding: 2px 4px; }
#dg-chat-root .dgc-dots { display: inline-flex; gap: 4px; }
#dg-chat-root .dgc-dots i { width: 7px; height: 7px; border-radius: 2px; background: var(--dgc-ink); animation: dgc-dot 1s infinite ease-in-out; }
#dg-chat-root .dgc-dots i:nth-child(2) { animation-delay: .15s; } #dg-chat-root .dgc-dots i:nth-child(3) { animation-delay: .3s; background: var(--dgc-lime); }
@keyframes dgc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }

#dg-chat-root .dgc-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
#dg-chat-root .dgc-chip { background: var(--dgc-card); color: var(--dgc-ink); border: 1px solid var(--dgc-line); border-radius: 999px; padding: 8px 13px; font-size: 13px; line-height: 1.3; cursor: pointer; transition: border-color .15s, background-color .15s; }
#dg-chat-root .dgc-chip:hover, #dg-chat-root .dgc-chip:focus { background: #fbfcf7; color: var(--dgc-ink); border-color: var(--dgc-ink); }

#dg-chat-root .dgc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--dgc-line); background: var(--dgc-card); align-items: flex-end; }
#dg-chat-root .dgc-input { flex: 1; min-width: 0; display: block; white-space: pre-wrap; overflow-wrap: break-word; overflow-y: auto; background: var(--dgc-bg); color: var(--dgc-ink); border: 1.5px solid transparent; border-radius: 14px; padding: 11px 13px; font-size: 14px; line-height: 1.4; min-height: 44px; max-height: 120px; transition: border-color .15s, background-color .15s; }
#dg-chat-root .dgc-input::placeholder { color: #8a939b; }
#dg-chat-root .dgc-input:focus { border-color: var(--dgc-ink); background: #fff; }
#dg-chat-root .dgc-send { width: 44px; height: 44px; border-radius: 14px; background: var(--dgc-lime); color: var(--dgc-ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color .15s; }
#dg-chat-root .dgc-send:hover, #dg-chat-root .dgc-send:focus { background: var(--dgc-lime-hover); color: var(--dgc-ink); }
#dg-chat-root .dgc-send[disabled] { opacity: .45; cursor: default; }
#dg-chat-root .dgc-send svg { width: 20px; height: 20px; }

#dg-chat-root .dgc-fab:focus-visible, #dg-chat-root .dgc-close:focus-visible, #dg-chat-root .dgc-chip:focus-visible, #dg-chat-root .dgc-send:focus-visible, #dg-chat-root .dgc-msg a:focus-visible { outline: 3px solid var(--dgc-lime); outline-offset: 2px; }
#dg-chat-root .dgc-fab:focus:not(:focus-visible), #dg-chat-root .dgc-chip:focus:not(:focus-visible), #dg-chat-root .dgc-send:focus:not(:focus-visible), #dg-chat-root .dgc-close:focus:not(:focus-visible) { outline: none; }

@media (max-width: 600px) {
  #dg-chat-root .dgc-panel { right: 8px; left: 8px; width: auto; max-width: none; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); height: calc(100dvh - 108px - env(safe-area-inset-bottom, 0px)); border-radius: 18px; }
  #dg-chat-root .dgc-fab { right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 60px; height: 60px; }
  #dg-chat-root .dgc-nudge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #dg-chat-root .dgc-fab, #dg-chat-root .dgc-nudge, #dg-chat-root .dgc-panel { transition: none; animation: none; }
  #dg-chat-root .dgc-dots i { animation: none; opacity: .8; }
}
