/* Daniks AI demo agent. Every id/class is prefixed dnxa- so nothing collides
   with the host page. Colors follow daniks.ai: ink #0e1236, line #e3e7f2,
   ground #f5f7fb, accent #9333ea. */
.dnxa-root {
  --dnxa-ink: #0e1236;
  --dnxa-ink-soft: #55597a;
  --dnxa-line: #e3e7f2;
  --dnxa-ground: #f5f7fb;
  --dnxa-accent: #9333ea;
  --dnxa-accent-soft: #f3e8ff;
  --dnxa-shadow: 0 18px 50px -12px rgba(14, 18, 54, 0.35), 0 2px 6px rgba(14, 18, 54, 0.08);
  font-family: "Geist Variable", Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--dnxa-ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}
.dnxa-root *,
.dnxa-root *::before,
.dnxa-root *::after {
  box-sizing: border-box;
}
.dnxa-root[hidden] {
  display: none !important;
}

/* ---- buttons ---------------------------------------------------------------- */
.dnxa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dnxa-btn--primary {
  background: var(--dnxa-ink);
  color: #fff;
}
.dnxa-btn--primary:hover {
  background: #1d2257;
}
.dnxa-btn--ghost {
  background: #fff;
  color: var(--dnxa-ink);
  border-color: var(--dnxa-line);
}
.dnxa-btn--sm {
  padding: 7px 12px;
  font-size: 13px;
}
.dnxa-link {
  background: none;
  border: 0;
  padding: 4px 2px;
  font: inherit;
  font-size: 13px;
  color: var(--dnxa-ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---- chooser ------------------------------------------------------------------ */
.dnxa-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  background: rgba(14, 18, 54, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: dnxa-fade 0.18s ease;
}
.dnxa-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--dnxa-shadow);
  padding: 28px;
}
.dnxa-dialog__title {
  margin: 0 32px 6px 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--dnxa-ink);
}
.dnxa-dialog__lead {
  margin: 0 0 20px;
  color: var(--dnxa-ink-soft);
  font-size: 15px;
}
.dnxa-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--dnxa-line);
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: var(--dnxa-ink-soft);
  cursor: pointer;
}
.dnxa-cards {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}
.dnxa-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--dnxa-line);
  background: #fff;
  color: var(--dnxa-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.dnxa-card:hover,
.dnxa-card:focus-visible {
  border-color: var(--dnxa-accent);
  box-shadow: 0 0 0 4px var(--dnxa-accent-soft);
  outline: none;
  transform: translateY(-1px);
}
.dnxa-card--ai {
  border-color: #d8c4f5;
}
.dnxa-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 11px;
  overflow: hidden;
  background: var(--dnxa-ground);
  margin-bottom: 4px;
}
.dnxa-card__media--call {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--dnxa-ink);
  background: linear-gradient(180deg, #f8f9fd 0%, var(--dnxa-ground) 100%);
}
.dnxa-days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 10px;
}
.dnxa-day {
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--dnxa-line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dnxa-ink-soft);
}
.dnxa-day:nth-child(2) {
  border-color: var(--dnxa-ink);
  color: var(--dnxa-ink);
}
.dnxa-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dnxa-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--dnxa-ink);
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(14, 18, 54, 0.15);
}
.dnxa-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}
.dnxa-card__title {
  font-size: 17px;
  font-weight: 650;
}
.dnxa-card__text {
  font-size: 14px;
  color: var(--dnxa-ink-soft);
}
.dnxa-card__note {
  font-size: 12.5px;
  color: var(--dnxa-ink-soft);
  opacity: 0.85;
}
.dnxa-card .dnxa-btn {
  margin-top: auto;
}

