/* Helix · panel v5 · mibot: todo cuelga de html.hx-v5 (plan: docs/plans/panel-v5-fd90).
   Prototipo aprobado: gen.py, mibot() y las capas «mi bot: la tarjeta de producción» y «mi bot: bola
   real + cometa de señal». El orbe (helix-orb.js) y la cometa de su tarjeta (.signal-border::before y
   ::after) se quedan como en producción: aquí solo se viste el contenedor. Estructura (la monta
   helix-v5-mibot.js): cabecera, tarjeta «TU BOT» y dos columnas (fichas y resto de secciones |
   simulador «Pruébalo»). Maquetación solo en escritorio: el móvil v5 se diseña después. */

/* El orbe (helix-orb.js) pinta con los tokens de su contenedor (--accent y --heat-*: shader y respaldo CSS).
   La paleta v5 cambia --accent a coral; aquí se le devuelven al propio orbe los valores de producción para
   que sea EXACTAMENTE el de hoy (decisión de Alex). Son tokens, no maquetación: también en móvil. */
html.hx-v5 .helix-app .helix-orb { --accent: #007AFF; --heat-frio: #8E8E93; --heat-caliente: #FF6B35; --heat-listo: #FF3B30; }
html.hx-v5[data-theme="dark"] .helix-app .helix-orb { --accent: #0A84FF; --heat-frio: #6E6E78; --heat-caliente: #FF8245; --heat-listo: #FF453A; }

@media (min-width: 1024px) {
  /* El panel no fija box-sizing global: las medidas del prototipo son de caja completa. */
  html.hx-v5 .helix-app .hx5-mb,
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero,
  html.hx-v5 .helix-app .hx5-mb .helix-settings-section,
  html.hx-v5 .helix-app .hx5-mb .hx5-fi,
  html.hx-v5 .helix-app .hx5-mb .hx5-sim-campo { box-sizing: border-box; }

  /* ── Contenedor y cabecera ── */
  /* Mismo margen que Embudo y Agenda (contenido a 14 px de la hoja, título a 28 px): antes quedaba 10 px más adentro. */
  html.hx-v5 .helix-app .helix-shell:not(.inbox-active) .helix-tab-pane.is-active:has(> .hx5-mb) { padding-left: 14px; padding-right: 14px; }
  html.hx-v5 .helix-app .hx5-mb { max-width: none; margin: 0; padding: 0 0 24px; }
  html.hx-v5 .helix-app .hx5-mb-cab { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; }
  html.hx-v5 .helix-app .hx5-mb-tit { margin-right: auto; padding: 4px 0 0 14px; min-width: 0; animation: hx5-entraL .5s var(--v5-eo) both; }
  html.hx-v5 .helix-app .hx5-mb-tit h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-mb-tit p { margin: 3px 0 0; font-size: 13.5px; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb-tools { display: flex; align-items: center; gap: 10px; padding-top: 4px; animation: hx5-entra .6s var(--v5-eo) both; }

  /* ── Tarjeta «TU BOT»: contenedor del orbe y de la cometa de producción ── */
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero { min-height: 200px; margin: 0 0 14px; border-radius: 24px;
    box-shadow: var(--v5-sh1), var(--v5-shg); animation: hx5-entra .6s var(--v5-eo) both; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-inner { min-height: 197px; margin: 1.5px; padding: 0 28px; gap: 18px 20px; border-radius: 22.5px;
    background: var(--v5-card); align-items: center; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-main { gap: 26px; min-width: auto; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-texto { min-width: auto; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-texto .t-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-titulo { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero[data-estado="pausado"] .helix-bot-hero-titulo,
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero[data-estado="global"] .helix-bot-hero-titulo { color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-sub { max-width: 360px; margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones { flex-wrap: nowrap; align-items: center; gap: 10px; margin-top: 12px; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones .helix-btn { height: 38px; min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0;
    font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; text-shadow: none; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones [data-hero="probar"],
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones .helix-btn--primary { background: var(--v5-acc); color: #fff; font-weight: 600; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones .helix-btn--secondary { background: var(--v5-card2); color: var(--v5-t1); box-shadow: 0 0 0 1px var(--v5-line); }
  html.hx-v5:not([data-theme="dark"]) .helix-app .hx5-mb .helix-bot-hero-acciones .helix-btn--secondary { background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones [data-hero="ajustes"] { padding: 0 4px; background: transparent; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones [data-hero="ajustes"]:hover { color: var(--v5-t1); background: transparent; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-acciones .helix-btn--primary:hover { filter: brightness(1.08); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stats { align-items: stretch; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stat,
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stat:first-child,
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stat:last-child { min-width: 0; gap: 0; padding: 6px 20px; justify-content: center; border-left: 1px solid var(--v5-line); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stat:first-child { border-left: 0; }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-num { font-size: 40px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-mb .helix-bot-hero-stat .t-caption { margin-top: 6px; font-size: 13.5px; white-space: nowrap; color: var(--v5-t2); }

  /* ── Dos columnas: fichas y secciones | Pruébalo ── */
  html.hx-v5 .helix-app .hx5-mb-cols { display: grid; grid-template-columns: minmax(0, 470fr) minmax(0, 492fr); gap: 14px; align-items: start; }
  html.hx-v5 .helix-app .hx5-mb-izq { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  html.hx-v5 .helix-app .hx5-mb-der { position: sticky; top: 14px; min-width: 0; }
  html.hx-v5 .helix-app .hx5-mb-izq > .helix-settings-section { margin: 0; padding: 16px 18px; border: 0; border-radius: 22px;
    background: var(--v5-card); box-shadow: var(--v5-sh1); animation: hx5-entra .6s var(--v5-eo) .1s both; }
  html.hx-v5 .helix-app .hx5-mb-izq > .helix-settings-section[hidden] { display: none; }
  html.hx-v5 .helix-app .hx5-mb-izq > .helix-settings-section > .t-eyebrow:first-child { font-size: 15px; font-weight: 600; letter-spacing: -.01em;
    text-transform: none; color: var(--v5-t1); }

  /* ── Fichas del perfil ── */
  html.hx-v5 .helix-app .hx5-mb-izq > #helix-perfil-tarjetas-seccion { padding: 0; background: transparent; box-shadow: none; border-radius: 0; animation: none; }
  html.hx-v5 .helix-app .hx5-mb #helix-perfil-tarjetas-seccion > .t-eyebrow,
  html.hx-v5 .helix-app .hx5-mb #helix-perfil-tarjetas-seccion > .t-caption { display: none; }
  /* !important: el espaciado, el borde y el radio de las fichas vienen en línea desde helix-mibot.js */
  html.hx-v5 .helix-app .hx5-mb #helix-perfil-tarjetas { gap: 9px !important; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi { position: relative; padding: 13px 14px !important; border: 0 !important; border-radius: 18px !important;
    background: var(--v5-card); box-shadow: var(--v5-sh1); animation: hx5-entra .6s var(--v5-eo) both;
    transition: transform .25s var(--v5-eo), box-shadow .35s var(--v5-eo), background .45s var(--v5-eo); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi:nth-child(2) { animation-delay: 45ms; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi:nth-child(3) { animation-delay: 90ms; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi:nth-child(4) { animation-delay: 135ms; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi:nth-child(5) { animation-delay: 180ms; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi:hover { transform: translateY(-2px); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-extra { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; }
  html.hx-v5 .helix-app .hx5-mb #helix-perfil-tarjetas > .hx5-fi-extra { margin-top: 0; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-extra:empty { display: none; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 !important; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-txt { min-width: 0; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-t { font-size: 14px !important; font-weight: 600 !important; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-ayuda,
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-d { margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.hx-v5 .helix-app .hx5-mb .hx5-con-res .hx5-fi-ayuda { display: none; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-chips span { padding: 3px 10px; border-radius: 999px; font-size: 12px; line-height: 1.4; color: var(--v5-t1); background: var(--v5-line); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-ver { padding: 3px 4px; border: 0; background: transparent; font: inherit; font-size: 12px; color: var(--v5-t3); cursor: pointer;
    transition: color .2s var(--v5-eo); }
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-ver:hover { color: var(--v5-t1); }
  /* el detalle completo de siempre: a un toque, y a la vista mientras se edita la ficha */
  html.hx-v5 .helix-app .hx5-mb .hx5-con-res > .helix-perfil-cuerpo { display: none; }
  html.hx-v5 .helix-app .hx5-mb .hx5-con-res.hx5-ver > .helix-perfil-cuerpo,
  html.hx-v5 .helix-app .hx5-mb .hx5-con-res:has(> .helix-perfil-editor:not(:empty)) > .helix-perfil-cuerpo { display: block; margin-top: 10px;
    padding-top: 10px; border-top: 1px solid var(--v5-line); animation: hx5-entra .35s var(--v5-eo) both; }
  html.hx-v5 .helix-app .hx5-mb .helix-perfil-cuerpo .t-caption { color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-mb .helix-perfil-cuerpo .t-caption:not(.fg-3) { color: var(--v5-t1); }
  /* «Cambiar»: el botón de siempre con la forma del prototipo */
  html.hx-v5 .helix-app .hx5-mb .helix-perfil-cambiar,
  html.hx-v5 .helix-app .hx5-mb .hx5-fi-c { flex-shrink: 0; height: 36px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
    background: var(--v5-card2); color: var(--v5-t1); font: inherit; font-size: 13.5px; font-weight: 500; text-shadow: none; box-shadow: none; }
  html.hx-v5:not([data-theme="dark"]) .helix-app .hx5-mb .helix-perfil-cambiar,
  html.hx-v5:not([data-theme="dark"]) .helix-app .hx5-mb .hx5-fi-c { background: #ECECEF; }
  html.hx-v5 .helix-app .hx5-mb .helix-perfil-cambiar:hover { background: color-mix(in srgb, var(--v5-t1) 12%, transparent); }
  html.hx-v5 .helix-app .hx5-mb .helix-perfil-editor textarea { border-radius: 12px !important; border-color: var(--v5-line) !important; background: var(--v5-bin) !important; }

  /* ── Pruébalo: el Simulador de siempre como tarjeta de cristal ── */
  html.hx-v5 .helix-app .hx5-mb .hx5-sim { position: relative; isolation: isolate; display: flex; flex-direction: column; margin: 0; padding: 0;
    height: clamp(400px, calc(100vh - 346px), 720px); border: 0; border-radius: 24px; overflow: hidden;
    background: var(--v5-glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
    box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-shg); animation: hx5-entra .6s var(--v5-eo) .15s both; }
  html.hx-v5 .helix-app .hx5-mb .hx5-sim > .t-eyebrow,
  html.hx-v5 .helix-app .hx5-mb .hx5-sim > .t-caption { display: none; }
  html.hx-v5 .helix-app .hx5-sim-h { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 14px 16px; border-bottom: 1px solid var(--v5-line); }
  html.hx-v5 .helix-app .hx5-sim-h b { font-size: 15px; font-weight: 600; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-sim-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hx5-sim-m { display: inline-flex; flex-shrink: 0; min-width: 30px; min-height: 30px; }
  html.hx-v5 .helix-app .hx5-sim-h #helix-sim-reset { flex-shrink: 0; height: 28px; min-height: 28px; margin-left: auto; padding: 0 11px; border: 0; border-radius: 999px;
    background: var(--v5-card2); color: var(--v5-t2); font: inherit; font-size: 12px; font-weight: 500; text-shadow: none; }
  html.hx-v5 .helix-app .hx5-sim-h #helix-sim-reset:hover { color: var(--v5-t1); }
  /* !important: el registro y las burbujas traen estilos en línea (helix-config.js, _wireSimulador) */
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log { flex: 1; min-height: 0; max-height: none !important; margin: 0 !important; padding: 12px 16px !important;
    gap: 6px !important; border: 0 !important; border-radius: 0 !important; overflow-y: auto; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > :first-child { margin-top: auto !important; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > span.t-caption:only-child { margin: auto !important; font-size: 13px; color: var(--v5-t3); }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > div[style*="flex-start"] { max-width: 80% !important; padding: 9px 14px !important; border: 0 !important;
    border-radius: 19px !important; background: var(--v5-bin) !important; color: var(--v5-t1) !important; font-size: 14px !important; line-height: 1.38;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .25); animation: hx5-burbuja .45s var(--v5-eo) both; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > div[style*="flex-end"]:not(.t-caption):not(.helix-sim-escribiendo) { max-width: 80% !important;
    padding: 9px 14px !important; border: 0 !important; border-radius: 19px !important; background: var(--v5-acc) !important; color: #fff !important;
    font-size: 14px !important; line-height: 1.38; box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--v5-acc) 70%, transparent);
    animation: hx5-burbuja .45s var(--v5-eo) both; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > .helix-sim-escribiendo { border: 0 !important; border-radius: 19px !important; background: var(--v5-bin) !important; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-log > .t-caption { font-size: 11px; color: var(--v5-t3); }
  html.hx-v5 .helix-app .hx5-sim .hx5-sim-campo { display: flex; align-items: center; gap: 8px !important; flex-shrink: 0; height: 46px; margin: 4px 14px 0; padding: 0 6px 0 18px;
    border: 0; border-radius: 999px; background: var(--v5-glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
    box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), 0 10px 26px -14px rgba(0, 0, 0, .35); }
  html.hx-v5 .helix-app .hx5-sim .hx5-sim-campo:focus-within { box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), 0 0 0 3px color-mix(in srgb, var(--v5-acc) 28%, transparent); }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent;
    box-shadow: none; outline: none; font: inherit; font-size: 14px; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-input::placeholder { color: var(--v5-t3); }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-send { position: relative; flex-shrink: 0; width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 50%;
    background: var(--v5-acc); color: #fff; font-size: 0; text-shadow: none; box-shadow: none; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-send:not(.is-ocupado):not(.is-hecho)::after { content: none; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-send::before { content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-send:disabled { opacity: .55; }
  html.hx-v5 .helix-app .hx5-sim #helix-sim-send:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  html.hx-v5 .helix-app .hx5-sim-nota { flex-shrink: 0; padding: 7px 18px 12px; font-size: 11px; color: var(--v5-t3); }

  /* ── Resto de la pantalla: botones y campos con la paleta v5 ── */
  html.hx-v5 .helix-app .hx5-mb-izq .helix-btn { text-shadow: none; border-radius: 999px; }
  html.hx-v5 .helix-app .hx5-mb-izq .helix-btn--primary { background: var(--v5-acc); color: #fff; }
  html.hx-v5 .helix-app .hx5-mb-izq .helix-btn--primary:hover { filter: brightness(1.08); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  html.hx-v5 .helix-app .hx5-mb-izq .helix-btn--secondary,
  html.hx-v5 .helix-app .hx5-mb-izq .helix-btn--ghost { background: var(--v5-card2); color: var(--v5-t1); }
  html.hx-v5:not([data-theme="dark"]) .helix-app .hx5-mb-izq .helix-btn--secondary,
  html.hx-v5:not([data-theme="dark"]) .helix-app .hx5-mb-izq .helix-btn--ghost { background: #ECECEF; }
  html.hx-v5 .helix-app .hx5-mb .helix-btn--primary:not(.is-ocupado):not(.is-hecho)::after,
  html.hx-v5 .helix-app .hx5-mb .helix-btn--secondary:not(.is-ocupado):not(.is-hecho)::after { content: none; }
  html.hx-v5 .helix-app .hx5-mb-izq textarea,
  html.hx-v5 .helix-app .hx5-mb-izq .hx-field { border-radius: 12px; }
  html.hx-v5 .helix-app .hx5-mb-izq .hx-choice.is-on { box-shadow: inset 0 0 0 1.5px var(--v5-acc); }
  html.hx-v5 .helix-app .hx5-mb-izq .hx-switch input:checked ~ .hx-switch-track { background: var(--v5-ok); }
  html.hx-v5 .helix-app .hx5-mb-izq .hx-field:focus,
  html.hx-v5 .helix-app .hx5-mb-izq textarea:focus { outline: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v5-acc) 55%, transparent), 0 0 0 3px var(--accent-ring); }
  /* En la columna estrecha, el tipo y el archivo de la biblioteca van uno debajo del otro (rejilla en línea) */
  html.hx-v5 .helix-app .hx5-mb-izq #biblioteca-lista .hx-form > div[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}
