﻿/* Ask a donkey chat. Uses the design tokens from site.css (:root). */
button.ask-fab { border: 0; cursor: pointer; }
.ask-fab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.cg :focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
html.cg-open .ask-fab { visibility: hidden; }

.cg-root { position: fixed; inset: 0; z-index: 60; }
.cg-root[hidden] { display: none; }
.cg-backdrop { position: absolute; inset: 0; background: rgba(20, 23, 28, .28); opacity: 0; transition: opacity .2s var(--ease); }
.cg {
  position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: min(410px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow-lg); font-family: var(--f-body);
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right;
  transition: opacity .22s var(--ease), transform .28s var(--ease);
}
.cg-root.is-open .cg-backdrop { opacity: 1; }
.cg-root.is-open .cg { opacity: 1; transform: none; }

.cg-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--ink); color: #fff; }
.cg-badge { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--cyan-hi); }
.cg-badge .ico { width: 20px; height: 20px; }
.cg-titles { flex: 1; min-width: 0; }
.cg-title { margin: 0; font-size: 1.05rem; color: #fff; }
.cg-sub { margin: 2px 0 0; font-size: .78rem; color: var(--cream); opacity: .85; }
.cg-test { color: var(--cyan-hi); font-style: italic; }
.cg-close { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.cg-close:hover { background: rgba(255, 255, 255, .1); }

.cg-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.cg-log:focus-visible { outline-offset: -3px; }
.cg-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: .94rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: cg-in .22s var(--ease) both; }
.cg-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.cg-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.cg-note { align-self: center; max-width: 100%; font-size: .8rem; color: var(--warn); background: #fff7ea; border: 1px solid rgba(168, 100, 0, .25); }

.cg-actions { display: flex; flex-wrap: wrap; gap: 8px; animation: cg-in .22s var(--ease) both; }
.cg-chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); cursor: pointer;
  font: 600 .88rem/1.2 var(--f-head); text-decoration: none; transition: border-color .15s, background .15s, transform .15s var(--ease);
}
.cg-chip:hover { border-color: var(--cyan); color: var(--cyan-ink); transform: translateY(-1px); }
.cg-chip[disabled] { opacity: .45; cursor: default; transform: none; }
.cg-chip-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.cg-chip-primary:hover { color: #fff; background: var(--ink-2); }

.cg-card { align-self: stretch; padding: 16px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: cg-in .26s var(--ease) both; }
.cg-eyebrow { display: block; font: 600 .72rem/1 var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan-ink); }
.cg-card-title { margin: 6px 0 6px; font-size: 1.12rem; }
.cg-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.cg-price { font: 700 1.25rem/1 var(--f-head); }
.cg-eta { font-size: .84rem; color: var(--muted); }
.cg-get { margin: 10px 0 0; font-size: .88rem; color: var(--ink-2); }
.cg-get b { font-weight: 600; }
.cg-card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.cg-start { padding: 10px 16px; font-size: .92rem; }
.cg-alt { font-size: .88rem; color: var(--cyan-ink); }

.cg-tour { align-self: stretch; padding: 16px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line); animation: cg-in .22s var(--ease) both; }
.cg-tour-count { margin: 0; font-size: .75rem; color: var(--muted); }
.cg-tour-title { margin: 4px 0 6px; font-size: 1.05rem; }
.cg-tour-text { margin: 0 0 12px; font-size: .92rem; line-height: 1.5; }
.cg-tour-nav { display: flex; justify-content: space-between; gap: 8px; }

.cg-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.cg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); animation: cg-dot 1s infinite ease-in-out; }
.cg-typing i:nth-child(2) { animation-delay: .15s; }
.cg-typing i:nth-child(3) { animation-delay: .3s; }

.cg-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; padding: 12px 14px 10px; border-top: 1px solid var(--line); background: var(--paper); }
.cg-input {
  width: 100%; min-height: 44px; max-height: 120px; resize: none; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: .95rem/1.35 var(--f-body);
}
.cg-input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(14, 159, 181, .2); }
.cg-send { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--ink); color: #fff; cursor: pointer; }
.cg-send:hover { background: var(--cyan-ink); }
.cg-send[disabled] { opacity: .5; cursor: default; }
.cg-form .cg-note { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: .74rem; animation: none; }

.cg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

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

@media (max-width: 520px) {
  .cg { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .cg-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .cg-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .cg-msg { max-width: 92%; }
}
html.cg-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .cg, .cg-backdrop, .cg-chip { transition: none; }
  .cg-msg, .cg-actions, .cg-card, .cg-tour { animation: none; }
  .cg-typing i { animation: none; opacity: .6; }
  .cg-log { scroll-behavior: auto; }
  .cg-chip:hover { transform: none; }
}
