/* Guided chat assistant — floating launcher and panel (partials/chat.blade.php, js/chat.js).
   z-index sits under the sticky header (50) so header menus open over the panel. */
.chat { position: fixed; right: 24px; bottom: 24px; z-index: 45; font-family: var(--sans); }

/* Launcher: navy disc with a brass ring that breathes until the panel is opened */
.chat-launch { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; color: #fff; text-decoration: none;
    background: radial-gradient(circle at 30% 25%, var(--navy-3), var(--navy) 70%); box-shadow: 0 14px 34px -10px rgba(16,31,51,.6), inset 0 0 0 1px rgba(201,168,118,.55);
    transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; }
.chat-launch:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 20px 40px -12px rgba(16,31,51,.7), inset 0 0 0 1px var(--brass-2); }
.chat-launch:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 4px; }
.chat-launch::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(201,168,118,.55); animation: chatRing 2.8s ease-out infinite; pointer-events: none; }
.chat.is-open .chat-launch::before { animation: none; opacity: 0; }
.chat-launch svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: opacity .25s, transform .35s; }
.chat-launch circle { fill: currentColor; stroke: none; }
.chat-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.chat.is-open .chat-ico-open { opacity: 0; transform: rotate(90deg) scale(.6); }
.chat.is-open .chat-ico-close { opacity: 1; transform: none; }
.chat-dot { position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--brass-2); box-shadow: 0 0 0 2px #fdfcf9; transform: scale(0); transition: transform .3s; }
.chat.has-teaser .chat-dot { transform: scale(1); }
@keyframes chatRing { 0% { transform: scale(.92); opacity: .9; } 70%, 100% { transform: scale(1.28); opacity: 0; } }

/* Teaser bubble */
.chat-teaser { position: absolute; right: 74px; bottom: 10px; width: max-content; max-width: 240px; margin: 0; padding: 12px 16px; cursor: pointer;
    background: #fff; color: var(--navy); font-size: 13.5px; line-height: 1.4; border: 1px solid var(--line); border-radius: 14px 14px 4px 14px;
    box-shadow: 0 16px 36px -18px rgba(16,31,51,.45); animation: chatPop .45s cubic-bezier(.2,.9,.3,1.2); }

/* Panel */
.chat-panel { position: absolute; right: 0; bottom: 76px; width: 380px; height: min(620px, calc(100vh - 140px)); display: flex; flex-direction: column; overflow: hidden;
    background: #fdfcf9; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 40px 80px -30px rgba(16,31,51,.5); transform-origin: bottom right; animation: chatOpen .4s cubic-bezier(.2,.9,.3,1); }
.chat-panel[hidden] { display: none; }
.chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; color: #fff; background: linear-gradient(120deg, var(--navy), var(--navy-3)); position: relative; }
.chat-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--brass-2), transparent); }
.chat-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(201,168,118,.6); background: rgba(255,255,255,.05); }
.chat-avatar img { width: 30px; height: auto; }
.chat-head div { flex: 1; min-width: 0; }
.chat-head h2 { margin: 0; font: 500 19px/1.1 var(--serif); color: #fff; }
.chat-head p { margin: 3px 0 0; font-size: 11.5px; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 6px; }
.chat-head p::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fc48a; box-shadow: 0 0 6px #5fc48a; }
.chat-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .25s; }
.chat-x:hover { background: rgba(255,255,255,.18); }
.chat-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-msg { max-width: 86%; padding: 10px 14px; font-size: 14px; line-height: 1.5; border-radius: 16px; animation: chatIn .35s cubic-bezier(.2,.9,.3,1) both; overflow-wrap: anywhere; }
.chat-msg.instant, .chat-actions.instant { animation: none; }
.chat-bot { align-self: flex-start; background: #fff; color: var(--navy); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.chat-link { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-weight: 500; text-decoration: none; border-color: var(--brass-2); background: linear-gradient(100deg, rgba(201,168,118,.16), #fff); transition: background .25s; }
.chat-link:hover { background: rgba(201,168,118,.28); }
.chat-link svg, .chat-action svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-link svg { width: 16px; height: 16px; color: var(--brass); }
.chat-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-2); animation: chatDot 1s ease-in-out infinite; }
.chat-typing i:nth-child(2) { animation-delay: .15s; } .chat-typing i:nth-child(3) { animation-delay: .3s; }

.chat-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 4px; animation: chatIn .4s cubic-bezier(.2,.9,.3,1) both; }
.chat-action { display: flex; align-items: center; gap: 9px; padding: 12px; border-radius: 12px; font-size: 13px; font-weight: 500; color: var(--navy); text-decoration: none;
    background: #fff; border: 1px solid var(--line); transition: border-color .25s, transform .25s; }
.chat-action:first-child { background: var(--navy); color: #fff; border-color: var(--navy); }
.chat-action:hover { border-color: var(--brass-2); transform: translateY(-2px); }
.chat-action svg { width: 18px; height: 18px; color: var(--brass); }
.chat-action:first-child svg { color: var(--brass-2); }

.chat-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); background: #f7f4ee; max-height: 32%; overflow-y: auto; }
.chat-chips:empty { display: none; }
.chat-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(176,141,87,.55); background: #fff; color: var(--navy); font: 400 12.5px/1.25 var(--sans); cursor: pointer; text-align: left;
    transition: background .25s, color .25s, border-color .25s, transform .25s; animation: chatIn .35s cubic-bezier(.2,.9,.3,1) both; }
.chat-chip:hover, .chat-chip:focus-visible { background: var(--navy); color: #fff; border-color: var(--navy); transform: translateY(-1px); outline: none; }
.chat-chip-human { background: var(--brass-2); border-color: var(--brass-2); color: var(--navy); font-weight: 500; }
.chat-chip-quiet { border-style: dashed; color: var(--slate); }

@keyframes chatOpen { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes chatIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes chatPop { from { opacity: 0; transform: translateX(10px) scale(.9); } }
@keyframes chatDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 720px) {
    .chat { right: 16px; bottom: 16px; }
    .chat-launch { width: 54px; height: 54px; }
    .chat-panel { position: fixed; left: 10px; right: 10px; bottom: 82px; width: auto; height: min(580px, calc(100dvh - 110px)); }
    .chat-teaser { right: 66px; max-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
    .chat-launch::before, .chat-panel, .chat-msg, .chat-chip, .chat-actions, .chat-teaser, .chat-typing i { animation: none; }
}
