/* SYNNET Chat Widget — Bold/Branded Theme (Azul→Cyan) */

/* ═══════════════════════════════
   CSS CUSTOM PROPERTIES
   ═══════════════════════════════ */

#synnet-chat-widget {
    --sa-g1: #0066FF;
    --sa-g2: #00c2d6;
    --sa-primary: #0066FF;
    --sa-bg: #fff;
    --sa-surface: #f4f7fb;
    --sa-text: #0b1f33;
    --sa-muted: #7a8aa0;
    --sa-success: #30d158;
    --sa-badge: #FF8A00;
    --sa-gradient: linear-gradient(135deg, var(--sa-g1), var(--sa-g2));
    --sa-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-family: var(--sa-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

#synnet-chat-widget *,
#synnet-chat-widget *::before,
#synnet-chat-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════
   KEYFRAMES
   ═══════════════════════════════ */

@keyframes sa-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
@keyframes sa-pulse {
    0%   { transform: scale(1); opacity: .6; }
    70%  { transform: scale(1.4); opacity: 0; }
    100% { opacity: 0; }
}
@keyframes sa-sheen {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}
@keyframes sa-badge-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}
@keyframes sa-msg-in {
    from { opacity: 0; transform: translateY(4px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sa-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
@keyframes sa-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: .3; }
    40%            { transform: translateY(-4px); opacity: 1; }
}
@keyframes synnetTypingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: .3; }
    40%            { transform: translateY(-3px); opacity: 1; }
}

/* ═══════════════════════════════
   BUBBLE (fixed bottom-right)
   ═══════════════════════════════ */

.synnet-chat-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--sa-gradient);
    background-size: 180% 180%;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--sa-g1) 45%, transparent);
    animation: sa-float 4s ease-in-out infinite, sa-sheen 6s ease infinite;
    transition: box-shadow 0.2s ease;
}
.synnet-chat-bubble::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--sa-g2) 55%, transparent);
    animation: sa-pulse 2.4s infinite;
    pointer-events: none;
}
.synnet-chat-bubble:hover {
    box-shadow: 0 16px 36px color-mix(in srgb, var(--sa-g1) 55%, transparent);
}
.synnet-chat-bubble:active { transform: scale(0.93); }
.synnet-chat-bubble svg  { width: 31px; height: 31px; fill: #fff; }
.synnet-chat-bubble.left { right: auto; left: 28px; }

/* Unread badge */
.synnet-bubble-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: var(--sa-badge);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--sa-surface);
    animation: sa-badge-pop 0.3s ease;
}

/* ═══════════════════════════════
   WINDOW
   ═══════════════════════════════ */

.synnet-chat-window {
    position: fixed;
    bottom: 108px;
    right: 28px;
    width: 340px;
    height: auto;
    min-height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--sa-bg);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 36px 80px rgba(11, 31, 51, .30);
    display: flex;
    flex-direction: column;
    z-index: 99998;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.synnet-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.synnet-chat-window.left { right: auto; left: 28px; }
.synnet-chat-window.synnet-chat-mode {
    height: 720px;
    max-height: calc(100vh - 80px);
}

/* ═══════════════════════════════
   INVITATION NUDGE (bubble card)
   ═══════════════════════════════ */

