/* SOL Assistant chat widget (inc/chat.php, assets/js/sol-chat.js). */

.sol-chat { --chat-ink: var(--sol-ink, #0f172a); --chat-amber: var(--sol-harvest, #d97706); position: fixed; right: 18px; bottom: 18px; z-index: 150; font-family: var(--sol-font); font-size: 15px; line-height: 1.55; color: var(--chat-ink); -webkit-font-smoothing: antialiased; }
.sol-chat *, .sol-chat *::before, .sol-chat *::after { box-sizing: border-box; }
.sol-chat svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sol-chat button { font: inherit; }

/* Keep the other floating buttons clear of the chat launcher. */
.sol-has-chat .sol-float-wa { bottom: 90px; }
.sol-has-chat .sol-totop { bottom: 158px; }
.sol-has-chat .sol-float-wa, .sol-has-chat .sol-totop { transition: opacity .2s ease; }
body:has(.sol-chat.is-open) .sol-float-wa, body:has(.sol-chat.is-open) .sol-totop { opacity: 0; pointer-events: none; }
.sol-has-chat .sol-cookie { z-index: 160; } /* above the chat launcher until accepted */

/* Launcher */
.sol-chat__launch { position: relative; width: 60px; height: 60px; border: 0; border-radius: 50%; background: var(--chat-ink); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 16px 32px -12px rgba(15, 23, 42, .6), 0 0 0 4px rgba(217, 119, 6, .18); transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease; }
.sol-chat__launch:hover { transform: translateY(-2px); background: #1e293b; box-shadow: 0 20px 36px -12px rgba(15, 23, 42, .6), 0 0 0 6px rgba(217, 119, 6, .22); }
.sol-chat__launch:focus-visible { outline: 3px solid var(--chat-amber); outline-offset: 3px; }
.sol-chat__launch::after { content: ""; position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--chat-ink); }
.sol-chat.is-open .sol-chat__launch::after { display: none; }
.sol-chat__launch-icon { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .2s ease, transform .2s ease; }
.sol-chat__launch-icon svg { width: 26px; height: 26px; }
.sol-chat__launch-icon--x { opacity: 0; transform: scale(.6); }
.sol-chat.is-open .sol-chat__launch-icon--bot { opacity: 0; transform: scale(.6); }
.sol-chat.is-open .sol-chat__launch-icon--x { opacity: 1; transform: none; }
.sol-chat__badge { position: absolute; top: -4px; left: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.sol-chat__badge[hidden] { display: none; }

/* "Hi, I'm online" nudge */
.sol-chat__hello { position: absolute; right: 74px; bottom: 6px; width: 214px; padding: 12px 16px; border: 1px solid var(--sol-border, #e2e8f0); border-radius: 16px 16px 4px 16px; background: #fff; color: var(--chat-ink); text-align: left; cursor: pointer; box-shadow: 0 18px 36px -18px rgba(15, 23, 42, .45); animation: sol-chat-pop .35s ease both; }
.sol-chat__hello[hidden] { display: none; }
.sol-chat__hello strong { display: block; font-family: var(--sol-display); font-size: 15px; }
.sol-chat__hello span { display: block; margin-top: 2px; font-size: 13px; color: var(--sol-mist, #64748b); }
.sol-chat__hello:hover { border-color: rgba(217, 119, 6, .45); }
@media (max-width: 639px) { .sol-chat__hello { display: none; } }

/* Panel */
.sol-chat__panel { position: absolute; right: 0; bottom: 76px; width: 400px; height: min(620px, calc(100vh - 120px)); height: min(620px, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #f8fafc; border: 1px solid rgba(15, 23, 42, .08); box-shadow: 0 32px 64px -24px rgba(15, 23, 42, .55); opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; transition: opacity .22s ease, transform .22s ease; }
.sol-chat__panel[hidden] { display: none; }
.sol-chat.is-shown .sol-chat__panel { opacity: 1; transform: none; }
@media (max-width: 639px) {
	.sol-chat { right: 14px; bottom: 14px; }
	.sol-chat__panel { position: fixed; left: 10px; right: 10px; bottom: 86px; width: auto; height: calc(100vh - 110px); height: calc(100dvh - 110px); }
}

.sol-chat__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 18px; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; }
.sol-chat__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sol-chat__avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--chat-amber); color: var(--chat-ink); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sol-chat__avatar svg { width: 22px; height: 22px; }
.sol-chat__name { margin: 0; font-family: var(--sol-display); font-weight: 700; font-size: 17px; line-height: 1.2; color: #fff; }
.sol-chat__status { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.sol-chat__status i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.sol-chat__tools { display: flex; gap: 4px; }
.sol-chat__tools button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: rgba(255, 255, 255, .75); display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.sol-chat__tools button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sol-chat__tools svg { width: 18px; height: 18px; }

.sol-chat__links { display: grid; grid-template-columns: 1fr 1fr; background: #1e293b; border-top: 1px solid rgba(255, 255, 255, .08); }
.sol-chat__links a { padding: 10px 8px; text-align: center; font-size: 13px; font-weight: 600; color: #fde68a !important; text-decoration: none; transition: background-color .2s ease; }
.sol-chat__links a + a { border-left: 1px solid rgba(255, 255, 255, .08); }
.sol-chat__links a:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }

/* Messages */
.sol-chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.sol-chat__msg { display: flex; animation: sol-chat-pop .25s ease both; }
.sol-chat__msg--user { justify-content: flex-end; }
.sol-chat__bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.sol-chat__msg--bot .sol-chat__bubble { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; color: var(--chat-ink); box-shadow: 0 6px 16px -14px rgba(15, 23, 42, .5); }
.sol-chat__msg--user .sol-chat__bubble { background: var(--chat-ink); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.sol-chat__msg.is-error .sol-chat__bubble { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.sol-chat__bubble p { margin: 0 0 6px; }
.sol-chat__bubble p:last-child, .sol-chat__bubble ul:last-child, .sol-chat__bubble ol:last-child { margin-bottom: 0; }
.sol-chat__bubble ul, .sol-chat__bubble ol { margin: 4px 0 8px; padding-left: 18px; }
.sol-chat__bubble li { margin: 2px 0; }
.sol-chat__bubble a { color: var(--sol-harvest-dark, #b45309); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sol-chat__bubble a:hover { color: var(--chat-ink); }
.sol-chat__bubble code { padding: 1px 5px; border-radius: 5px; background: #f1f5f9; font-size: 13px; }

.sol-chat__chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.sol-chat__chips-label { grid-column: 1 / -1; margin: 4px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sol-mist, #64748b); }
.sol-chat__chip { min-height: 56px; padding: 10px 12px; border: 1px solid rgba(217, 119, 6, .35); border-radius: 14px; background: #fffbeb; color: var(--chat-ink); font-size: 13px; font-weight: 600; line-height: 1.3; text-align: left; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, transform .2s ease, color .2s ease; }
.sol-chat__chip:hover { background: var(--chat-ink); border-color: var(--chat-ink); color: #fff; transform: translateY(-1px); }
@media (max-width: 379px) { .sol-chat__chips { grid-template-columns: 1fr; } }

.sol-chat__typing .sol-chat__bubble { display: flex; gap: 4px; padding: 14px 16px; }
.sol-chat__typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: sol-chat-dot 1.2s infinite ease-in-out; }
.sol-chat__typing i:nth-child(2) { animation-delay: .15s; }
.sol-chat__typing i:nth-child(3) { animation-delay: .3s; }

/* Input */
.sol-chat__form { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #fff; }
.sol-chat__form textarea { flex: 1; min-height: 42px; max-height: 120px; margin: 0; padding: 10px 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; color: var(--chat-ink); font: inherit; font-size: 14px; line-height: 1.45; resize: none; box-shadow: none; transition: border-color .2s ease, box-shadow .2s ease; }
.sol-chat__form textarea:focus { outline: none; border-color: var(--chat-amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, .15); background: #fff; }
.sol-chat__form button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--chat-amber); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .2s ease, opacity .2s ease; }
.sol-chat__form button:hover:not(:disabled) { background: var(--chat-ink); }
.sol-chat__form button:disabled { opacity: .4; cursor: not-allowed; }
.sol-chat__form button svg { width: 18px; height: 18px; }
.sol-chat__foot { margin: 0; padding: 0 12px 10px; background: #fff; text-align: center; font-size: 11px; color: var(--sol-mist, #64748b); }
.sol-chat__foot a { color: inherit; font-weight: 600; }

@keyframes sol-chat-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sol-chat-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
	.sol-chat *, .sol-chat__panel { animation: none !important; transition: none !important; }
}
@media print { .sol-chat { display: none; } }
