/* Generador de enlace de WhatsApp (prefijo wa-) — usa mm-tools.css */
.wa { --wa-green: #25d366; --wa-chat-bg: #0b141a; --wa-out: #005c4b; --wa-out-tx: #e9edef; --wa-top: #1f2c34; --wa-muted: rgba(233,237,239,.6); }
html[data-theme="light"] .wa { --wa-chat-bg: #efeae2; --wa-out: #d9fdd3; --wa-out-tx: #111b21; --wa-top: #f0f2f5; --wa-muted: rgba(17,27,33,.55); }

/* Entrada */
.wa-phone { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 12px; }
@media (max-width: 480px) { .wa-phone { grid-template-columns: 1fr; } }
.wa-phone .tl-affix > .pre { color: var(--paper-dim); }
.wa-status { margin: 10px 0 0; font-size: 13px; color: var(--paper-faint); display: flex; gap: 8px; align-items: baseline; line-height: 1.45; min-height: 19px; }
.wa-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; transform: translateY(-1px); }
.wa-status.ok { color: var(--tl-ok); } .wa-status.ok::before { background: var(--tl-ok); }
.wa-status.bad { color: var(--tl-bad); } .wa-status.bad::before { background: var(--tl-bad); }
.wa-opt { font-size: 11px; letter-spacing: .08em; color: var(--paper-faint); margin-left: 4px; }
.wa-sub { margin: 10px 0 14px; }
.wa-sub code { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--line); color: var(--paper); }
.wa-tpls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wa-tpl { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--paper-dim); background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: color .2s, background .2s, box-shadow .2s, transform .2s cubic-bezier(.16,1,.3,1); }
.wa-tpl:hover { color: var(--paper); background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--line-strong); }
.wa-tpl:active { transform: scale(.97); }
.wa #wa-msg { min-height: 112px; }
.wa-vars { margin-top: 18px; padding: 16px; border-radius: 16px; background: rgba(245,184,75,.06); box-shadow: inset 0 0 0 1px rgba(245,184,75,.22); animation: tlIn .4s cubic-bezier(.16,1,.3,1) both; }
.wa-vars .tl-h { margin-bottom: 12px; }
.wa-vars .tl-field-row { gap: 12px; }

/* Pestañas en pantallas chicas: que quepan los tres textos */
@media (max-width: 480px) { .wa .tl-tabs button { padding: 0 10px; font-size: 13px; } .wa .tl-tabs button svg { display: none; } }
.wa-panel { animation: tlIn .4s cubic-bezier(.16,1,.3,1) both; }

/* Vista previa del chat */
.wa-chat { border-radius: 20px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line), 0 20px 40px -28px rgba(0,0,0,.5); margin-bottom: 20px; background: var(--wa-chat-bg); }
.wa-chat-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--wa-top); }
.wa-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-green); color: #fff; flex-shrink: 0; }
.wa-chat-top b { display: block; font-size: 14.5px; font-weight: 600; color: var(--paper); }
.wa-chat-top small { display: block; font-size: 12px; color: var(--paper-faint); font-family: 'JetBrains Mono', monospace; }
.wa-chat-body { min-height: 120px; padding: 18px 16px; display: flex; flex-direction: column; justify-content: flex-end;
  background-image: radial-gradient(rgba(var(--glass-tint), .05) 1px, transparent 1.2px); background-size: 14px 14px; }
.wa-bubble { position: relative; align-self: flex-end; max-width: 86%; padding: 8px 12px 20px; border-radius: 12px 2px 12px 12px; background: var(--wa-out); color: var(--wa-out-tx); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.12); animation: tlIn .35s cubic-bezier(.16,1,.3,1) both; min-width: 90px; }
.wa-bubble mark { background: rgba(245,184,75,.35); color: inherit; border-radius: 4px; padding: 0 2px; }
.wa-time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: var(--wa-muted); }
.wa-chat-empty { margin: 0; font-size: 13px; color: var(--paper-faint); text-align: center; }
.wa-chat-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--wa-top); }
.wa-chat-bar span { flex: 1; padding: 9px 14px; border-radius: 999px; background: var(--glass-bg-strong); color: var(--paper-faint); font-size: 13.5px; }
.wa-chat-bar i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--wa-green); color: #fff; }