@keyframes sa-pop {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.synnet-nudge {
    position: fixed;
    bottom: 38px;
    right: 104px;
    display: none;
    align-items: center;
    gap: 4px;
    background: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: #0b1f33;
    box-shadow: 0 12px 30px rgba(11, 31, 51, .16);
    white-space: nowrap;
    z-index: 99997;
    animation: sa-pop .5s ease both;
    font-family: var(--sa-font);
    line-height: 1.3;
}
.synnet-nudge b {
    color: var(--sa-primary);
}
.synnet-nudge-x {
    margin-left: 8px;
    color: #b8c2cf;
    cursor: pointer;
    font-style: normal;
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s;
}
.synnet-nudge-x:hover { color: #7a8aa0; }

/* left-position variant */
.synnet-nudge.left {
    right: auto;
    left: 104px;
    border-radius: 16px 16px 16px 4px;
}

/* ═══════════════════════════════
   HEADER
   ═══════════════════════════════ */

.synnet-chat-header {
    background: var(--sa-gradient);
    background-size: 180% 180%;
    animation: sa-sheen 8s ease infinite;
    color: #fff;
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
    border-radius: 26px 26px 0 0;
    position: relative;
    overflow: hidden;
}

/* Top row: back + avatar + info + badge + actions */
.synnet-chat-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Welcome line below the top row */
.synnet-welcome {
    margin-top: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .92);
    position: relative;
    z-index: 1;
}

/* Hide welcome in chat mode (back btn visible = chat mode) */
#synnet-chat-widget .synnet-chat-window.synnet-chat-mode .synnet-welcome {
    display: none;
}
.synnet-chat-header::before {
    content: '';
    position: absolute;
    top: -46px;
    right: -34px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    pointer-events: none;
}
.synnet-chat-header::after {
    content: '';
    position: absolute;
    bottom: -54px;
    left: 24px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
    pointer-events: none;
}

/* Back button (only in chat mode) */
#synnet-chat-widget .synnet-chat-back {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: background 0.2s;
}
#synnet-chat-widget .synnet-chat-back:hover {
    background: rgba(255, 255, 255, .18);
}

/* Avatar — glassy branded */
.synnet-chat-header-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: visible;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    padding: 0;
}
.synnet-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 50%;
}
/* Presence dot */
.synnet-chat-header-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--sa-success);
    border: 2.5px solid color-mix(in srgb, var(--sa-g1), var(--sa-g2));
}

/* Hide presence dot in home mode */
#synnet-chat-widget .synnet-chat-window:not(.synnet-chat-mode) .synnet-chat-header-avatar::after {
    display: none;
}

/* Info */
.synnet-chat-header-info {
    flex: 1;
    min-width: 0;
    padding-left: 2px;
    position: relative;
    z-index: 1;
}
.synnet-chat-header-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.1px;
}
.synnet-chat-header-info p {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .92);
    margin: 2px 0 0;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
}
.synnet-chat-header-info .synnet-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sa-success);
    display: inline-block;
    flex-shrink: 0;
}

/* Hide status info in home mode */
#synnet-chat-widget .synnet-chat-window:not(.synnet-chat-mode) .synnet-chat-header-info p {
    display: none;
}
#synnet-chat-widget .synnet-chat-window:not(.synnet-chat-mode) .synnet-chat-header-info {
    padding-left: 0;
}
#synnet-chat-widget .synnet-chat-window:not(.synnet-chat-mode) .synnet-chat-header-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Header badge */
.synnet-chat-header-badge {
    display: none;
    align-items: center;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

/* Header actions (kebab + close) */
.synnet-chat-header-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    z-index: 1;
}
.synnet-chat-menu-btn,
.synnet-chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, .16);
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}
.synnet-chat-menu-btn:hover,
.synnet-chat-close:hover {
    background: rgba(255, 255, 255, .28);
}
.synnet-chat-menu-btn svg { fill: currentColor; }

/* Hide kebab in home mode */
#synnet-chat-widget .synnet-chat-window:not(.synnet-chat-mode) .synnet-chat-menu-btn {
    display: none !important;
}

/* Dropdown menu */
.synnet-chat-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    min-width: 200px;
    overflow: hidden;
    z-index: 100;
    border: 1px solid rgba(0, 0, 0, .06);
}
.synnet-chat-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.synnet-chat-menu-item:hover { background: #fef2f2; }

/* ═══════════════════════════════
   MODE INDICATOR
   ═══════════════════════════════ */

.synnet-chat-mode {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: var(--sa-bg);
    color: var(--sa-muted);
    border-bottom: 1px solid #eef2f7;
}
.synnet-chat-mode.waiting {
    background: #fff9eb;
    color: #b45309;
}
.synnet-chat-mode.agent {
    background: #edfcf2;
    color: #059669;
}

/* ═══════════════════════════════
   PRE-CHAT FORM
   ═══════════════════════════════ */

#synnet-chat-widget .synnet-prechat-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 20px;
    background: var(--sa-bg);
    overflow-y: auto;
}