/* ---- avatar panel ------------------------------------------------------------ */
.dnxa-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483001;
  /* 300px on a laptop, up to 440px on a big screen; the 4:3 video keeps the panel inside the window. */
  width: max(264px, min(440px, 24vw, (100vh - 340px) * 4 / 3));
  background: #fff;
  border: 1px solid var(--dnxa-line);
  border-radius: 18px;
  box-shadow: var(--dnxa-shadow);
  overflow: hidden;
  /* Nothing in the panel changes its height while the avatar talks, so the
     video never jumps: the caption box holds a fixed number of lines, "You
     said…" lies over the video and the language chips over the caption. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "media" "caption" "ask" "controls" "ended";
  --dnxa-caption-h: calc(5 * 13.5px * 1.4 + 10px);
  animation: dnxa-rise 0.22s ease;
  transition: right 0.25s ease, left 0.25s ease;
}
.dnxa-panel--left {
  right: auto;
  left: 20px;
}
.dnxa-head {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid var(--dnxa-line);
}
.dnxa-name {
  font-weight: 650;
  font-size: 14px;
}
.dnxa-pill {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--dnxa-ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dnxa-pill::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #cbd0e0;
  vertical-align: 1px;
}
.dnxa-panel--live .dnxa-pill::before {
  background: #22c55e;
}
.dnxa-pill[data-state="statusSpeaking"]::before {
  background: var(--dnxa-accent);
}
.dnxa-pill[data-state="statusThinking"]::before {
  background: #f59e0b;
}
.dnxa-min {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--dnxa-ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.dnxa-min:hover {
  background: var(--dnxa-ground);
}
.dnxa-media {
  grid-area: media;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--dnxa-ground);
  overflow: hidden;
}
.dnxa-video,
.dnxa-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dnxa-poster {
  transition: opacity 0.4s ease;
}
.dnxa-panel--video .dnxa-poster {
  opacity: 0;
}
.dnxa-panel:not(.dnxa-panel--live) .dnxa-poster {
  filter: saturate(0.6);
}
/* The gap above sits outside the scroll box, so a scrolled caption starts on a whole line. */
.dnxa-caption {
  grid-area: caption;
  margin: 10px 0 0;
  padding: 0 12px;
  font-size: 13.5px;
  height: calc(var(--dnxa-caption-h) - 10px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dnxa-you {
  grid-area: media;
  align-self: end;
  z-index: 1;
  margin: 0;
  padding: 24px 12px 9px;
  font-size: 12.5px;
  font-style: italic;
  color: #fff;
  background: linear-gradient(rgba(14, 18, 54, 0), rgba(14, 18, 54, 0.74));
  pointer-events: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.dnxa-you[hidden] {
  display: none;
}
.dnxa-you--partial {
  opacity: 0.8;
}
.dnxa-ask {
  grid-area: ask;
  display: flex;
  gap: 6px;
  padding: 10px 12px 0;
}
.dnxa-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--dnxa-line);
  background: var(--dnxa-ground);
  color: var(--dnxa-ink);
}
.dnxa-input:focus {
  outline: 2px solid var(--dnxa-accent);
  outline-offset: -1px;
  background: #fff;
}
.dnxa-send {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  background: var(--dnxa-ink);
  color: #fff;
  cursor: pointer;
}
.dnxa-controls {
  grid-area: controls;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
}
.dnxa-ctl {
  flex: 1 1 auto;
  font: inherit;
  font-size: 12px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--dnxa-line);
  background: #fff;
  color: var(--dnxa-ink);
  cursor: pointer;
  white-space: nowrap;
}
.dnxa-ctl:hover {
  background: var(--dnxa-ground);
}
.dnxa-ctl:disabled {
  opacity: 0.45;
  cursor: default;
}
.dnxa-ctl[data-act="end"] {
  color: #b42318;
}
/* Over the caption box, same size: the line being spoken names the languages anyway. */
.dnxa-langs {
  grid-area: caption;
  z-index: 1;
  height: var(--dnxa-caption-h);
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 6px;
  padding: 10px 12px 0;
  background: #fff;
}
.dnxa-langs[hidden] {
  display: none;
}
.dnxa-lang {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--dnxa-line);
  background: #fff;
  color: var(--dnxa-ink);
  cursor: pointer;
}
.dnxa-lang:hover {
  background: var(--dnxa-ground);
}
.dnxa-lang[aria-pressed="true"] {
  border-color: var(--dnxa-accent);
  color: var(--dnxa-accent);
  font-weight: 600;
}
.dnxa-langbtn {
  width: auto;
  padding: 0 7px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  border: 1px solid var(--dnxa-line);
}
.dnxa-langbtn[aria-expanded="true"] {
  border-color: var(--dnxa-accent);
  color: var(--dnxa-accent);
}
.dnxa-ended {
  grid-area: ended;
  padding: 12px;
  border-top: 1px solid var(--dnxa-line);
  background: var(--dnxa-ground);
}
.dnxa-ended__title {
  margin: 0;
  font-weight: 650;
  font-size: 14px;
}
.dnxa-ended__text {
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--dnxa-ink-soft);
}
.dnxa-ended__text:empty {
  display: none;
}
.dnxa-ended__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.dnxa-panel--ended .dnxa-ask,
.dnxa-panel--ended .dnxa-controls,
.dnxa-panel--ended .dnxa-langs,
.dnxa-panel--failed .dnxa-langs,
.dnxa-panel--failed .dnxa-ask,
.dnxa-panel--failed .dnxa-controls,
.dnxa-panel--failed .dnxa-caption {
  display: none;
}
/* Minimized: just the face. */
.dnxa-panel--min {
  width: 92px !important;
  border-radius: 50%;
}
.dnxa-panel--min .dnxa-media {
  aspect-ratio: 1;
  cursor: pointer;
}
.dnxa-panel--min > :not(.dnxa-media) {
  display: none;
}

