/* Helix · panel v5 · hojas: las hojas y diálogos de la ficha del lead (acciones «⋯», resumen pre-llamada, etiqueta,
   pausar, resultado de la llamada, «por qué dijo»…) en el lenguaje v5, y el botón «Pre-llamada» a la vista.
   Todo cuelga de html.hx-v5. La hoja «Más» del móvil tiene su propio estilo
   (helix-v5-movil-shell.css) y se queda fuera. Los selectores base van en :where() para que las hojas que ya
   tienen estilo v5 propio (Embudo móvil, «Más») ganen siempre. */

html.hx-v5 {
  --hx5h-velo: rgba(6, 6, 10, .56); --hx5h-cab: rgba(30, 30, 36, .86); --hx5h-grupo: rgba(255, 255, 255, .045);
  --hx5h-grupo-borde: rgba(255, 255, 255, .06); --hx5h-pulsa: rgba(255, 255, 255, .06); --hx5h-cerrar: rgba(255, 255, 255, .08);
  --hx5h-peligro: #FF6961; --hx5h-peligro-f: rgba(255, 69, 58, .13);
  --hx5h-aviso: #FFC24D; --hx5h-aviso-f: rgba(255, 176, 32, .15); --hx5h-caliente: #FF9F43; --hx5h-caliente-f: rgba(255, 146, 43, .15);
  --hx5h-acento-f: color-mix(in srgb, var(--v5-acc) 15%, transparent); --hx5h-ok-f: rgba(52, 199, 89, .14);
}
html.hx-v5:not([data-theme="dark"]) {
  --hx5h-velo: rgba(20, 20, 32, .26); --hx5h-cab: rgba(250, 250, 252, .88); --hx5h-grupo: #FFFFFF;
  --hx5h-grupo-borde: rgba(0, 0, 0, .06); --hx5h-pulsa: rgba(0, 0, 0, .045); --hx5h-cerrar: #ECECEF;
  --hx5h-peligro: #D93025; --hx5h-peligro-f: rgba(217, 48, 37, .08);
  --hx5h-aviso: #8A5A00; --hx5h-aviso-f: #FFF1D0; --hx5h-caliente: #B45309; --hx5h-caliente-f: #FFEDD5;
  --hx5h-acento-f: color-mix(in srgb, var(--v5-acc) 11%, transparent); --hx5h-ok-f: rgba(52, 199, 89, .12);
}

/* ── Velo y superficie ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) { background: var(--hx5h-velo);
  -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet { box-sizing: border-box; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; padding: 0 18px 18px; border: 0; border-image: none; color: var(--v5-t1); font-family: var(--v5-font);
  background: var(--v5-sheet); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-sheetsh); text-shadow: none; }

/* ── Cabecera: nombre, chips de estado y cerrar; fija al desplazar (con cristal para que no asome lo que sube) ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet > .helix-sheet-header { position: sticky; top: 0; z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 -18px 4px; padding: 18px 18px 12px; border: 0;
  border-bottom: .5px solid var(--v5-line); background: var(--hx5h-cab); -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet > .helix-sheet-header::before { content: none; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is(h2, h3, .t-h3, .t-h4) { margin: 0; font: 700 19px/1.25 var(--v5-font);
  letter-spacing: -.02em; color: var(--v5-t1); text-transform: none; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header > div > div { margin-top: 8px !important; gap: 6px !important; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is([data-action="close"], [data-cerrar], .helix-icon-btn:last-child) {
  flex: none; width: 34px !important; height: 34px !important; min-width: 34px; min-height: 34px; margin: 0; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--v5-t1); background: var(--hx5h-cerrar); box-shadow: none;
  cursor: pointer; transition: transform .12s var(--v5-eo), background .2s var(--v5-eo); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is([data-action="close"], [data-cerrar])::after { content: none; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is([data-action="close"], [data-cerrar]):active { transform: scale(.92); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is([data-action="close"], [data-cerrar]) svg { width: 16px; height: 16px; }

/* ── Títulos de sección: como en Mi bot y Ajustes (sin mayúsculas espaciadas) ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet .t-eyebrow { display: block; padding: 0 2px; font-size: 13px; font-weight: 600;
  letter-spacing: -.005em; text-transform: none; color: var(--v5-t3); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet .t-eyebrow:first-child { margin-top: 14px; }

/* ── Grupos de acciones: tarjeta con filas separadas; peligro en rojo con tinte al pasar ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-actions { display: flex; flex-direction: column; gap: 0; overflow: hidden;
  border-radius: 16px; background: var(--hx5h-grupo); box-shadow: 0 0 0 .5px var(--hx5h-grupo-borde); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header + .helix-sheet-actions { margin-top: 12px; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action { position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 46px; margin: 0; padding: 0 14px; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--v5-t1);
  font: 400 14.5px/1.3 var(--v5-font); letter-spacing: -.01em; text-align: left; text-shadow: none; cursor: pointer; transition: background .15s var(--v5-eo); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action + .helix-sheet-action::before { content: ""; position: absolute; top: 0;
  left: 46px; right: 0; height: .5px; background: var(--v5-line); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action:hover { background: var(--hx5h-pulsa); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action:focus-visible { outline: 2px solid var(--v5-acc); outline-offset: -2px; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action > svg:first-child { flex: none; width: 19px; height: 19px; color: var(--v5-t2); stroke-width: 1.7; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action > span { flex: 1; min-width: 0; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action--danger,
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action--danger > svg:first-child { color: var(--hx5h-peligro); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action--danger:hover { background: var(--hx5h-peligro-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action.helix-action-pressed { background: var(--hx5h-pulsa); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action.is-hecho { background: var(--hx5h-ok-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-footer { margin-top: 14px; padding-top: 12px; border-top: .5px solid var(--v5-line); }

/* ── Chips de estado ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag { display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  height: 22px; padding: 0 9px; border: 0; border-radius: 999px; box-shadow: none; font: 600 12px/1 var(--v5-font); letter-spacing: 0; text-transform: none;
  color: var(--v5-t2); background: var(--v5-card2); }
html.hx-v5:not([data-theme="dark"]) .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag { background: #EEEEF1; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag svg { width: 12px; height: 12px; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag--accent { color: var(--v5-acc); background: var(--hx5h-acento-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag--warning { color: var(--hx5h-aviso); background: var(--hx5h-aviso-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag--danger { color: var(--hx5h-peligro); background: var(--hx5h-peligro-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-tag--signal { color: var(--hx5h-caliente); background: var(--hx5h-caliente-f); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) :is(.helix-tag--positive, .helix-tag--success) { color: var(--v5-ok); background: var(--hx5h-ok-f); }

/* ── Resumen pre-llamada: grupos de filas etiqueta / valor ── */
html.hx-v5 .helix-app #helix-info-sheet .helix-info-section { margin: 0 0 16px; padding: 0; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-section > .t-eyebrow { margin: 16px 0 8px; }
html.hx-v5 .helix-app #helix-info-sheet :is(.helix-info-lines, .helix-info-form) { display: block; overflow: hidden; padding: 0; border-radius: 16px;
  background: var(--hx5h-grupo); box-shadow: 0 0 0 .5px var(--hx5h-grupo-borde); font-size: 14px; line-height: 1.4; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div:not(.helix-tag),
