/* Herramientas de la categoría «Enlaces» (feat/enlaces-herr, 06-11-2026): crear enlace de WhatsApp,
   crear UTM, ¿adónde lleva este enlace? y vista previa al compartir. Van encima de webs.css (misma
   disposición que las de softwawebs: zona de trabajo + panel de opciones con el botón abajo).
   Prefijo .enh-. Todo lo tocable, 44 px en táctil. Sin colores de marcas ajenas ni sus logotipos. */

/* ── Ejemplo al entrar ─────────────────────────────────────────────── */
.enh-ejemplo { display: flex; align-items: center; gap: 8px 12px; padding: 6px 8px 6px 14px; margin: 0;
  background: var(--sw-brand-50); border: 1px solid color-mix(in oklch, var(--sw-brand-500) 30%, white); border-radius: var(--sw-radius-lg); }
.enh-ejemplo[hidden] { display: none; }
.enh-ejemplo p { margin: 0; flex: 1 1 auto; font-size: 14px; line-height: 1.4; }
.enh-ejemplo .sw-btn { flex: none; min-height: 44px; font-weight: 700; }
@media (max-width: 600px) {
  .enh-ejemplo { flex-wrap: wrap; padding: 8px 10px; }
  .enh-ejemplo .sw-btn { width: 100%; }
}

/* ── El enlace hecho, grande y con sus botones ─────────────────────── */
.enh-enlace { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.enh-enlace__url { margin: 0; padding: 12px 14px; background: var(--sw-bg-subtle); border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-md); font-family: var(--sw-font-mono); font-size: 14.5px; line-height: 1.5;
  overflow-wrap: anywhere; word-break: break-all; min-height: 48px; }
.enh-enlace__url--grande { font-size: 15.5px; }
.enh-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.enh-fila > .sw-btn { flex: 0 1 auto; }
.enh-sub { font-size: 13px; color: var(--sw-text-muted); line-height: 1.45; margin: 0; }
.enh-sub a { color: inherit; }
.enh-cuenta { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--sw-text-muted); }
.enh-cuenta--mal { color: color-mix(in oklch, var(--sw-error-500) 75%, black); font-weight: 600; }

