/* ISVR NewsDesk AI — V1.19 live chat bubble (website + dashboard) */
#isc { --isc-blue: #2563eb; --isc-ink: #0f172a; --isc-muted: #64748b; --isc-line: #e2e8f0; font-family: inherit; }
#isc[hidden] { display: none; }
.isc-launch { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
    background: var(--isc-blue); color: #fff; border-radius: 30px; padding: 12px 18px; font-weight: 700; line-height: 1; font-size: 15px; font-family: inherit; box-shadow: 0 10px 25px rgba(37,99,235,.35); }
.isc-launch:hover { transform: translateY(-1px); }
.isc-launch-ico { font-size: 18px; }
.isc-launch.is-online::after { content: ""; position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.isc-badge { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 5px; }
.isc-badge[hidden] { display: none; }
.wa-float ~ #isc .isc-launch { bottom: 84px; }
.isc-panel { position: fixed; right: 18px; bottom: 84px; z-index: 71; width: 370px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 110px);
    background: #fff; color: var(--isc-ink); border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.28); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--isc-line); }
.isc-panel[hidden] { display: none; }
.wa-float ~ #isc .isc-panel { bottom: 150px; max-height: calc(100vh - 176px); }
.isc-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 14px 18px; background: linear-gradient(135deg, #1d4ed8, #2563eb 60%, #0ea5e9); color: #fff; }
.isc-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.isc-who b { font-size: 16px; }
.isc-sub { opacity: .9; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isc-icon { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 16px; }
.isc-icon:hover { background: rgba(255,255,255,.28); }
.isc-menu { position: absolute; top: 58px; right: 12px; background: #fff; border: 1px solid var(--isc-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.18); padding: 6px; z-index: 2; display: flex; flex-direction: column; min-width: 220px; }
.isc-menu[hidden] { display: none; }
.isc-menu a, .isc-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 0; background: none; color: var(--isc-ink); font-weight: 600; font-size: 14px; font-family: inherit; cursor: pointer; text-decoration: none; }
.isc-menu a:hover, .isc-menu button:hover { background: #eff6ff; }
.isc-body { flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc; }
.isc-start label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 10px; }
.isc-start label[hidden] { display: none; }
.isc-start input, .isc-start textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; }
.isc-hello { font-size: 15px; margin: 4px 0 14px; }
.isc-hp { position: absolute; left: -9999px; }
.isc-err { color: #b91c1c; font-size: 13px; }
.isc-err[hidden] { display: none; }
.isc-primary { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--isc-blue); color: #fff; font-weight: 700; font-size: 15px; font-family: inherit; cursor: pointer; }
.isc-primary:disabled { opacity: .6; }
.isc-note { font-size: 12px; color: var(--isc-muted); text-align: center; }
.isc-list[hidden], .isc-start[hidden], .isc-foot[hidden], .isc-human[hidden] { display: none; }
.isc-msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
.isc-name { font-size: 11px; color: var(--isc-muted); margin: 0 0 3px 4px; font-weight: 600; }
.isc-bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: #fff; border: 1px solid var(--isc-line); white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.45; }
.isc-time { font-size: 10.5px; color: #94a3b8; margin: 2px 6px 0; }
.isc-customer { align-items: flex-end; }
.isc-customer .isc-bubble { background: var(--isc-blue); color: #fff; border-color: var(--isc-blue); border-radius: 16px 16px 4px 16px; }
.isc-ai .isc-bubble { background: #f5f3ff; border-color: #ddd6fe; }
.isc-system { align-items: center; }
.isc-system .isc-name { display: none; }
.isc-system .isc-bubble { background: transparent; border: 0; color: var(--isc-muted); font-size: 12.5px; text-align: center; max-width: 95%; padding: 4px; }
.isc-pending .isc-bubble { opacity: .6; }
.isc-failed .isc-bubble { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.isc-human { display: block; margin: 4px auto 0; border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; border-radius: 20px; padding: 8px 14px; font-weight: 600; font-size: 13px; font-family: inherit; cursor: pointer; }
.isc-foot { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--isc-line); background: #fff; }
.isc-foot textarea { flex: 1; resize: none; border: 1px solid #cbd5e1; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-family: inherit; max-height: 120px; box-sizing: border-box; }
.isc-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--isc-blue); color: #fff; font-size: 17px; cursor: pointer; flex: none; }
.isc-send:disabled { opacity: .5; }
@media (max-width: 640px) {
    .isc-launch-txt { display: none; }
    .isc-launch { padding: 14px; }
    .sticky-cta ~ #isc .isc-launch { bottom: 84px; }
    .wa-float ~ #isc .isc-launch { bottom: 150px; }
    .isc-panel, .wa-float ~ #isc .isc-panel { inset: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; bottom: 0; right: 0; }
    body:has(.m-tabs) .isc-launch { bottom: 76px; }
}
@media print { #isc { display: none; } }
