/* LamDrift's robot guide — scoped to the floating assistant. */
.agency-chat { position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 1050; font-family: var(--font-sans); font-size: 14px; line-height: 1.55; color: var(--ink); transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s; }
.agency-chat.chat-quiet { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); }
/* The contact page prioritises the form: the floating guide would cover the
   bottom-right of a field on small screens. The email route is in the hero. */
body.contact-page .agency-chat { display: none; }
.agency-chat [hidden] { display: none !important; }
.chat-robot { display: block; width: 64px; height: 64px; overflow: visible; flex-shrink: 0; }
.robot-eyes { transform-box: fill-box; transform-origin: center; animation: robot-blink 7s ease-in-out 2s infinite; }
@keyframes robot-blink { 0%, 42%, 46%, 100% { transform: scaleY(1); } 44% { transform: scaleY(.12); } }
.chat-launcher { display: flex; align-items: center; gap: 10px; min-height: 70px; padding: 5px 16px 5px 8px; border: 1px solid #45403c; border-radius: 23px; background: #171719; color: white; box-shadow: 0 10px 35px #17171930, inset 0 1px #ffffff12; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 15px 40px #17171940; }
.chat-launcher-avatar { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: radial-gradient(ellipse at bottom, #ff683e24, transparent 75%); }
.chat-launcher-avatar .chat-robot { width: 56px; height: 56px; }
.chat-launcher-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.chat-launcher-copy small { font-size: 10px; font-weight: 500; letter-spacing: .35px; color: #c4bdb8; }
.chat-launcher-copy strong { font-size: 14px; font-weight: 650; }
.chat-launcher-arrow { margin-left: 5px; font-size: 19px; color: #ff805a; transition: transform .2s; }
.chat-launcher[aria-expanded="true"] .chat-launcher-arrow { transform: rotate(135deg); }
.chat-panel { position: absolute; bottom: 86px; right: 0; display: flex; flex-direction: column; width: 420px; height: min(740px, calc(100dvh - 134px)); min-height: 310px; border: 1px solid #d9d3ca; border-radius: 24px; background: #faf9f7; box-shadow: 0 24px 80px #15151933, 0 4px 15px #1515190d; overflow: hidden; }
.chat-header { position: relative; isolation: isolate; display: flex; align-items: center; gap: 15px; flex-shrink: 0; padding: 20px; background: #171719; color: white; border-bottom: 2px solid #ff683e; }
.chat-header::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22; background-image: linear-gradient(#ffffff15 1px, transparent 1px), linear-gradient(90deg, #ffffff15 1px, transparent 1px), radial-gradient(ellipse at 10% 90%, #ff683e80, transparent 65%); background-size: 20px 20px, 20px 20px, 100% 100%; }
.chat-brand { display: grid; place-items: center; flex-shrink: 0; width: 70px; height: 70px; border: 1px solid #615047; border-radius: 22px; background: #ffffff08; box-shadow: inset 0 1px #ffffff15; transition: box-shadow .2s, border-color .2s; }
.chat-heading-copy { min-width: 0; }
.chat-header-label { display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; color: #ff997b; }
.chat-header h2 { margin: 0 0 5px; font-size: 22px; font-weight: 650; letter-spacing: -.7px; color: white; }
.chat-header p { margin: 0; color: #c2bdb9; font-size: 11px; }
.chat-close { align-self: flex-start; margin: -5px -5px 0 auto; width: 32px; height: 32px; flex-shrink: 0; border: 1px solid #ffffff20; border-radius: 50%; color: white; background: #ffffff08; font-size: 24px; line-height: 1; }
.chat-close:hover { background: #ffffff18; }
.chat-meta { display: flex; align-items: center; justify-content: space-between; padding: 5px 20px; border-bottom: 1px solid var(--line); font-size: 10px; color: var(--ink-soft); flex-shrink: 0; background: #f4f1ec; }
.chat-status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-deep); margin-right: 5px; }
.chat-reset { background: none; border: 0; padding: 7px 0 7px 12px; color: var(--ink-soft); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.chat-messages { flex: 1; min-height: 70px; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scroll-behavior: auto; scrollbar-width: thin; scrollbar-color: #d1cdc4 transparent; background-image: radial-gradient(#d1cdc455 .7px, transparent .7px); background-size: 12px 12px; }
.chat-message { width: fit-content; max-width: 94%; margin: 0 0 16px; padding: 14px 16px; border-radius: 17px; font-size: 13px; overflow-wrap: anywhere; }
.chat-message:last-child { margin-bottom: 0; }
.chat-message p { margin: 0; white-space: pre-wrap; line-height: 1.7; color: inherit; }
.chat-message-assistant { background: white; border: 1px solid #e6e1da; border-top-left-radius: 4px; box-shadow: 0 3px 9px #17171904; }
.chat-message-user { margin-left: auto; background: #242427; color: white; border-bottom-right-radius: 4px; }
.chat-speaker { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .2px; margin-bottom: 7px; color: var(--accent-deep); }
.chat-message-user .chat-speaker { color: #c9c9ce; }
.chat-ai-badge { display: inline-block; border: 1px solid #f4d5c7; background: #fff3ec; padding: 1px 4px; border-radius: 4px; font-size: 8px; letter-spacing: .4px; }
.chat-welcome h3 { margin: 10px 0 8px; font-size: 20px; line-height: 1.2; font-weight: 650; letter-spacing: -.7px; }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; flex-shrink: 0; }
.chat-suggestions button { border: 1px solid #ded8ce; border-radius: 9px; padding: 7px 10px; background: white; font-size: 10px; text-align: left; color: #57534e; transition: border-color .15s, background .15s; }
.chat-suggestions button::after { content: " ↗"; color: var(--accent-deep); }
.chat-suggestions button:hover { border-color: var(--accent-deep); color: var(--accent-deep); background: var(--accent-wash); }
.chat-status { margin: 0; padding: 0 20px; font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
.chat-status:not(:empty) { padding-bottom: 10px; }
.chat-status.thinking::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-left: 8px; background: var(--accent); animation: chat-pulse 1s ease-in-out infinite alternate; }
@keyframes chat-pulse { to { opacity: .3; transform: scale(.75); } }
.is-thinking .chat-brand { border-color: #ff805a; box-shadow: 0 0 22px #ff683e20; }
.is-thinking .chat-brand .robot-eyes { animation: robot-think .9s ease-in-out infinite alternate; }
@keyframes robot-think { from { opacity: .4; } to { opacity: 1; } }
.is-listening .chat-brand { border-color: #ff805a; box-shadow: 0 0 0 5px #ff683e18; }
.is-listening .robot-antenna { animation: chat-pulse .6s ease-in-out infinite alternate; transform-origin: 40px 7px; }
.is-speaking .chat-brand .robot-mouth { transform-origin: 40px 59px; animation: robot-speak .35s ease-in-out infinite alternate; }
@keyframes robot-speak { to { transform: scaleX(.5); } }
.chat-voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 18px 7px; flex-shrink: 0; }
.chat-voice-controls button { border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 9px; background: white; color: var(--ink-soft); font-size: 10px; min-height: 34px; }
.chat-voice-controls .chat-mic { background: #242427; color: white; border-color: #242427; font-weight: 650; }
.chat-voice-controls button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent-deep); }
.chat-voice-controls button:disabled, .chat-suggestions button:disabled { opacity: .5; cursor: wait; }
.chat-voice-status, .chat-voice-notice { flex-shrink: 0; margin: 0 18px 8px; font-size: 10px; color: var(--ink-soft); line-height: 1.5; }
.chat-voice-status:empty { display: none; }
.chat-voice-notice a { color: inherit; }
.chat-links { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); flex-shrink: 0; }
.chat-links a { font-size: 10px; color: var(--ink-soft); text-decoration: none; }
.chat-links a:last-child { color: var(--accent-deep); font-weight: 700; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 14px; padding: 7px; border: 1px solid #d6d0c6; border-radius: 14px; background: white; flex-shrink: 0; box-shadow: 0 3px 8px #17171904; }
.chat-form:focus-within { border-color: var(--accent-deep); box-shadow: 0 0 0 2px var(--accent-wash); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; max-height: 90px; min-height: 38px; border: 0; padding: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); outline: none; box-shadow: none; }
.chat-form textarea:focus-visible { outline: none !important; }
.chat-send { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--accent-deep); color: white; }
.chat-send:disabled { opacity: .4; cursor: wait; }
.chat-privacy { flex-shrink: 0; margin: 9px 19px 12px; font-size: 9px; line-height: 1.6; color: var(--ink-soft); }
.chat-privacy a { color: inherit; text-decoration: underline; }
.agency-chat button:focus-visible, .agency-chat a:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }
body.has-chat .back-to-top { right: 24px; bottom: 108px; }
body.chat-open .back-to-top { visibility: hidden; }
@media (max-width: 480px) {
  .agency-chat { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .chat-launcher { width: 58px; height: 58px; min-height: 58px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
  .chat-launcher-avatar, .chat-launcher-avatar .chat-robot { width: 54px; height: 54px; }
  .chat-launcher-copy, .chat-launcher-arrow { display: none; }
  .chat-panel { width: calc(100vw - 28px); height: min(740px, calc(100dvh - 106px)); bottom: 76px; border-radius: 20px; }
  .chat-header { padding: 15px 16px; gap: 12px; }
  .chat-brand { width: 60px; height: 60px; border-radius: 19px; }
  .chat-brand .chat-robot { width: 56px; height: 56px; }
  .chat-header h2 { font-size: 20px; }
  .chat-header p { font-size: 10px; }
  .chat-form textarea { font-size: 16px; }
  .chat-messages { padding: 14px; }
  body.has-chat .back-to-top { right: 18px; bottom: 84px; }
}
@media (max-height: 760px) { .chat-suggestions { display: none; } .chat-header { padding-block: 12px; } .chat-welcome h3 { font-size: 18px; margin-top: 6px; } }
@media (max-height: 650px) {
  .chat-panel { height: calc(100dvh - 24px); min-height: 0; bottom: 0; }
  .chat-header { padding-block: 8px; }
  .chat-brand, .chat-brand .chat-robot { width: 40px; height: 40px; border-radius: 12px; }
  .chat-header-label, .chat-header p { display: none; }
  .chat-header h2 { margin-bottom: 0; font-size: 18px; }
  .chat-meta { padding-block: 0; }
  .chat-links { padding-block: 5px; }
  .chat-privacy { font-size: 9px; margin-block: 5px; }
  .chat-messages { min-height: 45px; }
}
@media (prefers-reduced-motion: reduce) { .agency-chat *, .agency-chat *::after { animation: none !important; transition: none !important; } }
