/* "Ask dara." FAQ chat widget. Built by /assets/chat.js from the approved canvas artboard (Chat.dc.html).
   Everything is namespaced .dchat- so it never collides with styles.css, case.css or the film player.
   z-index 90: above the page (nav is 50), below the film player (.ad-backdrop is 100), so an open film covers it. */
.dchat {
  --dchat-bg: #f4f2ec; --dchat-ink: #1f1f1d; --dchat-muted: #6c6a63;
  --dchat-line: rgba(31,31,29,0.10); --dchat-line-strong: rgba(31,31,29,0.18);
  --dchat-lime: #a3f064; --dchat-lime-deep: #8fdc4f; --dchat-forest: #234a31;
  --dchat-mint: #e3fbcf; --dchat-mint-2: #d6f5bd; --dchat-pink: #fbdff3; --dchat-white: #ffffff;
  --dchat-display: 'Cal Sans', 'Figtree', ui-sans-serif, system-ui, sans-serif;
  --dchat-body: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  color: var(--dchat-ink); font-family: var(--dchat-body); font-size: 15px; line-height: 1.45; text-align: left;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.dchat *, .dchat *::before, .dchat *::after { box-sizing: border-box; }
.dchat a { color: inherit; text-decoration: none; }
.dchat p { margin: 0; max-width: none; }
.dchat button, .dchat input { font: inherit; letter-spacing: normal; text-transform: none; }
.dchat :focus-visible { outline: 2.5px solid var(--dchat-forest); outline-offset: 2px; }

/* launcher: one button holding the label pill and the round lime fab */
.dchat-launch { display: flex; align-items: center; gap: 10px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--dchat-ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dchat-launch:focus-visible { outline: none; }
.dchat-launch:focus-visible .dchat-fab { outline: 2.5px solid var(--dchat-forest); outline-offset: 3px; }
.dchat-label { padding: 6px 12px; border-radius: 999px; background: var(--dchat-forest); color: var(--dchat-lime); font-family: var(--dchat-display); font-size: 15px; font-weight: 400; line-height: 1.1; white-space: nowrap; transform: rotate(-4deg); box-shadow: 0 10px 20px -12px rgba(35,74,49,0.8); transition: opacity 160ms ease; }
.dchat-fab { width: 62px; height: 62px; flex: none; border-radius: 50%; background: var(--dchat-lime); display: grid; place-items: center; box-shadow: 0 18px 30px -14px rgba(35,74,49,0.65), inset 0 -3px 0 rgba(35,74,49,0.14); transition: transform 160ms ease, background 160ms ease; }
.dchat-launch:hover .dchat-fab { background: var(--dchat-lime-deep); transform: rotate(-8deg) scale(1.04); }
.dchat-fab svg { width: 28px; height: 28px; display: block; }
.dchat.is-open .dchat-label { opacity: 0; pointer-events: none; }

/* panel */
.dchat-panel {
  position: fixed; right: 20px; bottom: 98px; width: 404px; height: min(600px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--dchat-white); border-radius: 28px;
  box-shadow: 0 0 0 1px var(--dchat-line), 0 40px 70px -40px rgba(31,31,29,0.45), 0 8px 18px -10px rgba(31,31,29,0.18);
  animation: dchat-open 260ms cubic-bezier(.2,.8,.2,1);
}
.dchat-panel[hidden] { display: none; }
@supports (height: 100dvh) { .dchat-panel { height: min(600px, calc(100dvh - 130px)); } }
@keyframes dchat-open { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.dchat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--dchat-mint); }
.dchat-mark { width: 40px; height: 40px; max-width: none; flex: none; display: block; border-radius: 12px; transform: rotate(-6deg); box-shadow: 0 6px 14px -8px rgba(35,74,49,0.7); }
.dchat-titles { flex: 1; min-width: 0; }
.dchat-title { margin: 0; font-family: var(--dchat-display); font-weight: 400; font-size: 22px; line-height: 1.05; letter-spacing: -0.01em; color: var(--dchat-forest); }
.dchat .dchat-sub { margin: 3px 0 0; font-size: 12.5px; font-weight: 500; color: rgba(35,74,49,0.72); display: flex; align-items: center; gap: 6px; }
.dchat-dot { width: 7px; height: 7px; border-radius: 50%; background: #3fae5a; box-shadow: 0 0 0 3px rgba(63,174,90,0.2); flex: none; }
.dchat-close { width: 34px; height: 34px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(35,74,49,0.08); color: var(--dchat-forest); display: grid; place-items: center; cursor: pointer; transition: background 140ms ease; }
.dchat-close:hover { background: rgba(35,74,49,0.16); }
.dchat-close svg { width: 14px; height: 14px; display: block; }

/* messages: column-reverse keeps the newest message in view */
.dchat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column-reverse; background: var(--dchat-bg); scrollbar-width: thin; }
.dchat-log { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; margin-bottom: auto; }
.dchat-msg { max-width: 84%; padding: 10px 14px 11px; font-size: 14.5px; line-height: 1.42; animation: dchat-pop 240ms cubic-bezier(.2,.8,.2,1) both; overflow-wrap: anywhere; }
.dchat-msg--bot { align-self: flex-start; background: var(--dchat-white); border-radius: 20px 20px 20px 6px; transform: rotate(-0.5deg); box-shadow: 0 0 0 1px var(--dchat-line), 0 10px 20px -16px rgba(31,31,29,0.4); }
.dchat-msg--user { align-self: flex-end; background: var(--dchat-lime); border-radius: 20px 20px 6px 20px; transform: rotate(0.5deg); font-weight: 600; color: var(--dchat-ink); }
.dchat .dchat-action { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 5px 11px; border-radius: 999px; background: var(--dchat-mint); color: var(--dchat-forest); font-size: 13px; font-weight: 700; transition: background 140ms ease; }
.dchat .dchat-action:hover { background: var(--dchat-mint-2); }
@keyframes dchat-pop { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }

.dchat-typing { display: inline-flex; align-items: center; gap: 5px; padding: 13px 16px; }
.dchat-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dchat-forest); opacity: 0.55; animation: dchat-bounce 900ms ease-in-out infinite; }
.dchat-typing i:nth-child(2) { animation-delay: 120ms; }
.dchat-typing i:nth-child(3) { animation-delay: 240ms; }
@keyframes dchat-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }

