/* The website recedes as a single card behind the full-window conversation. */
.guide-page { display: contents; }
.guide-page-spacer { pointer-events: none; }
body.guide-stage { overflow: hidden; }
body.guide-stage .guide-page {
  display: block; position: fixed; inset: 0; width: 100%; height: 100dvh;
  overflow: hidden; overscroll-behavior: none; background: var(--bg);
  padding: var(--safe-top) var(--safe-inline) var(--safe-bottom);
  border-radius: 32px; corner-shape: squircle; transform-origin: 50% 0;
  transform: translateY(8px) scale(.94);
  animation: guide-recede .44s cubic-bezier(.22,.8,.25,1) both;
}
body.guide-stage-closing .guide-page { animation: guide-return .28s ease-out both; }
[data-design] .guide-dialog {
  --chat-blue: light-dark(#0764d5, #0869d9);
  --chat-inset: max(24px, calc((100% - 800px) / 2), calc(var(--safe-inline) + 16px));
  --sheet-top: max(28px, calc(var(--safe-top) + 8px));
  --guide-viewport-height: 100dvh;
  --guide-viewport-top: 0px;
  position: fixed;
  inset: calc(var(--guide-viewport-top) + var(--sheet-top)) 0 auto;
  margin: 0;
  width: 100%; max-width: none;
  height: calc(var(--guide-viewport-height) - var(--sheet-top)); max-height: none;
  padding: 0;
  border: 0; border-top: 1px solid var(--line);
  border-radius: 32px 32px 0 0;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 24px 100px #0004;
}
.guide-dialog[open] { display: flex; flex-direction: column; gap: 0; animation: guide-present .44s cubic-bezier(.22,.8,.25,1) both; }
.guide-dialog.is-closing { animation: guide-dismiss .28s ease-in both; }
.guide-dialog::backdrop { background: #0006; backdrop-filter: none; animation: guide-dim .44s ease-out both; }
.guide-dialog.is-closing::backdrop { animation: guide-undim .28s ease-out both; }
.guide-dialog .dialog-head { flex: 0 0 auto; align-items: center; gap: 8px; padding: 18px var(--chat-inset); border-bottom: 1px solid var(--line); background: var(--surface); }
.guide-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.guide-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.guide-avatar svg { width: 22px; height: 22px; }
.guide-dialog .dialog-head h2 { margin: 0; font: 600 20px/1.3 var(--sans); letter-spacing: -.025em; }
.guide-description { margin: 3px 0 0; font: 12px/1.4 var(--sans); color: var(--muted); }
.guide-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
[data-design] .guide-dialog :is(.guide-clear, .close-button) { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); corner-shape: round; }
.guide-tools svg { width: 20px; height: 20px; }
[data-design] .guide-dialog :is(.guide-clear, .close-button):hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.guide-log { display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 52px; overflow-y: auto; overscroll-behavior: contain; padding: 24px var(--chat-inset); scrollbar-width: thin; }
.guide-message { display: flex; flex-direction: column; align-items: flex-start; width: fit-content; max-width: 88%; flex-shrink: 0; overflow-wrap: anywhere; animation: guide-arrive .18s ease-out; }
.guide-message-label { display: block; margin: 0 12px 5px; font: 500 11px/1.4 var(--sans); color: var(--muted); }
.guide-bubble { padding: 12px 16px; border-radius: 22px 22px 22px 6px; corner-shape: round; background: var(--surface); color: var(--ink); font: 15px/1.55 var(--sans); }
.guide-bubble p { margin: 0; white-space: pre-wrap; }
.guide-bubble p + p { margin-top: 12px; }
.guide-bubble p a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.guide-bubble p a:hover { text-decoration-thickness: 2px; }
.guide-message-notice .guide-bubble { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); }
.guide-message-user { align-self: flex-end; align-items: flex-end; }
.guide-message-user .guide-bubble { border-radius: 22px 22px 6px 22px; background: var(--chat-blue); color: #fff; }
.guide-message-user .guide-message-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.guide-sources { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 10px 0; font: 12px/1.5 var(--sans); }
.guide-sources a { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.guide-dialog .question-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--chat-inset) 16px; margin: 0; flex-shrink: 0; }
[data-design] .guide-dialog .question-list button { flex: 0 1 auto; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 24px; corner-shape: round; background: transparent; color: var(--accent); font: 500 12px/1.4 var(--sans); }
[data-design] .guide-dialog .question-list button:hover { border-color: var(--accent); background: var(--surface); }
.guide-dialog .question-list[hidden], .guide-send[hidden], .guide-stop[hidden] { display: none; }
.guide-status { margin: 0 var(--chat-inset) 14px; font: 12px/1.5 var(--sans); color: var(--muted); flex-shrink: 0; }
.guide-status:empty { display: none; }
.guide-status[data-busy='true']::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 9px 2px 0; border-radius: 50%; background: currentColor; animation: guide-pulse 1.2s ease-in-out infinite; }
.guide-bottom { flex-shrink: 0; padding: 14px var(--chat-inset) max(16px, var(--safe-bottom)); border-top: 1px solid var(--line); }
.guide-form { margin: 0; }
.guide-compose { display: flex; align-items: flex-end; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 28px; corner-shape: round; background: var(--raised); }
.guide-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.guide-compose textarea { display: block; flex: 1; min-width: 0; height: 44px; min-height: 44px; max-height: 120px; resize: none; padding: 11px 0 11px 14px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 16px/22px var(--sans); outline: none; scrollbar-width: thin; }
.guide-compose textarea::placeholder { color: var(--muted); opacity: 1; }
.guide-compose textarea:focus-visible { outline: none; }
.guide-send, .guide-stop { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; corner-shape: round; background: var(--chat-blue); color: #fff; cursor: pointer; }
.guide-send svg, .guide-stop svg { width: 24px; height: 24px; }
.guide-send:disabled { color: var(--muted); background: var(--surface); cursor: default; }
.guide-intro { max-width: 100%; }
.guide-intro .guide-disclosure { margin-top: 0; font: 13px/1.5 var(--sans); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.guide-disclosure p { margin: 0; }
.guide-disclosure-links { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 0 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.guide-disclosure details { min-width: 0; }
.guide-disclosure details[open] { grid-column: 1 / -1; }
.guide-disclosure details p { margin: 6px 0; }
.guide-disclosure summary, .guide-contact { display: block; min-height: 44px; padding-block: 12px; cursor: pointer; }
.guide-disclosure summary { display: list-item; }
.guide-disclosure a { color: inherit; text-underline-offset: 3px; }
.guide-contact { grid-column: 2; }
.guide-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes guide-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes guide-pulse { 50% { opacity: .3; } }
@keyframes guide-present { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes guide-dismiss { from { transform: translateY(0); } to { transform: translateY(100%); } }
@keyframes guide-recede { from { transform: none; border-radius: 0; } to { transform: translateY(8px) scale(.94); border-radius: 32px; } }
@keyframes guide-return { from { transform: translateY(8px) scale(.94); border-radius: 32px; } to { transform: none; border-radius: 0; } }
@keyframes guide-dim { from { opacity: 0; } to { opacity: 1; } }
@keyframes guide-undim { from { opacity: 1; } to { opacity: 0; } }
@media (max-width: 480px) {
  [data-design] .guide-dialog { --chat-inset: max(16px, calc(var(--safe-inline) + 12px)); --sheet-top: max(20px, calc(var(--safe-top) + 8px)); border-radius: 28px 28px 0 0; }
  .guide-dialog .dialog-head { padding-block: 12px; }
  .guide-avatar { display: none; }
  .guide-dialog .dialog-head h2 { font-size: 16px; }
  .guide-description { max-width: 180px; font-size: 10px; }
  .guide-message { max-width: 92%; }
  .guide-intro { max-width: 100%; }
  .guide-bubble { font-size: 14px; padding: 11px 14px; }
  .guide-log { padding-block: 20px; }
  .guide-dialog .question-list { gap: 5px; }
  [data-design] .guide-dialog .question-list button { padding-inline: 12px; font-size: 11px; }
}
@media (max-height: 480px) {
  .guide-dialog .dialog-head { padding-block: 6px; }
  .guide-dialog .question-list { display: none; }
  .guide-bottom { padding-block: 8px; }
  .guide-log { padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-message, .guide-status[data-busy='true']::before,
  .guide-dialog[open], .guide-dialog.is-closing, .guide-dialog::backdrop,
  body.guide-stage .guide-page, body.guide-stage-closing .guide-page { animation: none; }
}
@media print {
  .guide-page { display: contents !important; }
  .guide-page-spacer, .guide-dialog { display: none !important; }
  body.guide-stage { overflow: visible; }
}