/* Enlace */
.wa-linkbox { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wa-linkbox .pg-input { font-size: 13px; text-overflow: ellipsis; }
.wa .pg-field + .tl-actions { margin-top: 12px; }
.wa .tl-btn[disabled], .wa .is-off { opacity: .45; pointer-events: none; }
@media (max-width: 400px) { .wa-linkbox { grid-template-columns: 1fr; } .wa-linkbox .tl-btn { width: 100%; } }

/* QR */
.wa-qr-wrap { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.wa-qr { aspect-ratio: 1; border-radius: 16px; background: #fff; padding: 8px; display: grid; place-items: center; box-shadow: 0 16px 34px -22px rgba(0,0,0,.6); }
.wa-qr svg { width: 100%; height: auto; display: block; }
.wa-qr-empty { font-size: 12.5px; line-height: 1.45; color: #5a5160; text-align: center; padding: 14px; }
.wa-qr-txt .tl-sub { margin: 0 0 14px; }
.wa-qr-txt .tl-note { margin-top: 12px; }
@media (max-width: 560px) { .wa-qr-wrap { grid-template-columns: 1fr; justify-items: start; } .wa-qr { width: min(220px, 100%); } }

/* Botón flotante: vista previa */
.wa-prev { position: relative; height: 250px; border-radius: 18px; overflow: hidden; background: #f6f3f7; box-shadow: inset 0 0 0 1px var(--line-strong); }
.wa-prev-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #ebe6ee; border-bottom: 1px solid #ddd5e1; }
.wa-prev-bar i { width: 9px; height: 9px; border-radius: 50%; background: #cfc5d4; }
.wa-prev-bar span { margin-left: 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #7a6f80; }
.wa-prev-page { padding: 22px 22px 0; display: grid; gap: 10px; }
.wa-prev-page span { display: block; height: 10px; border-radius: 6px; background: #e1d9e5; }
.wa-prev-page .w60 { width: 60%; height: 16px; background: #d4cada; } .wa-prev-page .w90 { width: 90%; } .wa-prev-page .w75 { width: 75%; } .wa-prev-page .w80 { width: 80%; } .wa-prev-page .w50 { width: 50%; }
.wa-prev-page .block { height: 64px; border-radius: 12px; background: #ebe4ee; }
.wa-demo-btn { position: absolute; right: 16px; bottom: 16px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--wa-c, #25d366); box-shadow: 0 10px 24px -6px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(14px) scale(.9); transition: opacity .45s ease, transform .5s cubic-bezier(.16,1,.3,1), background .25s; pointer-events: none; }
.wa-demo-btn.on { opacity: 1; transform: none; }
.wa-demo-btn.dark-ic { color: #111; }
.wa-demo-btn.left { right: auto; left: 16px; }
.wa-demo-tip { position: absolute; right: 64px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #fff; color: #16101a; font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.wa-demo-btn.left .wa-demo-tip { right: auto; left: 64px; }
@media (prefers-reduced-motion: reduce) { .wa-demo-btn { transition: none; } }
.wa-cfg { margin: 20px 0 24px; }
.wa-sws { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wa-sw { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; padding: 0; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); transition: transform .2s cubic-bezier(.16,1,.3,1); }
.wa-sw:hover { transform: scale(1.06); }
.wa-sw.on { outline: 2px solid var(--paper); outline-offset: 2px; }
.wa-sw.custom { background: conic-gradient(#f036e1, #9149ff, #3b82f6, #25d366, #f5b84b, #f036e1); overflow: hidden; }
.wa-sw.custom.on { background: var(--c); }
.wa-sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.wa-sw.custom:has(input:focus-visible) { outline: 2px solid #f036e1; outline-offset: 2px; }
.wa #wa-snippet { max-height: 300px; }
.wa-snip-note { margin-top: 12px; }

/* Redes */
.wa-bios { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; }
.wa-bios li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; background: var(--glass-bg-strong); box-shadow: inset 0 0 0 1px var(--line); }
.wa-bios span { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--paper); overflow-wrap: anywhere; min-width: 0; line-height: 1.5; }
.wa-howto { border-top: 1px solid var(--line); }
.wa-acc { border-bottom: 1px solid var(--line); }
.wa-acc summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer; font-size: 15px; font-weight: 600; }
.wa-acc summary::-webkit-details-marker { display: none; }
.wa-acc summary svg { color: var(--paper-dim); }
.wa-acc summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--paper-dim); border-bottom: 1.5px solid var(--paper-dim); transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.wa-acc[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.wa-acc ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; color: var(--paper-dim); line-height: 1.6; }
.wa-acc ol b { color: var(--paper); font-weight: 600; }
.wa-acc a { color: var(--paper); text-underline-offset: 3px; text-decoration-color: rgba(240,54,225,.6); }

/* Ajustes */
.wa .tl-group { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.wa-cfg .tl-field-row { grid-template-columns: auto minmax(0, 1fr); gap: 16px 24px; }
@media (max-width: 640px) { .wa-cfg .tl-field-row { grid-template-columns: 1fr; } .wa-cfg #wa-pos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; } }
.wa .tl-tabs .wa-s { display: none; }
@media (max-width: 520px) { .wa .tl-tabs .wa-l { display: none; } .wa .tl-tabs .wa-s { display: inline; } .wa .tl-tabs { gap: 0; } .wa .tl-tabs button { flex: 1; justify-content: center; } }
.wa-qr.empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); background-image: repeating-linear-gradient(135deg, transparent 0 10px, rgba(var(--glass-tint), .03) 10px 20px); }
.wa-qr.empty .wa-qr-empty { color: var(--paper-faint); }
@media (max-width: 560px) { .wa-qr { width: min(180px, 100%); } }
