/* "Ask lemonope" help chat (assistant/templates/assistant/_chat.html + static/js/chat.js). Only new elements, scoped
   to .lc; uses the site's colour tokens, .btn and font. The launcher ships [hidden] and only shows with scripting on.
   It sits in the bottom corner and moves up out of the way of the tab bar, the add (+) button, sticky form buttons
   and the compare tray. */
.lc { --lc-gap: 16px; --lc-bottom: calc(var(--lc-gap) + env(safe-area-inset-bottom)); }
.lc-app { --lc-bottom: calc(78px + env(safe-area-inset-bottom)); }
body:has(.fab) .lc-app { --lc-bottom: calc(146px + env(safe-area-inset-bottom)); }
body:has(.sticky-actions, .upl-actions) .lc-app { --lc-bottom: calc(146px + env(safe-area-inset-bottom)); }
body:has(.cmp-tray:not([hidden])) .lc { --lc-bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
  .lc-app { --lc-bottom: 1.5rem; }
  body:has(.fab) .lc-app { --lc-bottom: calc(1.5rem + 70px); }
  body:has(.sticky-actions, .upl-actions) .lc-app { --lc-bottom: 5.5rem; }
}
.lc-fab { position: fixed; z-index: 12; inset-inline-end: var(--lc-gap); bottom: var(--lc-bottom); display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem .55rem .85rem; border: 0; border-radius: 999px; background: var(--brand-deep); color: #fff; font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; box-shadow: 0 6px 18px rgba(20,83,45,.3), 0 2px 4px rgba(0,0,0,.12); }
.lc-fab:hover { background: var(--brand-hover); }
.lc-fab[hidden], .lc-panel[hidden] { display: none; }
.lc.is-open .lc-fab { display: none; }
body:has(.sim-toast:not([hidden])) .lc-fab, body:has(dialog[open]) .lc-fab { display: none; }
.lc-panel { position: fixed; z-index: 35; inset-inline: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; height: min(78vh, 620px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(28,25,23,.22); overflow: hidden; }
.lc-app .lc-panel { bottom: calc(70px + env(safe-area-inset-bottom)); height: min(72vh, 600px); }
@media (min-width: 760px) {
  .lc-panel, .lc-app .lc-panel { inset-inline: auto var(--lc-gap); bottom: var(--lc-gap); width: 380px; height: min(80vh, 600px); }
}
.lc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: .8rem .9rem .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg); }
.lc-head h2 { margin: 0; font-size: 1rem; }
.lc-sub { margin: .1rem 0 0; color: var(--muted); font-size: .8rem; }
.lc-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lc-x:hover { background: rgba(0,0,0,.06); }
.lc-log { flex: 1 1 auto; overflow-y: auto; padding: .8rem .8rem .4rem; display: flex; flex-direction: column; gap: .6rem; overscroll-behavior: contain; }
.lc-msg { max-width: 92%; padding: .6rem .8rem; border-radius: 14px; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.lc-msg p { margin: 0 0 .45rem; white-space: pre-line; }
.lc-msg p:last-child { margin-bottom: 0; }
.lc-bot { align-self: flex-start; background: var(--bg); border-end-start-radius: 4px; }
.lc-user { align-self: flex-end; background: var(--brand-deep); color: #fff; border-end-end-radius: 4px; }
.lc-items { list-style: none; margin: .2rem 0 .5rem; padding: 0; display: grid; gap: .35rem; }
.lc-items a { display: block; padding: .45rem .6rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 650; }
.lc-items a:hover { border-color: var(--brand-line); }
.lc-items span { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
.lc-link { display: inline-block; margin: .1rem 0 .35rem; color: var(--brand-deep); font-weight: 650; }
.lc-note { color: var(--muted); font-size: .8rem; }
.lc-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.lc-chips + p { margin-top: calc(var(--lc-gap) * .75); } /* "Contact us" under the fallback chips: a little air */
.lc-chip { appearance: none; font: inherit; font-size: .82rem; font-weight: 600; min-height: 34px; padding: .3rem .7rem; border-radius: 999px; border: 1px solid #D9D6CA; background: var(--surface); color: var(--ink); cursor: pointer; text-align: start; }
.lc-chip:hover { border-color: var(--ink); }
.lc-rate { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; color: var(--muted); font-size: .8rem; }
.lc-rate button { min-height: 30px; padding: .15rem .6rem; border-radius: 999px; border: 1px solid #D9D6CA; background: var(--surface); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.lc-rate button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-line); }
.lc-why { display: flex; gap: .35rem; width: 100%; margin-top: .35rem; }
.lc-why input { flex: 1 1 auto; min-width: 0; min-height: 34px; padding: .3rem .6rem; border: 1px solid #D9D6CA; border-radius: 10px; font: inherit; font-size: .85rem; }
.lc-typing { color: var(--muted); font-style: italic; }
.lc-form { display: flex; gap: .45rem; padding: .6rem .7rem calc(.6rem + env(safe-area-inset-bottom) * 0); border-top: 1px solid var(--line); background: var(--surface); }
.lc-form input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: .45rem .75rem; border: 1px solid #D9D6CA; border-radius: 999px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.lc-form input:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 1px; }
.lc-send { flex: none; min-height: 40px; }
@media print { .lc { display: none; } }
