/* Website chat widget. Brand: lime on near-black; follows the app's data-theme and the OS setting. */
.syc-chat {
    --c-bg: #ffffff; --c-text: #1d2520; --c-muted: #6b776f; --c-line: #e3e8e4;
    --c-accent: #c2f970; --c-accent-text: #0a0f0b; --c-bot: #f1f4f2; --c-visitor: #0f1e13; --c-visitor-text: #eef9f0;
    --c-team: #e4f6c8; --c-system: #fff6dd;
    position: fixed; right: 20px; bottom: 20px; z-index: 9990; font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--c-text);
}
html[data-theme="dark"] .syc-chat {
    --c-bg: #0f1e13; --c-text: #eef9f0; --c-muted: #9dc2a5; --c-line: #274a30;
    --c-bot: #16301d; --c-visitor: #c2f970; --c-visitor-text: #0a0f0b; --c-team: #1f4a2a; --c-system: #3a2e0f;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]):not([data-theme="dark"]) .syc-chat {
        --c-bg: #0f1e13; --c-text: #eef9f0; --c-muted: #9dc2a5; --c-line: #274a30;
        --c-bot: #16301d; --c-visitor: #c2f970; --c-visitor-text: #0a0f0b; --c-team: #1f4a2a; --c-system: #3a2e0f;
    }
}
.syc-chat button { font: inherit; cursor: pointer; }
.syc-chat button:focus-visible, .syc-chat textarea:focus-visible, .syc-chat a:focus-visible { outline: 2px solid #4f9b2b; outline-offset: 2px; }

.syc-launcher {
    position: relative; display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 12px 18px;
    border: 0; border-radius: 999px; background: var(--c-accent); color: var(--c-accent-text); font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .15s ease;
}
.syc-launcher:hover { transform: translateY(-1px); }
.syc-badge {
    position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: #d6334a; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.syc-nudge {
    display: flex; align-items: center; gap: 10px; max-width: 260px; margin: 0 0 10px auto; padding: 10px 12px; cursor: pointer;
    background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-line); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.syc-nudge[hidden] { display: none; }
.syc-nudge-close { border: 0; background: none; color: var(--c-muted); font-size: 18px; line-height: 1; padding: 0 2px; }

.syc-panel {
    display: flex; flex-direction: column; width: 370px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 110px);
    margin-bottom: 12px; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 16px; overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}
.syc-panel[hidden] { display: none; }
.syc-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: #0f1e13; color: #eef9f0; }
.syc-title { display: flex; flex-direction: column; }
.syc-title strong { font-size: 15px; color: #eef9f0; }
.syc-status { font-size: 12px; color: #b8dcc0; }
.syc-icon-btn { border: 0; background: none; color: inherit; font-size: 24px; line-height: 1; padding: 0 4px; }

.syc-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.syc-msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.syc-bot, .syc-team { align-self: flex-start; background: var(--c-bot); border-bottom-left-radius: 4px; }
.syc-team { background: var(--c-team); }
.syc-visitor { align-self: flex-end; background: var(--c-visitor); color: var(--c-visitor-text); border-bottom-right-radius: 4px; }
.syc-system { align-self: center; max-width: 94%; background: var(--c-system); color: var(--c-text); font-size: 12.5px; text-align: center; }
.syc-typing { display: flex; gap: 4px; padding: 12px 14px; }
.syc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); animation: syc-bounce 1s infinite; }
.syc-typing i:nth-child(2) { animation-delay: .15s; }
.syc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes syc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .syc-typing i { animation: none; opacity: .7; } .syc-launcher { transition: none; } }

.syc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.syc-chips[hidden] { display: none; }
.syc-chip { padding: 7px 11px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-bg); color: var(--c-text); font-size: 13px; }
.syc-chip:hover { border-color: #4f9b2b; }

.syc-actions { display: flex; justify-content: space-between; padding: 0 14px 6px; }
.syc-link { border: 0; background: none; padding: 2px 0; color: var(--c-muted); font-size: 12.5px; text-decoration: underline; }
.syc-link[hidden] { display: none; }

.syc-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid var(--c-line); }
.syc-input {
    flex: 1; resize: none; max-height: 110px; padding: 9px 11px; border: 1px solid var(--c-line); border-radius: 12px;
    background: var(--c-bg); color: var(--c-text); font: inherit;
}
.syc-send { padding: 9px 14px; border: 0; border-radius: 12px; background: var(--c-accent); color: var(--c-accent-text); font-weight: 700; }
.syc-send:disabled { opacity: .5; cursor: default; }
.syc-fine { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--c-muted); }
.syc-fine a { color: inherit; text-decoration: underline; }

@media (max-width: 520px) {
    .syc-chat { right: 12px; bottom: 12px; }
    .syc-panel { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border-radius: 0; border: 0; }
    .syc-chat[data-open="true"] .syc-launcher { display: none; }      /* the full-screen panel has its own close button */
    .syc-form { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .syc-launcher-text { display: none; }
    .syc-launcher { padding: 14px; }
}
