/* Affy guided assistant (assets/js/assistant.js) */

.lu { position: fixed; right: clamp(12px, 2vw, 24px); bottom: clamp(12px, 2vw, 24px); z-index: 80; font-family: var(--f-text); }

.lu-launch { display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; border: 0; background: var(--ink); color: var(--white); font: 500 .9375rem/1 var(--f-text); cursor: pointer; box-shadow: 0 10px 30px rgba(44, 44, 44, .18); transition: background-color .2s; }
.lu-launch:hover { background: var(--sage); }
.lu.is-open .lu-launch { display: none; }

.lu-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); overflow: hidden; display: grid; place-items: center; flex: none; }
.lu-avatar img { width: 88%; mix-blend-mode: multiply; margin-top: 10%; }

.lu-nudge { position: absolute; right: 0; bottom: calc(100% + 10px); margin: 0; background: var(--white); color: var(--ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: .875rem; white-space: nowrap; box-shadow: 0 8px 24px rgba(44, 44, 44, .12); cursor: pointer; }

.lu-panel { width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 48px)); background: var(--paper); border-radius: 24px; box-shadow: 0 20px 60px rgba(44, 44, 44, .25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--lavender); }
.lu-panel[hidden] { display: none; }

.lu-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--sage); color: var(--white); }
.lu-head strong { display: block; font-family: var(--f-display); font-weight: 600; font-size: 1.35rem; line-height: 1.1; }
.lu-head span { font-size: .8125rem; opacity: .8; }
.lu-head > div { flex: 1; }
.lu-close { background: none; border: 0; color: var(--white); font-size: 1.75rem; line-height: 1; padding: 4px 8px; cursor: pointer; border-radius: 8px; }
.lu-close:hover { background: rgba(255, 255, 255, .12); }

.lu-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.lu-msg { margin: 0; padding: 10px 14px; border-radius: 18px; font-size: .9375rem; line-height: 1.45; max-width: 88%; }
.lu-msg--lu { background: var(--white); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.lu-msg--me { background: var(--lavender); color: var(--ink); border-bottom-right-radius: 4px; align-self: flex-end; }
.lu-typing { color: var(--grey); letter-spacing: .2em; }

.lu-links { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 100%; }
.lu-link { font-size: .875rem; padding: .55em 1em; border-radius: 999px; border: 1.5px solid var(--colvert); color: var(--ink); text-decoration: none; background: var(--white); }
.lu-link:hover { border-color: var(--sage); }
.lu-link--primary { background: var(--ink); border-color: var(--ink); color: var(--white); }
.lu-link--primary:hover { background: var(--sage); border-color: var(--sage); }

.lu-choices { padding: 10px 14px 14px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--lavender); max-height: 46%; overflow-y: auto; }
.lu-choices:empty { display: none; }
.lu-choice { font: 500 .875rem/1.2 var(--f-text); padding: .6em 1em; border-radius: 999px; border: 1.5px solid var(--sage); background: var(--white); color: var(--sage); cursor: pointer; text-align: left; }
.lu-choice:hover { background: var(--sage); color: var(--white); }
.lu-choice--quiet { border-color: transparent; background: none; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.lu-choice--quiet:hover { background: none; color: var(--ink); }

.lu-form { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.lu-form label { display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; font-weight: 500; color: var(--ink); }
.lu-form label span { font-weight: 400; color: var(--ink-soft); }
.lu-form input, .lu-form textarea { font: 400 .9375rem var(--f-text); padding: .6em .8em; border-radius: 12px; border: 1px solid var(--lavender-deep); background: rgba(195, 183, 204, .15); color: var(--ink); resize: vertical; }
.lu-form input:focus, .lu-form textarea:focus { outline: 2px solid var(--sage); outline-offset: 1px; background: var(--white); }
.lu-hp { position: absolute; left: -9999px; }
.lu-consent { margin: 0; font-size: .75rem; color: var(--ink-soft); line-height: 1.4; }
.lu-consent a { color: var(--sage); }
.lu-error { margin: 0; font-size: .8125rem; color: #A3423B; }
.lu-form-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lu-send { font: 500 .9375rem/1 var(--f-text); padding: .85em 1.3em; border-radius: 999px; border: 0; background: var(--ink); color: var(--white); cursor: pointer; }
.lu-send:hover { background: var(--sage); }
.lu-send:disabled { opacity: .6; cursor: wait; }

@media (max-width: 520px) {
  .lu.is-open { inset: 0; }
  .lu-panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .lu-launch-text { display: none; }
  .lu-launch { padding: 6px; }
}

@media (prefers-reduced-motion: no-preference) {
  .lu-panel:not([hidden]) { animation: lu-in .28s cubic-bezier(.2, .7, .2, 1); }
  .lu-msg { animation: lu-msg .25s ease-out; }
  .lu-nudge:not([hidden]) { animation: lu-msg .4s ease-out; }
  .lu-launch .lu-avatar img { animation: bob 3.2s ease-in-out infinite; }
}
@keyframes lu-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lu-msg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