html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 20px;
  margin: 0; padding: 10px 14px; border: 0; border-top: .5px solid var(--v5-line); border-radius: 0; background: transparent; box-shadow: none; color: var(--v5-t1); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div:first-child,
html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row:first-child { border-top: 0; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div > .t-caption,
html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row > .t-caption { flex: 0 1 46%; min-width: 0; font-size: 13.5px; color: var(--v5-t2); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines b,
html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row > div:last-child { flex: 1 1 auto; min-width: 0; font-weight: 500; text-align: right; color: var(--v5-t1);
  overflow-wrap: anywhere; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines b svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--v5-ok); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div.hx5h-varias { display: block; text-align: left; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div.hx5h-varias b { text-align: left; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > .helix-tag { margin: 10px 14px !important; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > .helix-tag + .helix-tag { margin-top: 0 !important; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-section > .t-caption { display: block; margin: 14px 2px 8px !important; font-size: 12.5px; font-weight: 600; color: var(--v5-t3); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-section > div[style*="flex-wrap"] { margin: 0 0 10px !important; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-bullets { margin: 0; padding: 10px 14px 10px 30px; border-radius: 16px; background: var(--hx5h-grupo);
  box-shadow: 0 0 0 .5px var(--hx5h-grupo-borde); font-size: 14px; line-height: 1.45; color: var(--v5-t1); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-bullets li + li { margin-top: 4px; }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-suggest { padding: 12px 14px; border: 0; border-radius: 16px; background: var(--hx5h-acento-f); box-shadow: none;
  font-size: 14px; line-height: 1.45; color: var(--v5-t1); }
html.hx-v5 .helix-app #helix-info-sheet .helix-info-suggest b { font-weight: 600; }
html.hx-v5 .helix-app #helix-info-sheet :is(.helix-empty, .helix-loading) { padding: 12px 14px; border-radius: 16px; background: var(--hx5h-grupo);
  font-size: 13.5px; color: var(--v5-t2); }

/* ── Controles sueltos dentro de las hojas (opciones de pausa, confirmaciones, campos) ── */
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet .helix-btn { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px;
  font: 600 14px var(--v5-font); text-shadow: none; box-shadow: none; }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet .helix-btn:not(.helix-btn--primary) { color: var(--v5-t1); background: var(--hx5h-cerrar); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet .helix-btn--primary { color: #fff; background: var(--v5-acc); }
html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet :is(input[type="text"], input[type="date"], input[type="time"], input[type="tel"],
  input[type="email"], input[type="number"], select, textarea, .hx-field) { box-sizing: border-box; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 12px;
  color: var(--v5-t1); background: var(--hx5h-grupo); box-shadow: inset 0 0 0 .5px var(--v5-edge); font: 400 14px var(--v5-font); }

/* ── Diálogos de confirmación y selector de la agenda de Helix, con la misma piel ── */
html.hx-v5 .helix-app .helix-dialog-backdrop { background: var(--hx5h-velo); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html.hx-v5 .helix-app .helix-dialog { border: 0; border-image: none; border-radius: 22px; color: var(--v5-t1); background: var(--v5-sheet);
  -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-sheetsh); font-family: var(--v5-font); }
html.hx-v5 .helix-app .helix-dialog .helix-btn { min-height: 38px; border: 0; border-radius: 999px; font-weight: 600; box-shadow: none; text-shadow: none; }
html.hx-v5 .helix-app .helix-dialog .helix-btn:not(.helix-btn--primary):not(.helix-btn--danger) { color: var(--v5-t1); background: var(--hx5h-cerrar); }
html.hx-v5 .hx-agenda-sheet { background: var(--hx5h-velo); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html.hx-v5 .hx-agenda-sheet-card { border: 0; color: var(--v5-t1); background: var(--v5-sheet); -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%); box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-sheetsh); font-family: var(--v5-font); }

@media (min-width: 1024px) {
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet { max-width: 480px; border-radius: 26px; }
  html.hx-v5 .helix-app #helix-info-sheet > .helix-sheet { max-width: 540px; }
  html.hx-v5 .hx-agenda-sheet { align-items: center; }
  html.hx-v5 .hx-agenda-sheet-card { border-radius: 26px; }

  /* «Pre-llamada» a la vista en la cabecera de la ficha: píldora con texto, delante de llamar / agendar / más */
  html.hx-v5 .helix-app #helix-detail-panel .helix-actionbar-btn[data-action="info"] { order: -1; width: auto; padding: 0 14px 0 12px; gap: 7px; border-radius: 999px; }
  html.hx-v5 .helix-app #helix-detail-panel .helix-actionbar-btn[data-action="info"] > span { position: static; width: auto; height: auto; margin: 0; overflow: visible;
    clip: auto; clip-path: none; font-size: 13px; font-weight: 600; letter-spacing: -.005em; }
  html.hx-v5 .helix-app #helix-detail-panel .helix-actionbar-btn[data-action="info"] svg { color: var(--v5-acc); }
}

@media (max-width: 1023.98px) {
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet { width: 100%; max-width: none; max-height: calc(100dvh - 40px);
    padding: 0 16px max(20px, calc(env(safe-area-inset-bottom) + 12px)); border-radius: 30px 30px 0 0; }
  /* agarre de la hoja inferior (como el «Más» del móvil); arrastrar hacia abajo la cierra (helix-v5-hojas.js) */
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet > .helix-sheet-header { margin: 0 -16px 4px; padding: 24px 16px 12px;
    touch-action: pan-x; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) > .helix-sheet > .helix-sheet-header::after { content: ""; position: absolute; top: 8px;
    left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--v5-t3); opacity: .7; pointer-events: none; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-header :is(h2, h3, .t-h3, .t-h4) { font-size: 21px; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action { min-height: 52px; gap: 14px; padding: 0 16px; font-size: 16px; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action + .helix-sheet-action::before { left: 51px; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action > svg:first-child { width: 21px; height: 21px; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-actions { border-radius: 18px; }
  html.hx-v5 .helix-app #helix-info-sheet :is(.helix-info-lines, .helix-info-form) { font-size: 15px; border-radius: 18px; }
  html.hx-v5 .helix-app #helix-info-sheet .helix-info-lines > div:not(.helix-tag),
  html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row { padding: 12px 16px; }
  html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row { flex-direction: column; align-items: stretch; gap: 3px; }
  html.hx-v5 .helix-app #helix-info-sheet .helix-info-form-row > div:last-child { text-align: left; }
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet :is(input, select, textarea, .hx-field) { font-size: 16px; min-height: 44px; }

  /* segundo piso de la ficha: Llamar · Agendar · Pre-llamada (etiqueta corta «Resumen») · Más, sin apretarse */
  html.hx-v5 #helix-content > .helix-lead-detail > .helix-lead-detail-actionbar { gap: 6px; }
  html.hx-v5 #helix-content > .helix-lead-detail > .helix-lead-detail-actionbar > .helix-actionbar-btn:not([data-action="more"]) { padding: 0 6px; gap: 5px;
    font-size: 14px; }
  html.hx-v5 #helix-content > .helix-lead-detail > .helix-lead-detail-actionbar > .helix-actionbar-btn:not([data-action="more"]) svg { width: 16px; height: 16px; }
  html.hx-v5 #helix-content > .helix-lead-detail > .helix-lead-detail-actionbar > .helix-actionbar-btn[data-action="info"] { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  html.hx-v5 .helix-app :where(.helix-sheet-backdrop:not(#helix-mas-sheet)) .helix-sheet-action { transition: none; }
}