/* Legacy alias kept for markup compat */
.synnet-prechat {
    display: contents;
}

/* Form header */
#synnet-chat-widget .synnet-pc-header {
    text-align: center;
    margin-bottom: 32px;
}
#synnet-chat-widget .synnet-pc-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--sa-g1) 10%, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
}
.synnet-pc-icon svg {
    width: 26px;
    height: 26px;
    color: var(--sa-primary);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.synnet-pc-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--sa-text);
    letter-spacing: -0.3px;
}
.synnet-pc-subtitle {
    font-size: 14px;
    color: var(--sa-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* Fields */
.synnet-pc-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 28px;
}
.synnet-pc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.synnet-pc-row .synnet-pc-field { min-width: 0; }

/* Labels */
#synnet-chat-widget .synnet-pc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sa-text);
    margin-bottom: 8px;
    padding: 0;
}

/* Inputs */
#synnet-chat-widget .synnet-pc-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    color: var(--sa-text);
    font-family: var(--sa-font);
    font-size: 15px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#synnet-chat-widget .synnet-pc-input::placeholder { color: var(--sa-muted); }
#synnet-chat-widget .synnet-pc-input:hover { border-color: #adb5bd; }
#synnet-chat-widget .synnet-pc-input:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sa-g1) 16%, transparent);
}

/* Submit button */
#synnet-chat-widget .synnet-pc-submit {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    background: var(--sa-gradient);
    background-size: 180% 180%;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--sa-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}
#synnet-chat-widget .synnet-pc-submit:hover {
    box-shadow: 0 4px 14px color-mix(in srgb, var(--sa-g1) 35%, transparent);
    transform: translateY(-1px);
}
#synnet-chat-widget .synnet-pc-submit:active { transform: translateY(0); }

/* Footer */
.synnet-pc-footer {
    padding: 20px 0 0;
    margin-top: 8px;
    text-align: center;
}
.synnet-pc-footer span {
    font-size: 12px;
    color: var(--sa-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.synnet-pc-footer .sa-secure-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sa-success);
    display: inline-block;
}

/* Phone row with country selector */
.synnet-pc-phone-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.synnet-pc-country {
    width: 90px;
    flex-shrink: 0;
    padding: 8px 4px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: var(--sa-bg);
    color: var(--sa-text);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.synnet-pc-country:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sa-g1) 16%, transparent);
}
.synnet-pc-country option {
    background: #fff;
    color: var(--sa-text);
}
.synnet-pc-phone-input {
    flex: 1;
    min-width: 0;
}

/* Pre-chat field names (used in JS as .synnet-pc-name, .synnet-pc-email, etc.) */
.synnet-pc-name,
.synnet-pc-lastname,
.synnet-pc-email,
.synnet-pc-phone {
    /* Layout container — inherits from .synnet-pc-field */
    display: flex;
    flex-direction: column;
}

/* Validation */
.synnet-pc-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .15);
}
.synnet-pc-error {
    color: #dc2626;
    font-size: 11px;
    margin: 2px 0 6px 4px;
}

/* ═══════════════════════════════
   MESSAGES
   ═══════════════════════════════ */

.synnet-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-height: 0;
    background: var(--sa-surface);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.synnet-chat-messages::-webkit-scrollbar { width: 0; display: none; }

/* Group spacing */
#synnet-chat-widget .synnet-msg.synnet-msg-first { margin-top: 12px; }
#synnet-chat-widget .synnet-msg.synnet-msg-first:first-child { margin-top: 0; }
.synnet-msg-last { /* marker class — no extra style needed */ }

