.guide-launcher,
.guide-panel {
  --guide-ink: #19382c;
  --guide-muted: #53675b;
  --guide-rule: #d8e1d7;
  --guide-paper: #fcfcf6;
  color-scheme: light;
  color: var(--guide-ink);
}

.guide-launcher[hidden],
.guide-panel [hidden], #guide-avatar-motion[hidden], #guide-motion-setting[hidden] { display: none; }

.guide-launcher {
  position: fixed;
  z-index: 12;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 16px 6px 6px;
  border: 1px solid #cee3d1;
  border-radius: 36px;
  background: var(--guide-paper);
  box-shadow: 0 5px 24px #0a201d38;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}
.guide-launcher:hover { background: #eaf5e9; }
.guide-launcher small {
  display: block;
  margin-top: 3px;
  color: var(--guide-muted);
  font-size: 11px;
  font-weight: 500;
}
.guide-launcher > svg { width: 21px; height: 21px; margin-left: 5px; }
.guide-avatar {
  flex-shrink: 0;
  object-fit: cover;
  object-position: 50% 34%;
  border-radius: 50%;
  background: #d9dacf;
}

html.guide-open { overflow: hidden; }
.guide-panel {
  position: fixed;
  inset: auto max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) auto;
  width: 392px;
  height: 654px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  container: cleo / size;
  border: 1px solid #d8e1d7;
  border-radius: 23px;
  background: var(--guide-paper);
  box-shadow: 0 20px 80px #071d1740, 0 3px 14px #0a21181e;
}
.guide-panel[open] { display: flex; flex-direction: column; }
.guide-panel::backdrop { background: #0c1d1752; }
.guide-panel svg { width: 20px; height: 20px; stroke-width: 1.8; }
.guide-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 15px 16px 15px 20px;
  border-bottom: 1px solid var(--guide-rule);
}
.guide-brand {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #224b38;
  color: #adf0c6;
}
.guide-brand svg { width: 23px; height: 23px; fill: currentColor; stroke-width: 1; }
.guide-identity { margin: 0 auto 0 4px; }
.guide-identity h2 { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: -.7px; }
.guide-identity p { margin-top: 3px; color: var(--guide-muted); font-size: 12px; line-height: 1.25; }
.guide-icon-button,
.guide-send {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 50%;
}
.guide-icon-button:hover { background: #e8eee4; }
#guide-audio[aria-pressed="true"] { color: #27573e; background: #eaf2e7; }
.guide-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 16px 20px;
}
#guide-welcome { display: flex; flex-direction: column; min-height: 100%; }
#guide-welcome[hidden] { display: none; }
.guide-suggestions { margin-top: auto; }
#guide-try {
  margin-bottom: 8px;
  color: var(--guide-muted);
  font-size: 12px;
  font-weight: 650;
}
.guide-portrait {
  position: relative;
  isolation: isolate;
  flex: none;
  height: clamp(72px, 28%, 180px);
  margin: 16px 20px 0;
  overflow: hidden;
  border-radius: 14px;
  background: #e5e7de;
}
.guide-picture, .guide-picture img, #guide-avatar-motion {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
#guide-avatar-motion > svg { display: block; width: 100%; height: 100%; stroke: none; }
.guide-panel.has-reply .guide-picture { transform: scale(1.16); transform-origin: 50% 43%; }
.guide-talk, .guide-playback, #guide-motion-setting {
  position: absolute;
  bottom: 10px;
  display: flex;
  min-height: 44px;
  padding: 0 15px;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffff7d;
  border-radius: 28px;
  background: #fcfcf6;
  box-shadow: 0 2px 12px #192c2630;
  color: var(--guide-ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.guide-talk { left: 50%; transform: translateX(-50%); }
#guide-motion-setting { left: 8px; bottom: 8px; padding: 0 11px; font-size: 12px; }
.guide-playback {
  right: 8px;
  bottom: 8px;
  gap: 5px;
  padding: 0 12px;
  background: #173527;
  color: #fff;
  font-size: 12px;
}
.guide-talk:hover { background: #eaf5e9; }
.guide-playback:hover { background: #25543d; }
.guide-talk svg, .guide-playback svg { width: 16px; height: 16px; }
.guide-intro {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.13;
  font-weight: 570;
  letter-spacing: -.85px;
  text-wrap: balance;
}
.guide-intro em { font-family: Georgia, serif; font-weight: 400; color: #2d6349; }
.guide-questions {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--guide-rule);
  border-radius: 13px;
}
.guide-questions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  padding: 8px 13px;
  border: 0;
  background: #f1f5ed;
  color: var(--guide-ink);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
}
.guide-questions button + button { border-top: 1px solid var(--guide-rule); }
.guide-questions button:hover { background: #e3efdf; }
.guide-questions button:focus-visible { outline-offset: -3px; }
.guide-questions svg, .guide-action svg { width: 15px; height: 15px; }
.guide-log { display: grid; gap: 18px; }
.guide-message {
  display: grid;
  justify-items: start;
  gap: 5px;
  color: var(--guide-ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.guide-speaker { font-size: 11px; font-weight: 700; color: var(--guide-muted); }
.guide-message[data-author="visitor"] { justify-items: end; margin-left: 26px; }
.guide-message[data-author="visitor"] p {
  padding: 9px 13px;
  border-radius: 15px 15px 3px 15px;
  background: #dfefdf;
}
.guide-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 13px;
  border: 1px solid var(--guide-rule);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}
.guide-action:hover { border-color: #7f9b83; }
.guide-footer {
  flex-shrink: 0;
  padding: 13px 16px 16px;
  border-top: 1px solid var(--guide-rule);
}
.guide-status { font-size: 12px; line-height: 1.4; color: var(--guide-muted); }
.guide-status:not(:empty) { margin: 0 2px 8px; }
.guide-form {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #a7b8a9;
  border-radius: 15px;
  background: white;
}
.guide-form:focus-within { border-color: #3f7957; box-shadow: 0 0 0 1px #3f7957; }
.guide-form input {
  flex: 1;
  min-width: 0;
  margin-left: 9px;
  padding: 6px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--guide-ink);
  font: inherit;
  font-size: 16px;
}
.guide-form input::placeholder { color: #627467; opacity: 1; }
.guide-privacy {
  margin-top: 10px;
  color: var(--guide-muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.guide-privacy a { text-decoration: underline; text-underline-offset: 2px; }
.guide-send { background: #234c38; color: white; border-radius: 11px; }
.guide-send:disabled { background: #e9eee6; color: #748779; cursor: default; }
.guide-talk.is-active,
#guide-mic.is-active { background: #d5eedb; color: #18402b; }
.guide-panel button:focus-visible, .guide-panel a:focus-visible { outline-offset: -3px; }

@media (max-width: 540px) {
  .guide-launcher {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    gap: 8px;
    padding: 4px 13px 4px 4px;
    min-height: 46px;
  }
  .guide-launcher .guide-avatar { width: 36px; height: 36px; }
  .guide-launcher > svg, .guide-launcher small { display: none; }
  body:has(.guide-launcher:not([hidden])) .site-footer { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .guide-panel {
    top: var(--guide-top, 0px);
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: min(var(--guide-height, 100dvh), 100dvh);
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .guide-header { padding-top: max(15px, env(safe-area-inset-top)); }
  .guide-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
/* Leave room for the transcript when a phone keyboard reduces the dialog. */
@container cleo (max-height: 440px) {
  .guide-header { padding-block: 4px; }
  .guide-footer { padding-block: 5px; }
  .guide-portrait { height: 60px; margin-top: 6px; background: #edf2e8; }
  .guide-picture { width: min(46%, 150px); }
  .guide-panel.has-reply .guide-picture { transform: none; }
  .guide-talk, .guide-playback { left: auto; right: 8px; bottom: 50%; transform: translateY(50%); }
  .guide-portrait:has(#guide-motion-setting:not([hidden])) { height: 92px; }
  .guide-portrait:has(#guide-motion-setting:not([hidden])) .guide-playback { bottom: auto; top: 1px; transform: none; }
  #guide-motion-setting { left: auto; right: 8px; bottom: 1px; }
  .guide-scroll { padding-block: 8px; }
}