/* ---- spotlight --------------------------------------------------------------- */
.dnxa-spot {
  position: fixed;
  z-index: 2147483000;
  pointer-events: none;
  border-radius: 14px;
  opacity: 0;
  box-shadow: 0 0 0 3px var(--dnxa-accent), 0 0 0 9px rgba(147, 51, 234, 0.22);
  transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease, opacity 0.25s ease;
}
.dnxa-spot--on {
  opacity: 1;
}
/* The dim lives on a pseudo-element so the ring can pulse without it flickering. */
.dnxa-spot--dim::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 200vmax rgba(14, 18, 54, 0.3);
}
.dnxa-spot--pulse {
  animation: dnxa-pulse 1.6s ease-in-out infinite;
}

/* ---- in-app coach card --------------------------------------------------------- */
.dnxa-coach {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483001;
  width: 320px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--dnxa-line);
  border-radius: 16px;
  box-shadow: var(--dnxa-shadow);
  animation: dnxa-rise 0.22s ease;
}
.dnxa-coach__img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  flex: none;
  box-shadow: 0 0 0 3px var(--dnxa-accent-soft);
}
.dnxa-coach__name {
  font-size: 12px;
  font-weight: 650;
  color: var(--dnxa-ink-soft);
}
.dnxa-coach__text {
  margin: 3px 0 10px;
  font-size: 14px;
}
.dnxa-coach__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dnxa-coach--min {
  width: 64px;
  height: 64px;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
}
.dnxa-coach--min .dnxa-coach__body {
  display: none;
}

/* ---- phones ------------------------------------------------------------------ */
@media (max-width: 639px) {
  .dnxa-dialog {
    padding: 20px 16px 16px;
    border-radius: 18px;
  }
  .dnxa-dialog__title {
    font-size: 19px;
  }
  .dnxa-cards {
    grid-template-columns: 1fr;
  }
  .dnxa-card--call .dnxa-card__media {
    display: none;
  }
  .dnxa-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    display: grid;
    /* 12px margin + a 104px photo. */
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "media caption"
      "media you"
      "ask ask"
      "controls controls"
      "ended ended";
    /* Four lines plus one for "You said…" stay within the photo's height. */
    --dnxa-caption-h: calc(4 * 13.5px * 1.4 + 10px);
  }
  .dnxa-media {
    aspect-ratio: 1;
    margin: 10px 0 0 12px;
    border-radius: 12px;
  }
  .dnxa-you {
    grid-area: you;
    align-self: start;
    z-index: auto;
    margin: 6px 12px 0;
    padding: 0;
    color: var(--dnxa-ink-soft);
    background: none;
    -webkit-line-clamp: 1;
  }
  /* Beside the photo, never taller than it (104px + its 10px top margin). */
  .dnxa-langs {
    grid-row: 2 / 4;
    grid-column: 2;
    height: auto;
    max-height: 114px;
    gap: 5px;
    padding-top: 8px;
  }
  .dnxa-lang {
    padding: 4px 9px;
  }
  .dnxa-input {
    font-size: 16px;
  }
  .dnxa-panel--min {
    left: auto;
    width: 80px !important;
    display: block;
  }
  .dnxa-panel--min .dnxa-media {
    margin: 0;
    border-radius: 50%;
  }
  .dnxa-coach {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
  .dnxa-coach--min {
    left: auto;
    width: 64px;
  }
}

@media (min-width: 1440px) and (min-height: 800px) {
  .dnxa-panel {
    --dnxa-caption-h: calc(5 * 15px * 1.4 + 10px);
  }
  .dnxa-name {
    font-size: 15.5px;
  }
  .dnxa-pill {
    font-size: 13px;
  }
  .dnxa-caption {
    font-size: 15px;
  }
  .dnxa-you {
    font-size: 13.5px;
  }
  .dnxa-input {
    font-size: 15px;
    padding: 10px 12px;
  }
  .dnxa-send {
    font-size: 14px;
    padding: 0 16px;
  }
  .dnxa-ctl {
    font-size: 13.5px;
    padding: 8px 10px;
  }
  .dnxa-lang {
    font-size: 13.5px;
    padding: 6px 12px;
  }
}

@keyframes dnxa-fade {
  from {
    opacity: 0;
  }
}
@keyframes dnxa-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes dnxa-pulse {
  50% {
    box-shadow: 0 0 0 3px var(--dnxa-accent), 0 0 0 14px rgba(147, 51, 234, 0.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dnxa-root *,
  .dnxa-spot {
    animation: none !important;
    transition: none !important;
  }
}