#synnet-chat-widget .synnet-msg {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: sa-msg-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
}

#synnet-chat-widget .synnet-msg-bubble {
    padding: 10px 13px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    width: fit-content;
    text-align: left;
}

/* Date separator */
.synnet-date-sep {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 8px;
    text-align: center;
    position: relative;
}
.synnet-date-sep::before,
.synnet-date-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dce5ef;
}
.synnet-date-sep span {
    font-size: 11px;
    color: var(--sa-muted);
    background: var(--sa-surface);
    padding: 0 10px;
    font-weight: 500;
    letter-spacing: 0.4px;
}

/* User messages — right */
#synnet-chat-widget .synnet-msg.user {
    align-items: flex-end;
    text-align: left;
}
#synnet-chat-widget .synnet-msg.user .synnet-msg-bubble {
    background: var(--sa-gradient);
    color: #fff;
    border: none;
    border-radius: 16px 16px 4px 16px;
    max-width: 70%;
    width: fit-content;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--sa-g1) 30%, transparent);
}

/* Assistant / Agent messages — left */
#synnet-chat-widget .synnet-msg.assistant,
#synnet-chat-widget .synnet-msg.agent {
    align-items: flex-start;
    text-align: left;
    padding-left: 0;
}
/* Row: avatar beside bubble */
#synnet-chat-widget .synnet-msg.assistant .synnet-msg-row,
#synnet-chat-widget .synnet-msg.agent .synnet-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
#synnet-chat-widget .synnet-msg.assistant .synnet-msg-bubble,
#synnet-chat-widget .synnet-msg.agent .synnet-msg-bubble {
    background: #e0e9f5;
    color: var(--sa-text);
    border: 1px solid #cddaee;
    border-radius: 16px 16px 16px 5px;
    max-width: 78%;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(11, 31, 51, .07);
}
#synnet-chat-widget .synnet-msg.assistant .synnet-msg-bubble strong,
#synnet-chat-widget .synnet-msg.agent .synnet-msg-bubble strong {
    color: var(--sa-text);
    font-weight: 600;
}

/* Lists inside bubbles */
.synnet-msg-list {
    margin: 6px 0 2px;
    padding-left: 18px;
    list-style: disc;
}
.synnet-msg-list li {
    margin: 2px 0;
    padding-left: 2px;
}

/* System messages */
#synnet-chat-widget .synnet-msg.system {
    align-items: center;
    text-align: center;
    margin: 6px 0;
}
#synnet-chat-widget .synnet-msg.system .synnet-msg-bubble {
    background: var(--sa-surface);
    color: var(--sa-muted);
    font-size: 12px;
    font-style: italic;
    text-align: center;
    padding: 6px 14px;
    max-width: 90%;
    border: none;
    border-radius: 20px;
    display: inline-block;
}

/* Sender label */
.synnet-msg-sender {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    padding-left: 4px;
    color: var(--sa-muted);
    align-self: flex-start;
}

/* Agent avatar (gradient, 27px, shown beside bubble on every assistant/agent msg) */
.synnet-msg-avatar {
    display: none;
    width: 27px;
    height: 27px;
    min-width: 27px;
    border-radius: 50%;
    background: var(--sa-gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}
#synnet-chat-widget .synnet-msg.assistant .synnet-msg-avatar,
#synnet-chat-widget .synnet-msg.agent .synnet-msg-avatar {
    display: flex;
}

/* Images in messages */
.synnet-msg img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 14px;
    margin: 6px 0 2px;
    cursor: pointer;
    display: block;
}