/* suggested questions */
.dchat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px 4px; border-top: 1px solid var(--dchat-line); }
.dchat-chips[hidden] { display: none; }
.dchat-chip { border: 0; margin: 0; padding: 6px 11px; border-radius: 999px; background: var(--dchat-white); box-shadow: inset 0 0 0 1.5px var(--dchat-line-strong); font-family: var(--dchat-body); font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--dchat-ink); cursor: pointer; transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.dchat-chip:nth-child(odd) { transform: rotate(-1deg); }
.dchat-chip:nth-child(even) { transform: rotate(0.8deg); }
.dchat-chip:hover { background: var(--dchat-pink); box-shadow: inset 0 0 0 1.5px var(--dchat-ink); transform: rotate(0) translateY(-1px); }

/* input */
.dchat-form { display: flex; align-items: center; gap: 8px; margin: 10px 14px 0; padding: 5px 5px 5px 16px; border-radius: 999px; background: var(--dchat-bg); box-shadow: inset 0 0 0 1.5px var(--dchat-line); transition: box-shadow 140ms ease, background 140ms ease; }
.dchat-form:focus-within { background: var(--dchat-white); box-shadow: inset 0 0 0 1.5px var(--dchat-forest); }
.dchat .dchat-input { flex: 1; min-width: 0; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none; font-family: var(--dchat-body); font-size: 14.5px; color: var(--dchat-ink); -webkit-appearance: none; appearance: none; }
.dchat .dchat-input:focus-visible { outline: none; }
.dchat-input::placeholder { color: var(--dchat-muted); opacity: 1; }
.dchat-send { width: 38px; height: 38px; flex: none; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(31,31,29,0.08); color: var(--dchat-ink); display: grid; place-items: center; cursor: pointer; transition: background 140ms ease, transform 140ms ease; }
.dchat-send.is-ready { background: var(--dchat-lime); }
.dchat-send.is-ready:hover { background: var(--dchat-lime-deep); transform: rotate(-8deg); }
.dchat-send svg { width: 17px; height: 17px; display: block; }

.dchat-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 18px 12px; font-size: 12px; color: var(--dchat-muted); }
.dchat .dchat-human { font-weight: 700; font-size: 13px; color: var(--dchat-forest); white-space: nowrap; }
.dchat .dchat-human:hover { text-decoration: underline; text-underline-offset: 3px; }

.dchat-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; }

/* phones: nearly full width, at most 80% of the screen tall */
@media (max-width: 520px) {
  .dchat-label { display: none; }
  .dchat-fab { width: 50px; height: 50px; box-shadow: 0 10px 24px -10px rgba(35,74,49,0.55); }
  .dchat-fab svg { width: 23px; height: 23px; }
  .dchat-panel { left: 12px; right: 12px; bottom: 84px; width: auto; height: min(80vh, calc(100vh - 100px)); max-height: 80vh; border-radius: 24px; }
  @supports (height: 100dvh) { .dchat-panel { height: min(80dvh, calc(100dvh - 100px)); max-height: 80dvh; } }
}

@media (prefers-reduced-motion: reduce) {
  .dchat *, .dchat *::before, .dchat *::after { animation: none !important; transition: none !important; }
  .dchat-launch:hover .dchat-fab, .dchat-send.is-ready:hover, .dchat-chip:hover { transform: none; }
  .dchat-typing i { opacity: 0.6; }
}

@media print { .dchat { display: none; } }
