[hidden] { display: none !important; }
.detective-launcher { position: fixed; right: 22px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: 4px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--ink); font: inherit; }
.detective-launcher span { background: var(--paper-bright); padding: 9px 14px; border: 1px solid #d2c9e8; border-radius: 16px 16px 3px 16px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 18px #11142620; }
.detective-launcher img { width: 60px; height: 72px; object-fit: contain; filter: drop-shadow(0 4px 6px #11142640); }
.detective-launcher:hover img { transform: translateY(-3px); }
.detective-dialog { position: fixed; inset: auto 20px 20px auto; margin: 0; padding: 0; width: 390px; max-width: calc(100vw - 24px); height: 620px; max-height: calc(100dvh - 40px); border: 1px solid #bdb4d0; border-radius: 22px; color: var(--ink); background: var(--paper-bright); box-shadow: 0 20px 70px #11142640; font: inherit; overflow: hidden; }
.detective-dialog[open] { display: flex; flex-direction: column; }
.detective-dialog::backdrop { background: #11142636; }
.detective-header { display: flex; align-items: center; gap: 10px; background: var(--ink); color: white; padding: 16px; flex-shrink: 0; }
.detective-header img { object-fit: contain; }
.detective-header h2 { font-size: 17px; margin: 0; line-height: 1.4; letter-spacing: -.02em; }
.detective-header p { font-size: 11px; color: #d8d9e6; margin: 2px 0 0; }
.detective-close { margin-left: auto; flex-shrink: 0; width: 40px; height: 40px; border: 1px solid #666880; border-radius: 50%; background: transparent; color: white; cursor: pointer; font-size: 26px; }
.detective-conversation { overflow-y: auto; overscroll-behavior: contain; min-height: 90px; flex: 1; padding: 16px; scroll-behavior: auto; }
.detective-message { background: #eee9f7; border-radius: 14px 14px 14px 3px; padding: 12px 14px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; margin-bottom: 12px; }
.detective-message p { margin: 0; white-space: pre-line; }
.detective-message a { display: inline-block; margin-top: 10px; text-decoration: underline; text-underline-offset: 3px; color: #4c37a7; font-weight: 650; }
.detective-user { background: #d9f3ed; margin-left: 24px; border-radius: 14px 14px 3px 14px; }
.detective-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; flex-shrink: 0; }
.detective-suggestions button { border: 1px solid #bbb1ce; color: #453967; background: white; border-radius: 20px; padding: 8px 11px; font: inherit; font-size: 12px; cursor: pointer; min-height: 36px; }
.detective-form { margin: 0; padding: 0 16px; flex-shrink: 0; }
.detective-form label { font-size: 12px; display: block; margin-bottom: 5px; font-weight: 600; }
.detective-form > div { display: flex; gap: 8px; }
.detective-form input { min-width: 0; width: 100%; border: 1px solid #9a91ac; border-radius: 10px; background: white; color: var(--ink); padding: 11px; font: inherit; font-size: 16px; }
.detective-form button { border: 0; border-radius: 10px; background: var(--ink); color: white; font: inherit; font-size: 14px; padding: 0 16px; cursor: pointer; }
.detective-disclosure { font-size: 11px; line-height: 1.5; color: #55596b; padding: 0 16px; margin: 10px 0; flex-shrink: 0; }
.detective-bottom { display: flex; justify-content: space-between; gap: 8px; padding: 0 16px 14px; font-size: 12px; flex-shrink: 0; }
.detective-bottom a, .detective-bottom button { color: #4c37a7; text-decoration: underline; text-underline-offset: 3px; }
.detective-bottom button { border: 0; padding: 0; font: inherit; background: transparent; cursor: pointer; }
body:has(.detective-dialog[open]) { overflow: hidden; }
.menu-open .detective-launcher { visibility: hidden; }
.site-footer { padding-bottom: 105px; }
@media (max-height: 540px) {
  .detective-dialog { inset: 8px 12px auto auto; max-height: calc(100dvh - 16px); }
  .detective-header { padding-block: 8px; }
  .detective-conversation { min-height: 45px; }
  .detective-suggestions { display: none; }
}
@media (max-width: 760px) {
  .detective-launcher { right: 12px; }
  .detective-launcher span { font-size: 12px; padding: 8px 11px; }
  .detective-launcher img { width: 50px; height: 60px; }
  .detective-dialog { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px); }
}