/* Links */
.synnet-msg a {
    color: var(--sa-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.synnet-msg.user a { color: rgba(255, 255, 255, .85); }

/* Markdown */
.synnet-msg h1, .synnet-msg h2, .synnet-msg h3 {
    color: var(--sa-text);
    margin: 8px 0 4px;
}
.synnet-msg code {
    background: rgba(0, 0, 0, .06);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
.synnet-msg.user code { background: rgba(255, 255, 255, .15); }
.synnet-msg ul, .synnet-msg ol { padding-left: 20px; margin: 4px 0; }
.synnet-msg li { margin: 2px 0; }

/* ═══════════════════════════════
   TYPING INDICATOR
   ═══════════════════════════════ */

.synnet-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 11px 14px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(11, 31, 51, .07);
}
.synnet-typing span {
    width: 7px;
    height: 7px;
    background: var(--sa-muted);
    border-radius: 50%;
    display: inline-block;
    animation: sa-dot 1.2s ease-in-out infinite;
}
.synnet-typing span:nth-child(2) { animation-delay: .2s; }
.synnet-typing span:nth-child(3) { animation-delay: .4s; }

/* Extended typing indicator row */
.synnet-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--sa-muted);
}
.synnet-typing-dots {
    display: inline-flex;
    gap: 2px;
}
.synnet-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sa-muted);
    display: inline-block;
    animation: synnetTypingBounce 1.4s ease-in-out infinite;
}
.synnet-typing-dots span:nth-child(2) { animation-delay: .2s; }
.synnet-typing-dots span:nth-child(3) { animation-delay: .4s; }
.synnet-typing-name { font-style: italic; }

/* ═══════════════════════════════
   DEPARTMENT CHIPS (agent request)
   ═══════════════════════════════ */

.synnet-dept-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--sa-surface);
    margin: 4px 0 2px 35px;
}
.synnet-dept-btn {
    border: 1.5px solid color-mix(in srgb, var(--sa-primary) 28%, transparent);
    background: color-mix(in srgb, var(--sa-primary) 7%, #fff);
    color: var(--sa-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--sa-font);
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.synnet-dept-btn:hover {
    background: var(--sa-primary);
    color: #fff;
    transform: translateY(-1px);
}

/* dept container also used as class directly in some markup */
.synnet-dept {
    /* state class applied to window — no direct style */
}

/* ═══════════════════════════════
   ATTACH BUTTON (composer)
   ═══════════════════════════════ */

.synnet-attach {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--sa-surface);
    color: var(--sa-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    font-family: var(--sa-font);
}
.synnet-attach:hover {
    background: color-mix(in srgb, var(--sa-g1) 10%, var(--sa-surface));
    color: var(--sa-primary);
}

/* ═══════════════════════════════
   INPUT / COMPOSER
   ═══════════════════════════════ */

#synnet-chat-widget .synnet-chat-input {
    display: flex;
    padding: 12px;
    gap: 9px;
    background: var(--sa-bg);
    border-top: 1px solid #eef2f7;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}
#synnet-chat-widget .synnet-chat-input textarea {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    background: var(--sa-surface) !important;
    border: none !important;
    border-radius: 22px !important;
    color: var(--sa-text);
    font-family: var(--sa-font);
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none !important;
    box-shadow: none !important;
    transition: box-shadow 0.2s;
}
.synnet-chat-input textarea::placeholder { color: var(--sa-muted); }
#synnet-chat-widget .synnet-chat-input textarea:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sa-g1) 25%, transparent) !important;
}
#synnet-chat-widget .synnet-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--sa-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--sa-g1) 40%, transparent);
    transition: box-shadow 0.15s, transform 0.15s;
}
#synnet-chat-widget .synnet-chat-send:hover:not(:disabled) {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--sa-g1) 50%, transparent);
    transform: scale(1.05);
}
#synnet-chat-widget .synnet-chat-send:disabled { opacity: 0.3; cursor: not-allowed; }
#synnet-chat-widget .synnet-chat-send svg { width: 18px; height: 18px; }

/* ═══════════════════════════════
   HOME VIEW
   ═══════════════════════════════ */

