/* Crisp monkey. The shadow is a drop-shadow, so the face, ears, and eyes stay sharp. */
#guide-mount { position: static; }
.bot-launcher {
  position: fixed;
  z-index: 36;
  right: 12px;
  bottom: 12px;
  width: 188px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  filter: drop-shadow(0 0 6px #22d3ee) drop-shadow(0 0 10px #f472b6);
}
.bot-launcher[hidden] { display: none; }
.bot-launcher svg { width: 188px; height: 216px; display: block; }
.bot-scrim {
  position: fixed;
  z-index: 44;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.62);
}
body:has(.bot-greet:not([hidden])) .bot-launcher,
body:has(.bot-sheet:not([hidden])) .bot-launcher { display: none !important; }
.bot-scrim.is-greet { z-index: 67; }
.bot-scrim[hidden] { display: none; }
.bot-sheet {
  position: fixed;
  z-index: 46;
  right: 12px;
  bottom: 12px;
  box-sizing: border-box;
  width: min(380px, calc(100% - 24px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 10px 12px 12px;
  border-radius: 22px;
  background: #fff;
  color: #1e1b4b;
  border: 2px solid #6d28d9;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.35), 0 18px 50px rgba(15, 23, 42, 0.28);
}
.bot-sheet[hidden], .bot-greet[hidden], .idle-pop[hidden] { display: none !important; }
.sheet-handle {
  width: 52px;
  height: 6px;
  margin: 2px auto 10px;
  border-radius: 99px;
  background: #6d28d9;
  touch-action: none;
  cursor: grab;
}
.bot-greet {
  position: fixed;
  z-index: 68;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: min(520px, calc(100% - 28px));
  max-width: calc(100% - 16px);
  max-height: min(78vh, 640px);
  overflow: auto;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  color: #1e1b4b;
  border: 3px solid #6d28d9;
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.35), 0 24px 70px rgba(15, 23, 42, 0.4);
}
.greet-hero { display: flex; gap: 12px; align-items: center; }
.greet-hero svg { width: 108px; height: 124px; flex: none; filter: drop-shadow(0 0 8px #22d3ee); }
.greet-hero p { margin: 0 0 4px; }
.choice-grid { display: grid; gap: 8px; margin-top: 10px; }
.choice-grid button,
.bot-controls button,
.bot-form button,
.sheet-close,
.bot-extra summary {
  appearance: none;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid #6d28d9;
  background: #ede9fe;
  color: #1e1b4b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
  padding: 8px 12px;
}
.choice-grid button:hover,
.bot-controls button:hover,
.bot-form button:hover,
.sheet-close:hover { background: #ddd6fe; }
.sheet-close { display: block; width: 100%; margin-top: 8px; text-align: center; background: #fef3c7; border-color: #b45309; }
.bot-controls, .bot-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot-form input[type="text"] { flex: 1; min-width: 0; }
.bot-log { display: grid; gap: 6px; margin: 8px 0; }
.bot-log:empty { display: none; }
.bot-log p { margin: 0; padding: 8px 10px; border-radius: 12px; background: #f8fafc; color: #1e1b4b; }
.export-offer { margin: 8px 0 0; font-weight: 700; color: #1e1b4b; }
.export-offer:empty { display: none; }
.sheet-scroll { min-width: 0; }
.say-line { margin: 8px 0; padding: 8px; border-radius: 12px; background: #ecfeff; color: #0f172a; }
.say-line mark { background: #fde68a; color: #1e1b4b; }
.bot-extra { margin-top: 10px; }
.bot-extra summary { list-style: none; }
.bot-extra summary::-webkit-details-marker { display: none; }
.read-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  flex: none;
}
.read-row label { display: grid; gap: 2px; min-width: 0; font-size: 0.82rem; font-weight: 800; color: #1e1b4b; }
.read-row button { min-height: 44px; }
@media (max-width: 800px) {
  .read-row { grid-template-columns: 1fr 1fr; }
  .read-row label { grid-column: 1 / -1; }
}
.voice-row { display: grid; gap: 8px; margin-top: 8px; }
.voice-row label { display: grid; gap: 4px; font-size: 0.92rem; font-weight: 800; color: #1e1b4b; }
.check-line { display: flex !important; align-items: center; gap: 8px; }
.bot-sheet select,
.bot-sheet input[type="text"],
.bot-greet select,
.idle-pop select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 0 36px 0 12px;
  border-radius: 12px;
  border: 2px solid #6d28d9;
  background-color: #f5f3ff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path fill='%231e1b4b' d='M3.5 6.2 8 10.8l4.5-4.6' stroke='%231e1b4b' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: #1e1b4b;
  font: inherit;
  font-weight: 700;
}
.bot-sheet input[type="text"] { background-image: none; padding-right: 12px; }
.bot-sheet input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
}
.bot-sheet input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6d28d9, #0891b2);
}
.bot-sheet input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #1e1b4b;
}
.bot-sheet input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6d28d9, #0891b2);
}
.bot-sheet input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #1e1b4b;
}
.bot-sheet input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid #6d28d9;
  border-radius: 6px;
  background: #fff;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.bot-sheet input[type="checkbox"]:checked { background: #6d28d9; }
.bot-sheet input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.idle-pop {
  position: fixed;
  z-index: 37;
  right: 12px;
  bottom: 236px;
  width: 188px;
  max-height: 40vh;
}
.monkey .arm-left { transform-box: view-box; transform-origin: 58px 158px; }
.monkey .arm-wave { transform-box: view-box; transform-origin: 142px 156px; }
.pose-wave .arm-wave { transform: rotate(-36deg); }
.pose-cheer .arm-left { transform: rotate(36deg); }
.pose-cheer .arm-wave { transform: rotate(-48deg); }
.pose-think .arm-wave { transform: rotate(24deg); }
.pose-point .arm-wave { transform: rotate(-70deg); }
.pose-listen .ear-inner { fill: #67e8f9; }
html.motion .monkey .eye { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.15); }
}
@media (min-width: 801px) {
  .wrap, .site-footer {
    width: min(1080px, calc(100% - 230px));
    max-width: none;
    margin-left: auto;
    margin-right: 210px;
  }
  .site-footer { margin-top: 28px; }
}
@media (max-width: 800px) {
  .bot-launcher { width: 112px; bottom: calc(var(--dock-h) + 8px); }
  .bot-launcher svg { width: 112px; height: 128px; }
  .bot-scrim { bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
  .bot-scrim.is-greet { bottom: 0; }
  .bot-sheet:not(.idle-pop) {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: calc(100% - 16px);
    bottom: calc(var(--dock-h) + 10px + env(safe-area-inset-bottom));
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px 22px 16px 16px;
    padding: 8px 10px 8px;
  }
  .bot-sheet:not(.idle-pop) .sheet-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .bot-sheet:not(.idle-pop) .sheet-close {
    flex: none;
    margin-top: 8px;
  }
  .bot-sheet:not(.idle-pop) .greet-hero svg { width: 64px; height: 74px; }
  .bot-sheet:not(.idle-pop) .choice-grid button { min-height: 40px; padding: 4px 10px; }
  .bot-sheet:not(.idle-pop) .greet-hero p { font-size: 0.92rem; }
  .idle-pop {
    left: auto;
    right: 8px;
    bottom: calc(var(--dock-h) + 144px);
    width: min(220px, calc(100% - 132px));
  }
  .bot-greet { top: 42%; max-height: 72vh; width: calc(100% - 16px); }
}
@media (max-height: 520px) {
  .bot-sheet:not(.idle-pop) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100dvh - var(--dock-h, 86px) - 12px);
    bottom: calc(var(--dock-h, 86px) + 6px + env(safe-area-inset-bottom));
    padding: 6px 8px;
  }
  .bot-sheet:not(.idle-pop) .sheet-handle,
  .bot-sheet:not(.idle-pop) .greet-hero,
  .bot-sheet:not(.idle-pop) .choice-grid,
  .bot-sheet:not(.idle-pop) .export-offer,
  .bot-sheet:not(.idle-pop) .bot-extra,
  .bot-sheet:not(.idle-pop) .read-row,
  .bot-sheet:not(.idle-pop) .say-line,
  .bot-sheet:not(.idle-pop) .py-chat-beta,
  .bot-sheet:not(.idle-pop) .py-mic,
  .bot-sheet:not(.idle-pop) .py-chat > .bp-link { display: none !important; }
  .bot-sheet:not(.idle-pop) .sheet-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .bot-sheet:not(.idle-pop) .bot-log { display: none; }
  .bot-sheet:not(.idle-pop) [data-connect-chat],
  .bot-sheet:not(.idle-pop) .py-chat {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    display: flex;
  }
  .bot-sheet:not(.idle-pop) .py-chat { padding: 0; border: 0; }
  .bot-sheet:not(.idle-pop) .py-chat-form { margin-top: auto; }
  .bot-sheet:not(.idle-pop) .sheet-close { flex: none; margin-top: 4px; }
}
html[data-theme="dark"] .bot-sheet,
html[data-theme="dark"] .bot-greet,
html[data-theme="dark"] .idle-pop {
  background: #111827;
  color: #f8fafc;
  border-color: #c4b5fd;
}
html[data-theme="dark"] .choice-grid button,
html[data-theme="dark"] .bot-controls button,
html[data-theme="dark"] .bot-form button,
html[data-theme="dark"] .bot-extra summary,
html[data-theme="dark"] .bot-sheet select,
html[data-theme="dark"] .bot-sheet input[type="text"] {
  background-color: #1e1b4b;
  color: #f8fafc;
  border-color: #c4b5fd;
}
html[data-theme="dark"] .sheet-close { background: #451a03; color: #fef3c7; border-color: #fbbf24; }
html[data-theme="dark"] .export-offer,
html[data-theme="dark"] .voice-row label,
html[data-theme="dark"] .bot-log p { color: #f8fafc; }
html[data-theme="dark"] .bot-log p { background: #1f2937; }
@media (prefers-reduced-motion: reduce) {
  .monkey .eye { animation: none; }
}

/* Bot is always visible and bottom-docked, also during the first-visit tour. */
.bot-launcher { z-index: 83; }
@media (max-width: 800px) {
  .bot-launcher {
    right: 6px;
    bottom: calc(var(--dock-h, 86px) + 6px);
    width: 84px;
  }
  .bot-launcher svg { width: 84px; height: 96px; }
  .tour-card.is-low { bottom: calc(var(--dock-h, 86px) + 108px); }
  .tour-card { max-height: calc(100dvh - var(--dock-h, 86px) - var(--header-h, 56px) - 120px); }
  .tour-card.is-high { max-height: calc(100dvh - var(--dock-h, 86px) - var(--header-h, 56px) - 120px); }
}

/* Draggable bot: bounce snap, lift, reset button, hidden under the full-screen menu. */
.bot-launcher.is-snapping { transition: left .5s cubic-bezier(.34,1.56,.64,1), top .5s cubic-bezier(.34,1.56,.64,1) !important; }
.bot-reset {
  position: fixed; z-index: 2147483000; width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%;
  border: 2px solid #22d3ee; background: #fff; color: #1b1340; font: 800 16px/1 system-ui, sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.bot-reset[hidden] { display: none; }
.bot-reset:focus-visible { outline: 3px solid #082f49; outline-offset: 2px; }
@media (max-width: 800px) { .bot-reset { width: 36px; height: 36px; min-height: 36px; } }
@media (prefers-reduced-motion: reduce) { .bot-launcher.is-snapping { transition: none !important; } }
html[data-motion="reduce"] .bot-launcher.is-snapping { transition: none !important; }
body:has(#site-drawer.is-open) .bot-launcher, body:has(#site-drawer.is-open) .bot-reset { visibility: hidden; }
.bot-launcher { touch-action: none; user-select: none; -webkit-user-select: none; }