/* ── QR ───────────────────────────────────────────────────────────── */
.enh-qr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.enh-qr canvas { width: 132px; height: 132px; border-radius: var(--sw-radius-md); border: 1px solid var(--sw-border); background: #fff; image-rendering: pixelated; }
.enh-qr__acc { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (max-width: 420px) { .enh-qr { grid-template-columns: minmax(0, 1fr); justify-items: center; } .enh-qr__acc { width: 100%; } }

/* ── Acortar y medir (con el acortador de Softwatools) ─────────────── */
.enh-corto { display: flex; flex-direction: column; gap: 8px; }
.enh-corto__res { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--sw-radius-md);
  background: var(--sw-success-50); border: 1px solid color-mix(in oklch, var(--sw-success-500) 35%, white); }
.enh-corto__res[hidden] { display: none; }
.enh-corto__res code { font-family: var(--sw-font-mono); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

/* ── WhatsApp: el móvil de muestra (dibujo propio, sin logotipos) ──── */
.enh-movil { width: 100%; max-width: 360px; margin: 0 auto; border-radius: 28px; padding: 10px; background: var(--sw-ink-900, #111);
  box-shadow: var(--sw-shadow-md, 0 6px 24px rgb(0 0 0 / .18)); }
.enh-movil__pant { border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; min-height: 380px; background: #efeae2; }
.enh-movil__cab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f0f2f5; color: #111b21; border-bottom: 1px solid #e3e3e3; }
.enh-movil__ava { width: 36px; height: 36px; border-radius: 50%; background: #cfd8dc; color: #54656f; display: grid; place-items: center; flex: none; }
.enh-movil__nom { font-weight: 600; font-size: 14.5px; line-height: 1.2; overflow-wrap: anywhere; }
.enh-movil__est { font-size: 12px; color: #667781; }
.enh-movil__chat { flex: 1 1 auto; padding: 14px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.enh-movil__nota { align-self: center; max-width: 92%; background: #fff6c5; color: #54656f; font-size: 12px; text-align: center; padding: 6px 10px; border-radius: 8px; line-height: 1.4; }
.enh-movil__pie { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px 10px; background: #f0f2f5; }
.enh-movil__caja { flex: 1 1 auto; min-width: 0; background: #fff; border-radius: 18px; padding: 9px 14px; font-size: 14.5px; color: #111b21;
  line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 190px; overflow: auto; }
.enh-movil__caja:empty::before { content: 'Mensaje'; color: #8696a0; }
.enh-movil__env { width: 40px; height: 40px; border-radius: 50%; background: #128c7e; color: #fff; display: grid; place-items: center; flex: none; }

/* ── UTM: la dirección con sus partes de colores ───────────────────── */
.enh-utm-url .p-base { color: var(--sw-text); }
.enh-utm-url .p-k { color: color-mix(in oklch, var(--sw-brand-600) 85%, black); font-weight: 600; }
.enh-utm-url .p-v { color: color-mix(in oklch, var(--sw-success-500) 70%, black); }
.enh-utm-url .p-s { color: var(--sw-text-muted); }
.enh-campos-ayuda { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.enh-campos-ayuda li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 10px; font-size: 13.5px; line-height: 1.45; }
.enh-campos-ayuda code { font-family: var(--sw-font-mono); font-size: 12.5px; font-weight: 600; }
@media (max-width: 480px) { .enh-campos-ayuda li { grid-template-columns: minmax(0, 1fr); } }
.enh-historial { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.enh-historial li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 6px 6px 6px 10px;
  border: 1px solid var(--sw-border); border-radius: var(--sw-radius-md); background: var(--sw-bg); }
.enh-historial__txt { min-width: 0; font-size: 13px; line-height: 1.35; }
.enh-historial__txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enh-historial__txt span { display: block; color: var(--sw-text-muted); font-family: var(--sw-font-mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enh-historial__acc { display: flex; gap: 4px; }
.enh-historial__acc .sw-btn { min-width: 44px; padding: 0 10px; }
.enh-vacio { font-size: 13px; color: var(--sw-text-muted); margin: 0; }

/* ── Campo grande de dirección (comprobar y vista previa) ──────────── */
.enh-pegar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.enh-pegar__campo { position: relative; }
.enh-pegar__campo input { padding-left: 40px !important; }
.enh-pegar__campo > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--sw-text-muted); pointer-events: none; }
.enh-chips-ej { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Veredicto (bien / ojo / revisar) y avisos ─────────────────────── */
.enh-veredicto { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--sw-radius-lg); border: 1px solid; }
.enh-veredicto__ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.enh-veredicto__t { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.enh-veredicto__p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.45; }
.enh-veredicto--bien { background: var(--sw-success-50); border-color: color-mix(in oklch, var(--sw-success-500) 35%, white); }
.enh-veredicto--bien .enh-veredicto__ico { background: var(--sw-success-500); }
.enh-veredicto--ojo { background: var(--sw-warning-50); border-color: color-mix(in oklch, var(--sw-warning-500) 45%, white); }
.enh-veredicto--ojo .enh-veredicto__ico { background: color-mix(in oklch, var(--sw-warning-500) 85%, black); }
.enh-veredicto--revisar { background: var(--sw-error-50); border-color: color-mix(in oklch, var(--sw-error-500) 35%, white); }
.enh-veredicto--revisar .enh-veredicto__ico { background: var(--sw-error-500); }
.enh-recuento { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.enh-avisos { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.enh-aviso { border: 1px solid var(--sw-border); border-left-width: 4px; border-radius: var(--sw-radius-md); background: var(--sw-surface); padding: 10px 12px; }
.enh-aviso--revisar { border-left-color: var(--sw-error-500); }
.enh-aviso--ojo { border-left-color: var(--sw-warning-500); }
.enh-aviso--bien { border-left-color: var(--sw-success-500); }
.enh-aviso--info { border-left-color: var(--sw-border-strong); }
.enh-aviso__t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.enh-aviso__p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--sw-text); }
.enh-aviso__arreglo { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; padding: 6px 10px; border-radius: var(--sw-radius-sm); background: var(--sw-bg-subtle); }
.enh-aviso__arreglo b { font-weight: 600; }
.enh-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--sw-radius-full); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.enh-pill--revisar { background: var(--sw-error-50); color: color-mix(in oklch, var(--sw-error-500) 75%, black); }
.enh-pill--ojo { background: var(--sw-warning-50); color: color-mix(in oklch, var(--sw-warning-500) 50%, black); }
.enh-pill--bien { background: var(--sw-success-50); color: color-mix(in oklch, var(--sw-success-500) 60%, black); }
.enh-pill--info { background: var(--sw-bg-subtle); color: var(--sw-text-muted); }

/* ── La cadena de redirecciones ────────────────────────────────────── */
.enh-cadena { margin: 0; padding: 0; list-style: none; position: relative; }
.enh-cadena > li { position: relative; padding: 0 0 14px 34px; min-width: 0; }
.enh-cadena > li::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--sw-border); }
.enh-cadena > li:last-child { padding-bottom: 0; }
.enh-cadena > li:last-child::before { display: none; }
.enh-cadena__n { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--sw-bg-subtle);
  border: 1px solid var(--sw-border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.enh-cadena__fin .enh-cadena__n { background: var(--sw-ink-900); color: #fff; border-color: var(--sw-ink-900); }
.enh-cadena__parado .enh-cadena__n { background: var(--sw-error-500); color: #fff; border-color: var(--sw-error-500); }
.enh-cadena__dom { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.enh-cadena__url { display: block; font-family: var(--sw-font-mono); font-size: 12.5px; color: var(--sw-text-muted); overflow-wrap: anywhere; word-break: break-all; margin-top: 2px; }
.enh-cadena__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: 12.5px; color: var(--sw-text-muted); }
.enh-cod { font-family: var(--sw-font-mono); font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: var(--sw-radius-sm); background: var(--sw-bg-subtle); border: 1px solid var(--sw-border); color: var(--sw-text); }
.enh-cod--3 { background: var(--sw-brand-50); }
.enh-cod--4, .enh-cod--5, .enh-cod--0 { background: var(--sw-error-50); }
.enh-candado { display: inline-flex; align-items: center; gap: 4px; }
.enh-candado--no { color: color-mix(in oklch, var(--sw-error-500) 75%, black); font-weight: 600; }

/* ── Vista previa en cada red (dibujos aproximados, sin logotipos) ─── */
.enh-redes-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.enh-redes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 1100px) { .enh-redes--todas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1700px) { .enh-redes--todas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Vista previa: las tarjetas de las redes, la columna ancha */
@media (min-width: 1180px) { .sw-webs__dos.enh-dos-previa { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.enh-redes--todas .enh-burbuja { max-width: none; margin-left: 0; }
.enh-red { min-width: 0; }
.enh-red[hidden] { display: none; }
.enh-red__nom { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--sw-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.enh-tarj { border: 1px solid #dadde1; border-radius: 10px; overflow: hidden; background: #fff; color: #050505; max-width: 520px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.enh-tarj__img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #e4e6eb; }
.enh-tarj__sinimg { display: grid; place-items: center; aspect-ratio: 1.91 / 1; background: #e4e6eb; color: #65676b; font-size: 13px; text-align: center; padding: 10px; }
.enh-tarj__txt { padding: 10px 12px; min-width: 0; }
.enh-tarj__dom { font-size: 12.5px; color: #65676b; text-transform: uppercase; overflow-wrap: anywhere; }
.enh-tarj__tit { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 2px 0; overflow-wrap: anywhere; }
.enh-tarj__des { font-size: 14px; color: #65676b; line-height: 1.35; overflow-wrap: anywhere; }
.enh-tarj--fb .enh-tarj__txt { background: #f0f2f5; }
.enh-tarj--li { border-radius: 8px; }
.enh-tarj--li .enh-tarj__tit { font-size: 14px; }
.enh-tarj--li .enh-tarj__dom { text-transform: none; font-size: 12px; }
.enh-tarj--x { border-radius: 16px; border-color: #cfd9de; }
.enh-tarj--x .enh-tarj__img { aspect-ratio: 1.91 / 1; }
.enh-tarj--x-peq { display: grid; grid-template-columns: 120px minmax(0, 1fr); }
.enh-tarj--x-peq .enh-tarj__img, .enh-tarj--x-peq .enh-tarj__sinimg { aspect-ratio: 1 / 1; height: 100%; }
.enh-tarj--x .enh-tarj__dom { text-transform: none; color: #536471; }
.enh-burbuja { max-width: 380px; margin-left: auto; background: #d9fdd3; border-radius: 10px; padding: 4px; color: #111b21; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; box-shadow: 0 1px .5px rgb(11 20 26 / .13); }
.enh-burbuja__card { border-radius: 7px; overflow: hidden; background: #d1f4cc; }
.enh-burbuja__card--lado { display: grid; grid-template-columns: 82px minmax(0, 1fr); }
.enh-burbuja__card--lado .enh-tarj__img, .enh-burbuja__card--lado .enh-tarj__sinimg { aspect-ratio: 1 / 1; height: 100%; }
.enh-burbuja .enh-tarj__txt { padding: 6px 10px; }
.enh-burbuja .enh-tarj__tit { font-size: 14px; }
.enh-burbuja .enh-tarj__des { font-size: 13px; color: #54656f; }
.enh-burbuja .enh-tarj__dom { font-size: 12px; color: #667781; text-transform: none; }
.enh-burbuja__link { display: block; padding: 6px 6px 2px; font-size: 14px; color: #027eb5; overflow-wrap: anywhere; }
.enh-burbuja--tg { background: #effdde; }
.enh-burbuja--tg .enh-burbuja__card { background: transparent; border-left: 3px solid #4fae4e; border-radius: 0; padding-left: 8px; }
.enh-burbuja--tg .enh-tarj__sitio { font-size: 13.5px; font-weight: 600; color: #4fae4e; }
.enh-burbuja--tg .enh-tarj__img { border-radius: 6px; margin-top: 6px; }
.enh-recorte { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.enh-recorte--1 { -webkit-line-clamp: 1; } .enh-recorte--2 { -webkit-line-clamp: 2; } .enh-recorte--3 { -webkit-line-clamp: 3; }

.enh-ficha { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; }
.enh-ficha dt { color: var(--sw-text-muted); font-weight: 600; }
.enh-ficha dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.enh-ficha code { font-family: var(--sw-font-mono); font-size: 12.5px; }
@media (max-width: 480px) { .enh-ficha { grid-template-columns: minmax(0, 1fr); } .enh-ficha dd { margin-bottom: 6px; } }

/* Zona de resultados vacía (antes de comprobar) */
.enh-espera-vacia { display: grid; place-items: center; text-align: center; gap: 8px; padding: 28px 16px; color: var(--sw-text-muted); font-size: 14px; border: 1px dashed var(--sw-border-strong); border-radius: var(--sw-radius-lg); }
.enh-oculto { display: none !important; }

/* Escritorio: lo largo con su propia barra para que todo quepa a la vista en 1920 × 1080 */
@media (min-width: 901px) {
  .enh-scroll { max-height: calc(100dvh - var(--sw-header-h) - 190px); overflow: auto; overscroll-behavior: contain; padding-right: 4px; }
}

/* Móvil y tableta: el aviso del ejemplo, lo primero; el móvil de muestra, más bajo para que el
   número y el mensaje se vean enseguida. */
@media (max-width: 900px) {
  .enh-ejemplo { order: -2; }
  .enh-movil { max-width: 320px; padding: 7px; border-radius: 22px; }
  .enh-movil__pant { min-height: 200px; border-radius: 16px; }
  .enh-movil__chat { padding: 8px; }
}
/* Columna propia (no la de webs.css, que en el móvil se deshace con display: contents y la guía
   no encontraría su caja) */
.enh-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Móvil: en las que piden al servidor, el campo para pegar va antes que el resultado del ejemplo */
@media (max-width: 900px) {
  [data-herramienta="comprobar-enlace"] .sw-webs__lateral > .sw-workspace__sidebar-hdr,
  [data-herramienta="comprobar-enlace"] .sw-webs__lateral > .sw-workspace__sidebar-body,
  [data-herramienta="vista-previa-enlace"] .sw-webs__lateral > .sw-workspace__sidebar-hdr,
  [data-herramienta="vista-previa-enlace"] .sw-webs__lateral > .sw-workspace__sidebar-body { order: -1; }
}
/* Móvil y tableta: lo de después del resultado (QR, acortar, ayuda, historial) va DESPUÉS de los campos.
   (.sw-webs__despues se deshace con display: contents y su «order» no cuenta: se pone a sus hijos.) */
@media (max-width: 900px) {
  .sw-webs[data-herramienta="crear-enlace-whatsapp"] .sw-webs__despues > *,
  .sw-webs[data-herramienta="crear-utm"] .sw-webs__despues > *,
  .sw-webs[data-herramienta="vista-previa-enlace"] .sw-webs__despues > * { order: 1; }
}