.synnet-home {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    background: var(--sa-bg);
    color: var(--sa-text);
    font-family: var(--sa-font);
    padding: 0;
    overflow-y: auto;
}
.synnet-home::-webkit-scrollbar { width: 0; display: none; }
.synnet-home *,
.synnet-home *::before,
.synnet-home *::after { box-sizing: border-box; }

/* Agent section */
#synnet-chat-widget .synnet-home-agent {
    padding: 24px 20px 20px;
    background: var(--sa-bg);
    border-bottom: 1px solid #eef2f7;
    display: block;
    box-sizing: border-box;
}
#synnet-chat-widget .synnet-home-agent-row {
    display: flex;
    flex-direction: row;
    gap: 14px;
    align-items: center;
    max-width: 260px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
.synnet-home-avatar {
    position: relative;
    width: 76px;
    height: 76px;
    float: none;
    margin: 0;
    flex-shrink: 0;
}
.synnet-home-avatar-initials {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--sa-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.synnet-home-avatar img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: var(--sa-surface);
}
.synnet-home-dot {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sa-success);
    border: 3px solid #fff;
}
.synnet-home-agent-title {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--sa-text);
    margin: 0;
    line-height: 1.4;
    letter-spacing: -0.1px;
}

/* Start chat button */
#synnet-chat-widget .synnet-home-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 260px;
    margin: 14px auto 0;
    text-align: center;
    background: var(--sa-gradient);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--sa-g1) 30%, transparent);
    transition: box-shadow 0.15s, transform 0.15s;
}
.synnet-home-start svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    vertical-align: middle;
    margin: 0;
}
#synnet-chat-widget .synnet-home-start:hover {
    box-shadow: 0 6px 18px color-mix(in srgb, var(--sa-g1) 40%, transparent);
    transform: translateY(-1px);
}
#synnet-chat-widget .synnet-home-hint {
    margin: 10px auto 0;
    max-width: 260px;
    width: 100%;
    font-size: 12px;
    color: var(--sa-muted);
    line-height: 1.4;
    text-align: center;
    box-sizing: border-box;
}

/* Dividers */
.synnet-home-divider { display: none; }

/* Help menu section */
#synnet-chat-widget .synnet-home-help {
    padding: 20px;
    margin-top: 0;
    border-top: none;
    border-bottom: none;
    box-sizing: border-box;
}
#synnet-chat-widget .synnet-home-help-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--sa-text);
    margin: 0 auto 12px;
    max-width: 260px;
    width: 100%;
    box-sizing: border-box;
}
.synnet-home-help-title svg {
    width: 20px;
    height: 20px;
    fill: var(--sa-text);
    flex-shrink: 0;
}
#synnet-chat-widget .synnet-home-pills {
    display: block;
    max-width: 260px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
#synnet-chat-widget button.synnet-home-pill,
.synnet-home-pill {
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    background: var(--sa-bg) !important;
    background-image: none !important;
    color: var(--sa-text) !important;
    border: 1px solid #dce5ef !important;
    border-radius: 6px !important;
    padding: 7px 13px !important;
    margin: 0 0 8px 0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-family: inherit !important;
    text-align: left !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    line-height: 1.3 !important;
    transition: border-color 0.15s, color 0.15s;
}
#synnet-chat-widget button.synnet-home-pill:last-child,
.synnet-home-pill:last-child { margin-bottom: 0 !important; }
#synnet-chat-widget button.synnet-home-pill:hover,
.synnet-home-pill:hover {
    border-color: var(--sa-primary) !important;
    color: var(--sa-primary) !important;
    background: var(--sa-bg) !important;
}

/* Footer */
#synnet-chat-widget .synnet-home-footer {
    padding: 18px 20px 20px;
    border-top: 1px solid #eef2f7;
    margin-top: auto;
    flex-shrink: 0;
    background: var(--sa-bg);
    box-sizing: border-box;
}
#synnet-chat-widget .synnet-home-legal {
    font-size: 12px;
    color: var(--sa-muted);
    line-height: 1.5;
    margin: 0 auto 12px;
    max-width: 260px;
    width: 100%;
    background: transparent;
    box-sizing: border-box;
}
.synnet-home-legal a {
    color: var(--sa-primary);
    text-decoration: none;
}
.synnet-home-legal a:hover { text-decoration: underline; }

