/* Dinamo Chatbot — esquina inferior derecha. Usa los colores del tema Dinamo si está activo. */
.dncb {
	--cb-primary: var(--dn-primary, #E4572E);
	--cb-dark: var(--dn-dark, #16181D);
	--cb-radius: 20px;
	position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 99970;
	font-family: var(--dn-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
	font-size: 15px; line-height: 1.5; color: #23262d;
}
.dncb [hidden] { display: none !important; }
.dncb .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botón flotante */
.dncb__launcher {
	position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--cb-primary); color: #fff; display: grid; place-items: center; margin-left: auto;
	box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--cb-primary) 70%, black), 0 4px 10px rgba(0,0,0,.12);
	transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.dncb__launcher:hover { transform: scale(1.07); }
.dncb__launcher:focus-visible { outline: 3px solid var(--cb-dark); outline-offset: 3px; }
.dncb__ico { grid-area: 1 / 1; display: grid; place-items: center; transition: transform .35s, opacity .25s; }
.dncb__ico--close { opacity: 0; transform: rotate(-90deg) scale(.6); }
.dncb.is-open .dncb__ico--open { opacity: 0; transform: rotate(90deg) scale(.6); }
.dncb.is-open .dncb__ico--close { opacity: 1; transform: none; }
.dncb__launcher::after {
	content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--cb-primary);
	animation: dncb-ring 2.8s infinite; pointer-events: none;
}
.dncb.is-open .dncb__launcher::after { animation: none; opacity: 0; }
@keyframes dncb-ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.45); opacity: 0; } }
.dncb__badge {
	position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: #e53935; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; border: 2px solid #fff;
}

/* Burbuja de saludo */
.dncb__bubble {
	position: absolute; right: 0; bottom: 76px; width: max-content; max-width: 260px;
	background: #fff; border-radius: 16px 16px 4px 16px; padding: .8rem 2.3rem .8rem 1rem;
	box-shadow: 0 16px 40px -14px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.05);
	animation: dncb-pop .5s cubic-bezier(.2,.7,.2,1);
}
.dncb__bubble span { cursor: pointer; display: block; font-weight: 500; }
.dncb__bubble-x { position: absolute; top: .45rem; right: .4rem; border: 0; background: none; cursor: pointer; color: #888; padding: 2px; }
.dncb__bubble-x svg { width: 16px; height: 16px; }

/* Panel */
.dncb__panel {
	position: absolute; right: 0; bottom: 78px;
	width: min(380px, calc(100vw - 2rem)); height: min(600px, calc(100vh - 120px));
	background: #fff; border-radius: var(--cb-radius); overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 30px 70px -20px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.05);
	transform-origin: bottom right; opacity: 0; transform: translateY(14px) scale(.96);
	transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.2,1);
}
.dncb.is-open .dncb__panel { opacity: 1; transform: none; }
.dncb__head {
	display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem 1rem 1.1rem;
	background: linear-gradient(135deg, var(--cb-primary), color-mix(in srgb, var(--cb-primary) 70%, var(--cb-dark)));
	color: #fff;
}
.dncb__avatar { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; overflow: hidden; flex: none; }
.dncb__avatar img { width: 100%; height: 100%; object-fit: cover; }
.dncb__who { flex: 1; min-width: 0; }
.dncb__who strong { display: block; font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dncb__who small { display: flex; align-items: center; gap: .35rem; opacity: .9; font-size: .78rem; }
.dncb__dot { width: 8px; height: 8px; border-radius: 50%; background: #69f0ae; box-shadow: 0 0 0 3px rgba(105,240,174,.3); }
.dncb__close { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.dncb__close svg { width: 18px; height: 18px; }
.dncb__close:hover { background: rgba(255,255,255,.3); }

.dncb__log { flex: 1; overflow-y: auto; padding: 1.1rem 1rem .5rem; display: flex; flex-direction: column; gap: .55rem; background: #f6f7f9; scroll-behavior: smooth; }
.dncb__msg { max-width: 85%; padding: .65rem .9rem; border-radius: 16px; word-wrap: break-word; }
.dncb__msg.is-new { animation: dncb-pop .35s cubic-bezier(.2,.7,.2,1); }
.dncb__msg--bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.dncb__msg--user { align-self: flex-end; background: var(--cb-primary); color: #fff; border-bottom-right-radius: 4px; }
.dncb__msg a { color: var(--cb-primary); font-weight: 600; }
.dncb__msg--user a { color: #fff; }
.dncb__cta { border: 1px solid color-mix(in srgb, var(--cb-primary) 30%, transparent); }
.dncb__cta p { margin: 0 0 .6rem; }
.dncb__cta-btn {
	display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 999px;
	background: var(--cb-primary); color: #fff !important; text-decoration: none; font-weight: 700; font-size: .9rem;
}
.dncb__cta-btn svg { width: 16px; height: 16px; }
.dncb__cta-btn:hover { filter: brightness(.92); }
.dncb__cta-tel { display: block; margin-top: .5rem; font-size: .82rem; font-weight: 500 !important; }
.dncb__typing { display: inline-flex; gap: 4px; padding: .8rem .9rem; }
.dncb__typing span { width: 7px; height: 7px; border-radius: 50%; background: #b5b9c2; animation: dncb-bounce 1.2s infinite; }
.dncb__typing span:nth-child(2) { animation-delay: .15s; }
.dncb__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dncb-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes dncb-pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

.dncb__chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 1rem .6rem; background: #f6f7f9; max-height: 132px; overflow-y: auto; }
.dncb__chips:empty { display: none; }
.dncb__chip {
	border: 1px solid color-mix(in srgb, var(--cb-primary) 45%, transparent); background: #fff; color: var(--cb-dark);
	border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .84rem; cursor: pointer; transition: .2s; text-align: left;
}
.dncb__chip:hover, .dncb__chip:focus-visible { background: var(--cb-primary); color: #fff; border-color: var(--cb-primary); }
.dncb__chip--cta { background: var(--cb-primary); color: #fff; border-color: var(--cb-primary); font-weight: 600; }

.dncb__form { display: flex; gap: .5rem; padding: .7rem .8rem; border-top: 1px solid #eceef1; background: #fff; }
.dncb__form input {
	flex: 1; min-width: 0; border: 1px solid #dfe2e7; border-radius: 999px; padding: .65rem 1rem; font: inherit; font-size: 16px; color: inherit; background: #fff;
}
.dncb__form input:focus { outline: none; border-color: var(--cb-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cb-primary) 18%, transparent); }
.dncb__form button { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--cb-primary); color: #fff; cursor: pointer; display: grid; place-items: center; }
.dncb__note { margin: 0; padding: 0 1rem .6rem; font-size: .7rem; color: #8a8f99; background: #fff; text-align: center; }

@media (max-width: 520px) {
	.dncb { right: 1rem; bottom: 1rem; }
	.dncb__panel { position: fixed; right: .5rem; left: .5rem; bottom: 86px; width: auto; height: calc(100dvh - 110px); }
}
@media (prefers-reduced-motion: reduce) {
	.dncb *, .dncb *::before, .dncb *::after { animation: none !important; transition: none !important; }
}
