/* ============================================================
   Rosomat live chat widget  (button on the right, WhatsApp moved left)
   ============================================================ */
.wa-widget { right: auto !important; left: 28px !important; }
.wa-box { right: auto !important; left: 0 !important; transform-origin: bottom left !important; }

.lcw { --lcw-grad: linear-gradient(135deg, #bc0000 0%, #e06228 100%); --lcw-red: #d42b1e; --lcw-ink: #1f2937; --lcw-muted: #6b7280; --lcw-line: #f1e4da; --lcw-cream: #f7f1ea;
    position: fixed; right: 28px; bottom: 28px; z-index: 10000; direction: rtl; font-family: inherit; color: var(--lcw-ink); }
.lcw *, .lcw *::before, .lcw *::after { box-sizing: border-box; }
.lcw button, .lcw input, .lcw textarea { font-family: inherit; }
.lcw [hidden] { display: none !important; }

/* Launcher */
.lcw-launcher { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; background: var(--lcw-grad); color: #fff; font-size: 1.7rem;
    display: grid; place-items: center; box-shadow: 0 10px 26px -6px rgba(188, 0, 0, .55); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.lcw-launcher:hover { transform: scale(1.08); }
.lcw-launcher i { transition: transform .3s ease, opacity .2s ease; position: absolute; }
.lcw-launcher .lcw-ico-close { opacity: 0; transform: rotate(-90deg); }
.lcw.is-open .lcw-launcher .lcw-ico-open { opacity: 0; transform: rotate(90deg); }
.lcw.is-open .lcw-launcher .lcw-ico-close { opacity: 1; transform: none; }
.lcw-launcher::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(212, 43, 30, .45); animation: lcw-pulse 2.2s ease-out infinite; }
.lcw.is-open .lcw-launcher::before { display: none; }
.lcw-badge { position: absolute; top: -3px; left: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #16a34a; color: #fff;
    font-size: .75rem; font-weight: 800; display: none; align-items: center; justify-content: center; border: 2px solid #fff; }
.lcw-badge.is-on { display: inline-flex; }
.lcw-teaser { position: absolute; bottom: 72px; right: 0; width: max-content; max-width: 240px; background: #fff; border-radius: 14px 14px 4px 14px; padding: 10px 14px;
    font-size: .85rem; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .25); cursor: pointer; animation: lcw-pop .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.lcw.is-open .lcw-teaser { display: none; }

/* Panel */
.lcw-panel { position: absolute; bottom: 76px; right: 0; width: 370px; height: min(600px, calc(100vh - 120px)); background: #fff; border-radius: 22px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 24px 60px -12px rgba(120, 30, 10, .35), 0 2px 8px rgba(0, 0, 0, .06);
    transform: translateY(16px) scale(.96); transform-origin: bottom right; opacity: 0; pointer-events: none; transition: all .28s cubic-bezier(.34, 1.3, .64, 1); }
.lcw.is-open .lcw-panel { transform: none; opacity: 1; pointer-events: auto; }

.lcw-head { background: var(--lcw-grad); color: #fff; padding: 16px 16px 18px; position: relative; overflow: hidden; flex: none; }
.lcw-head::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); top: -90px; left: -50px; }
.lcw-head__row { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }
.lcw-head__logo { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.lcw-head__logo img { width: 30px; height: 30px; object-fit: contain; }
.lcw-head__txt { flex: 1; min-width: 0; }
.lcw-head__title { font-weight: 800; font-size: 1.05rem; margin: 0; }
.lcw-head__sub { font-size: .75rem; opacity: .92; margin: 2px 0 0; display: flex; align-items: center; gap: 6px; }
.lcw-head__sub::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.lcw.is-online .lcw-head__sub::before { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .3); }
.lcw-icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.lcw-icon-btn:hover { background: rgba(255, 255, 255, .28); }
.lcw-back, .lcw-end { display: none; }
.lcw[data-view="chat"].has-live .lcw-end { display: grid; }
.lcw[data-view="form"] .lcw-back, .lcw[data-view="offline"] .lcw-back, .lcw[data-view="chat"] .lcw-back, .lcw[data-view="bot"] .lcw-back { display: grid; }

.lcw-agent { position: relative; z-index: 1; display: none; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; background: rgba(255, 255, 255, .14); border-radius: 14px; }
.lcw[data-view="chat"] .lcw-agent { display: flex; }
.lcw-agent__name { font-weight: 800; font-size: .9rem; margin: 0; }
.lcw-agent__title { font-size: .72rem; opacity: .9; margin: 0; }

.lcw-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: #fff; color: var(--lcw-red); overflow: hidden; border: 2px solid rgba(255, 255, 255, .8); }
.lcw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lcw-avatar--sm { width: 28px; height: 28px; font-size: .75rem; border-width: 0; background: var(--lcw-grad); color: #fff; }
.lcw-stack { display: flex; }
.lcw-stack .lcw-avatar { width: 30px; height: 30px; font-size: .75rem; margin-inline-start: -8px; }
.lcw-stack .lcw-avatar:first-child { margin-inline-start: 0; }

.lcw-body { flex: 1; min-height: 0; overflow-y: auto; background: var(--lcw-cream); scrollbar-width: thin; scrollbar-color: #e8d5c7 transparent; }
.lcw-body::-webkit-scrollbar { width: 6px; }
.lcw-body::-webkit-scrollbar-thumb { background: #e8d5c7; border-radius: 6px; }
.lcw-flash { display: block; border-radius: 12px !important; margin: 0 0 12px; }
.lcw-view { display: none; min-height: 100%; }
.lcw[data-view="home"] .lcw-view--home, .lcw[data-view="form"] .lcw-view--form, .lcw[data-view="offline"] .lcw-view--offline { display: block; padding: 18px 16px; }
.lcw[data-view="chat"] .lcw-view--chat, .lcw[data-view="bot"] .lcw-view--bot { display: flex; flex-direction: column; }

/* Home */
.lcw-hello { font-size: 1.15rem; font-weight: 800; margin: 2px 0 4px; }
.lcw-hello-sub { font-size: .85rem; color: var(--lcw-muted); margin: 0 0 16px; line-height: 1.7; }
.lcw-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: right; background: #fff; border: 1px solid var(--lcw-line); border-radius: 16px; padding: 14px;
    margin-bottom: 10px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; color: inherit; }
.lcw-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(188, 0, 0, .35); }
.lcw-card__ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: var(--lcw-grad); flex: none; }
.lcw-card__ico--dark { background: linear-gradient(135deg, #111827, #374151); }
.lcw-card__txt { flex: 1; min-width: 0; }
.lcw-card__title { font-weight: 800; font-size: .92rem; margin: 0 0 3px; }
.lcw-card__desc { font-size: .75rem; color: var(--lcw-muted); margin: 0; line-height: 1.6; }
.lcw-card__arrow { color: #c9b8ab; font-size: 1.2rem; }
.lcw-status { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; color: #6b7280; }
.lcw-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; }
.lcw.is-online .lcw-status { color: #15803d; }
.lcw.is-online .lcw-status::before { background: #22c55e; }
.lcw-wa-link { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .78rem; color: var(--lcw-muted); margin-top: 8px; text-decoration: none; }
.lcw-wa-link i { color: #25d366; font-size: 1rem; }

/* Form */
.lcw-form-title { font-weight: 800; font-size: 1rem; margin: 0 0 4px; }
.lcw-form-sub { font-size: .78rem; color: var(--lcw-muted); margin: 0 0 12px; line-height: 1.7; }
.lcw-field { position: relative; margin-bottom: 8px; }
.lcw-field > i { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: #c7a592; font-size: 1.05rem; pointer-events: none; }
.lcw-field--area > i { top: 14px; transform: none; }
.lcw-field input, .lcw-field textarea { width: 100%; border: 1px solid #eadbd0; background: #fff; border-radius: 12px; padding: 11px 40px 11px 12px; font-size: .9rem; color: inherit; outline: none; transition: border-color .2s, box-shadow .2s; }
.lcw-field textarea { resize: none; height: 84px; line-height: 1.6; display: block; }
.lcw-field input:focus, .lcw-field textarea:focus { border-color: #e06228; box-shadow: 0 0 0 3px rgba(224, 98, 40, .15); }
.lcw-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; }
.lcw-field input::placeholder, .lcw-field textarea::placeholder { color: #b3a197; }
.lcw-err { color: #b91c1c; font-size: .75rem; margin-top: 4px; }
.lcw-primary { width: 100%; border: 0; border-radius: 12px; padding: 12px; font-size: .95rem; font-weight: 800; color: #fff; background: var(--lcw-grad); cursor: pointer; box-shadow: 0 8px 20px -8px rgba(188, 0, 0, .55); }
.lcw-primary:disabled { opacity: .6; cursor: default; }
.lcw-secondary { width: 100%; border: 1px solid #eadbd0; border-radius: 12px; padding: 12px; font-size: .9rem; font-weight: 700; color: var(--lcw-ink); background: #fff; cursor: pointer; margin-top: 8px; }
.lcw-privacy { font-size: .7rem; color: #9ca3af; text-align: center; margin: 10px 0 0; }

/* Offline choice */
.lcw-moon { font-size: 2.4rem; text-align: center; margin: 6px 0; }
.lcw-center { text-align: center; }

/* Messages */
.lcw-msgs { flex: 1; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.lcw-msg { display: flex; gap: 7px; align-items: flex-end; max-width: 86%; animation: lcw-pop .3s ease both; }
.lcw-msg__bubble { padding: 9px 13px; border-radius: 16px; font-size: .88rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.lcw-msg__time { display: block; font-size: .64rem; opacity: .6; margin-top: 3px; }
.lcw-msg--visitor { align-self: flex-start; }
.lcw-msg--visitor .lcw-msg__bubble { background: var(--lcw-grad); color: #fff; border-start-start-radius: 5px; }
.lcw-msg--agent, .lcw-msg--bot { align-self: flex-end; flex-direction: row-reverse; }
.lcw-msg--agent .lcw-msg__bubble, .lcw-msg--bot .lcw-msg__bubble { background: #fff; border: 1px solid var(--lcw-line); border-start-end-radius: 5px; }
.lcw-msg--system, .lcw-note { align-self: center; max-width: 92%; font-size: .74rem; color: var(--lcw-muted); background: rgba(255, 255, 255, .8); border-radius: 999px; padding: 5px 12px; text-align: center; }
.lcw-note--ok { background: #dcfce7; color: #166534; border-radius: 12px; line-height: 1.7; }
.lcw-msg__bubble a { color: inherit; text-decoration: underline; }
/* Question buttons */
.lcw-chips { margin-top: 6px; animation: lcw-pop .3s ease both; }
.lcw-chips__title { margin: 0 0 8px; font-size: .74rem; font-weight: 700; color: var(--lcw-muted); }
.lcw-qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lcw-q { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 8px 10px; text-align: right; background: #fff; border: 1px solid var(--lcw-line); border-radius: 14px;
    color: var(--lcw-ink); font-size: .8rem; font-weight: 700; line-height: 1.35; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lcw-q:hover { border-color: #e9a68a; box-shadow: 0 8px 18px -12px rgba(188, 0, 0, .45); transform: translateY(-1px); }
.lcw-q:active { transform: scale(.98); }
.lcw-q__ico { flex: none; width: 32px; height: 32px; border-radius: 10px; background: #fff1ea; display: grid; place-items: center; font-size: 1.05rem; }
.lcw-q__txt { flex: 1; min-width: 0; }
/* After an answer: compact pills that wrap onto lines — every question stays visible, no sideways scrolling. */
.lcw-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.lcw-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: #fff; border: 1px solid #efcfbf; color: #9f1d10;
    border-radius: 999px; padding: 7px 12px; font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.lcw-pill:hover { background: var(--lcw-grad); color: #fff; border-color: transparent; }
.lcw-pill__ico { font-size: .95rem; }
.lcw-link-btn { align-self: flex-end; margin-top: -2px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; background: var(--lcw-grad); color: #fff; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 8px 14px; box-shadow: 0 6px 14px -6px rgba(188, 0, 0, .5); }
.lcw-link-btn:hover { color: #fff; filter: brightness(1.05); }
.lcw-handoff { align-self: flex-end; margin-top: -2px; border: 0; background: #111827; color: #fff; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.lcw-typing { display: none; align-self: flex-end; background: #fff; border: 1px solid var(--lcw-line); border-radius: 16px; padding: 10px 14px; margin: 0 14px 6px; gap: 4px; }
.lcw-typing.is-on { display: inline-flex; }
.lcw-typing span { width: 7px; height: 7px; border-radius: 50%; background: #d1a390; animation: lcw-dot 1.2s infinite; }
.lcw-typing span:nth-child(2) { animation-delay: .15s; }
.lcw-typing span:nth-child(3) { animation-delay: .3s; }

.lcw-compose { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--lcw-line); background: #fff; }
.lcw-compose textarea { flex: 1; resize: none; border: 0; outline: none; font-family: inherit; font-size: .92rem; line-height: 1.5; max-height: 110px; padding: 8px 4px; background: transparent; color: inherit; }
.lcw-send { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--lcw-grad); color: #fff; font-size: 1.15rem; cursor: pointer; display: grid; place-items: center; flex: none; transform: scaleX(-1); }
.lcw-send:disabled { opacity: .5; }
.lcw-foot { flex: none; font-size: .72rem; color: #78716c; text-align: center; padding: 8px; background: #fff7f3; border-top: 1px solid var(--lcw-line); }
.lcw-foot button { border: 0; background: none; color: var(--lcw-red); font-size: .72rem; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0 4px; }
.lcw-switch { flex: none; display: flex; justify-content: center; padding: 6px 12px 0; background: #fff; border-top: 1px solid var(--lcw-line); }
.lcw-switch button { border: 1px solid var(--lcw-line); background: var(--lcw-cream); color: var(--lcw-ink); border-radius: 999px; font-size: .74rem; font-weight: 700; padding: 5px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.lcw-switch button:hover { border-color: #e06228; color: #bc0000; }
.lcw-switch + .lcw-compose { border-top: 0; }
.lcw-brand { flex: none; margin: 0; padding: 5px 0 7px; text-align: center; font-size: .68rem; color: #a8a29e; background: #fff; letter-spacing: .01em; }

@keyframes lcw-pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes lcw-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes lcw-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 640px) {
    .lcw { right: 16px; bottom: 16px; }
    .wa-widget { left: 16px !important; bottom: 16px !important; }
    .lcw-launcher { width: 56px; height: 56px; font-size: 1.55rem; }
    .lcw-panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: 0; right: 0; }
    .lcw.is-open .lcw-launcher { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lcw *, .lcw *::before { animation: none !important; transition: none !important; } }