/* Home inline input wrap */
#synnet-chat-widget .synnet-home-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    max-width: 260px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    border: 1.5px solid #dce5ef !important;
    border-radius: 22px !important;
    padding: 0 12px;
    background: var(--sa-surface) !important;
    box-shadow: none !important;
    outline: none !important;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.synnet-home-input-wrap:focus-within {
    border-color: var(--sa-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sa-g1) 16%, transparent) !important;
}
#synnet-chat-widget .synnet-home-input-wrap input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 13px;
    color: var(--sa-text);
    font-family: inherit;
    padding: 0;
    height: 100%;
    min-width: 0;
}
#synnet-chat-widget .synnet-home-input-wrap input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}
.synnet-home-input-wrap input::placeholder { color: var(--sa-muted); }

.synnet-home-send {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sa-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: opacity 0.15s;
}
.synnet-home-send svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: #fff;
}
.synnet-home-send:hover { opacity: 0.85; }

/* ═══════════════════════════════
   PUSH NOTIFICATION BANNER
   ═══════════════════════════════ */

.synnet-push-banner {
    background: color-mix(in srgb, var(--sa-g1) 6%, #fff);
    border: 1px solid color-mix(in srgb, var(--sa-g1) 18%, transparent);
    border-radius: 8px;
    padding: 12px;
    margin: 8px;
    text-align: center;
    font-size: 13px;
}
.synnet-push-text {
    margin-bottom: 8px;
    color: var(--sa-text);
}
.synnet-push-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}
.synnet-push-yes {
    background: var(--sa-gradient);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--sa-font);
}
.synnet-push-no {
    background: transparent;
    color: var(--sa-muted);
    border: 1px solid #dce5ef;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--sa-font);
}

.synnet-accent    { /* accent-color util */ color: var(--sa-primary); }
.synnet-header-badge { display: none; }
.synnet-header-name  { font-weight: 700; color: #fff; }
.synnet-header-sub   { font-size: 12px; color: rgba(255,255,255,.88); }
.synnet-header-sub-text { font-size: 12px; color: rgba(255,255,255,.88); }

/* ═══════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .synnet-chat-bubble,
    .synnet-chat-window,
    .synnet-msg,
    .synnet-pc-submit,
    .synnet-chat-send {
        transition: none;
        animation: none;
    }
    .synnet-chat-bubble::after { animation: none; }
    .synnet-typing span,
    .synnet-typing-dots span { animation: none; opacity: 0.5; }
    .synnet-chat-header-avatar::after { animation: none; }
    .synnet-chat-header { animation: none; }
}

/* ═══════════════════════════════
   MOBILE
   ═══════════════════════════════ */

@media (max-width: 480px) {
    /* Full-screen window (nearly): no outer radii, anchored to viewport edges */
    .synnet-chat-window {
        width: 100vw;
        height: calc(100dvh - 90px);
        min-height: 0;
        max-height: calc(100dvh - 90px);
        bottom: 90px;
        right: 0;
        left: 0;
        border-radius: 0;
    }
    .synnet-chat-window.synnet-chat-mode {
        height: calc(100dvh - 90px);
        max-height: calc(100dvh - 90px);
    }
    .synnet-chat-window.left { left: 0; right: 0; }
    .synnet-prechat-form { padding: 20px 16px; }
    .synnet-pc-row { flex-direction: column; gap: 20px; }
    .synnet-chat-bubble {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }
    /* Nudge: reposition alongside smaller bubble on mobile */
    .synnet-nudge {
        right: 88px;
        bottom: 24px;
    }
}
