/* AI Digi World: AI chat widget. Everything is prefixed .adwc so it cannot clash with the site. */
.adwc { --c-ink: var(--ink, #0F1B3D); --c-text: var(--text, #283350); --c-muted: var(--muted, #5A6480); --c-line: var(--line, #E1E6F0); --c-mist: var(--mist, #F4F6FB); --c-brand: var(--signal, #167894); --c-brand-dark: var(--signal-dark, #11627A); --c-soft: var(--signal-soft, #E3F3F8); --c-lift: 0px; font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif); }
.adwc *, .adwc *::before, .adwc *::after { box-sizing: border-box; }
.adwc [hidden] { display: none !important; }
.adwc button { font: inherit; cursor: pointer; }
.adwc .adwc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Launcher */
.adwc-launch {
  position: fixed; z-index: 96; left: max(16px, env(safe-area-inset-left)); bottom: calc(16px + var(--c-lift) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 12px; border: 0; border-radius: 28px;
  background: linear-gradient(135deg, #1B92B2 0%, #11627A 55%, #0F1B3D 100%); color: #fff; font-weight: 600; font-size: .95rem;
  box-shadow: 0 12px 28px -10px rgba(15, 27, 61, .6); transition: transform .2s ease, box-shadow .2s ease, bottom .25s ease;
}
.adwc-launch:hover { transform: translateY(-2px); }
.adwc-launch:focus-visible, .adwc-panel button:focus-visible, .adwc-panel a:focus-visible, .adwc-panel input:focus-visible { outline: 3px solid #F4B400; outline-offset: 2px; }
/* The AI badge: white disc with bold AI and a gold sparkle */
.adwc-ai { position: relative; display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #11627A; font: 800 .95rem/1 var(--font-display, inherit); letter-spacing: -.02em; }
.adwc-ai::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; background: #F4B400; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.adwc-launch::after { content: ""; position: absolute; top: 6px; left: 8px; width: 10px; height: 10px; border-radius: 50%; background: #3DDC84; border: 2px solid #0F1B3D; }
.adwc-launch[aria-expanded="true"] { display: none; }

/* Teaser bubble */
.adwc-teaser {
  position: fixed; z-index: 96; left: max(16px, env(safe-area-inset-left)); bottom: calc(84px + var(--c-lift) + env(safe-area-inset-bottom, 0px));
  max-width: min(280px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 6px; padding: 12px 8px 12px 14px;
  background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-radius: 16px 16px 16px 4px;
  box-shadow: 0 14px 34px -12px rgba(15, 27, 61, .35); animation: adwc-pop .35s ease both;
}
.adwc-teaser-text { border: 0; background: none; padding: 0; text-align: left; color: inherit; font-size: .92rem; line-height: 1.4; }
.adwc-teaser-x { border: 0; background: none; color: var(--c-muted); font-size: 1.2rem; line-height: 1; padding: 0 6px; }

/* Panel */
.adwc-panel {
  position: fixed; z-index: 97; left: max(16px, env(safe-area-inset-left)); bottom: calc(16px + var(--c-lift) + env(safe-area-inset-bottom, 0px));
  width: 380px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 32px - var(--c-lift))); height: min(620px, calc(100dvh - 32px - var(--c-lift)));
  display: flex; flex-direction: column; background: #fff; color: var(--c-text); border-radius: 20px; overflow: hidden;
  border: 1px solid var(--c-line); box-shadow: 0 30px 70px -20px rgba(15, 27, 61, .55); animation: adwc-pop .25s ease both;
}
.adwc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: linear-gradient(135deg, #1B92B2 0%, #11627A 55%, #0F1B3D 100%); }
.adwc-head .adwc-ai { width: 40px; height: 40px; font-size: 1.05rem; }
.adwc-head-text { flex: 1; min-width: 0; line-height: 1.25; }
.adwc-head-text strong { display: block; font-family: var(--font-display, inherit); font-size: .98rem; }
.adwc-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; opacity: .92; }
.adwc-status i { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; }
.adwc-close { border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; }
.adwc-close:hover { background: rgba(255, 255, 255, .26); }

.adwc-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--c-mist); overscroll-behavior: contain; }
.adwc-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: .94rem; line-height: 1.5; overflow-wrap: anywhere; animation: adwc-in .25s ease both; }
.adwc-msg p { margin: 0 0 .5em; } .adwc-msg p:last-child { margin-bottom: 0; }
.adwc-msg ul { margin: .3em 0 .3em 1.1em; padding: 0; } .adwc-msg li { margin: .15em 0; }
.adwc-msg a { color: var(--c-brand-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.adwc-bot { align-self: flex-start; background: #fff; color: var(--c-text); border: 1px solid var(--c-line); border-bottom-left-radius: 4px; }
.adwc-user { align-self: flex-end; background: var(--c-brand); color: #fff; border-bottom-right-radius: 4px; }
.adwc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adwc-actions a { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--c-soft); color: var(--c-brand-dark); text-decoration: none; font-size: .86rem; }

.adwc-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 13px 15px; background: #fff; border: 1px solid var(--c-line); border-radius: 16px; border-bottom-left-radius: 4px; }
.adwc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-brand); opacity: .35; animation: adwc-dot 1.1s infinite ease-in-out; }
.adwc-typing i:nth-child(2) { animation-delay: .15s; } .adwc-typing i:nth-child(3) { animation-delay: .3s; }

.adwc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: var(--c-mist); }
.adwc-chip { border: 1px solid var(--c-brand); background: #fff; color: var(--c-brand-dark); border-radius: 999px; padding: 7px 12px; font-size: .85rem; line-height: 1.2; }
.adwc-chip:hover { background: var(--c-soft); }

.adwc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--c-line); background: #fff; }
.adwc-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--c-line-strong, #CBD3E3); border-radius: 22px; font: inherit; font-size: 1rem; color: var(--c-ink); background: #fff; }
.adwc-send { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--c-brand); color: #fff; display: grid; place-items: center; flex: none; }
.adwc-send:disabled { opacity: .5; cursor: not-allowed; }
.adwc-send svg { width: 20px; height: 20px; }
.adwc-foot { margin: 0; padding: 0 14px 12px; font-size: .74rem; line-height: 1.45; color: var(--c-muted); background: #fff; }
.adwc-foot a { color: var(--c-brand-dark); }

@keyframes adwc-pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes adwc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes adwc-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 639px) {
  .adwc-launch { width: 56px; padding: 0; justify-content: center; }
  .adwc-launch .adwc-label { display: none; }
  .adwc-launch::after { left: 4px; top: 4px; }
  .adwc-panel { right: 0; left: 0; bottom: var(--c-lift); width: 100%; max-width: 100%; height: calc(88vh - var(--c-lift)); height: calc(88dvh - var(--c-lift)); border-radius: 20px 20px 0 0; border-width: 1px 0 0; }
  .adwc-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .adwc-panel, .adwc-teaser, .adwc-msg, .adwc-launch { animation: none !important; transition: none !important; }
  .adwc-typing i { animation: none; opacity: .7; }
}
body.menu-open .adwc-launch, body.menu-open .adwc-teaser { display: none; }
@media print { .adwc { display: none !important; } }
