/* ===========================================================================
   SeMiLLa App v1.0 - Estilos
   Paleta: sage pastel + crema + acentos durazno/lavanda
   =========================================================================== */

/* ---- Variables (paleta) ----
   Sage:        #81c784 (medio)  #a5d6a7 (pastel)  #c8e6c9 (muy claro)
   Sage oscuro: #4a5d52 (header)
   Crema:       #faf8f3 (fondo)  #f5f1e8 (boxes)
   Slate:       #455a64 (texto)
   Acento:      #ffab91 (durazno)  #ce93d8 (lavanda)  #fff59d (mantequilla)
*/

/* ---- Tipografia base ---- */
body, .content-wrapper {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #faf8f3;
    color: #455a64;
}

/* ---- Header ---- */
.skin-blue .main-header .navbar {
    background-color: #4a5d52;
}
.skin-blue .main-header .logo {
    background-color: #3d4d44;
    font-weight: 600;
    font-size: 18px;
    color: #faf8f3;
}
.skin-blue .main-header .logo:hover {
    background-color: #3d4d44;
    color: #c8e6c9;
}
.skin-blue .main-header .navbar .sidebar-toggle:hover {
    background-color: #3d4d44;
}

/* ---- Sidebar ---- */
.skin-blue .main-sidebar {
    background-color: #4a5d52;
}
.skin-blue .sidebar-menu > li.header {
    color: #c8e6c9;
    background-color: #3d4d44;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.skin-blue .sidebar-menu > li > a {
    color: #e8efe9;
    border-left: 3px solid transparent;
}
.skin-blue .sidebar-menu > li.active > a,
.skin-blue .sidebar-menu > li:hover > a {
    background-color: #5a6f62;
    border-left-color: #a5d6a7;
    color: #ffffff;
}
.skin-blue .sidebar-menu .treeview-menu > li > a {
    padding-left: 35px;
    color: #c8d6cb;
    font-size: 13px;
}
.skin-blue .sidebar-menu .treeview-menu > li.active > a,
.skin-blue .sidebar-menu .treeview-menu > li > a:hover {
    color: #ffffff;
    background-color: #6a8174;
}

/* ---- Boxes ---- */
.box {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(74, 93, 82, 0.08);
    border-top: 3px solid #a5d6a7;
    background-color: #ffffff;
}
.box.box-primary {
    border-top-color: #a5d6a7;
}
.box.box-success {
    border-top-color: #81c784;
}
.box.box-info {
    border-top-color: #ce93d8;
}
.box.box-warning {
    border-top-color: #ffab91;
}
.box.box-danger {
    border-top-color: #ef9a9a;
}
.box-header.with-border {
    border-bottom: 1px solid #f0ebe0;
}
.box-header h3.box-title {
    font-weight: 600;
    color: #4a5d52;
}
/* En boxes de cabecera solida (solidHeader: primary azul, success verde, etc.)
   el gris #4a5d52 no contrasta con el fondo de color: titulo en blanco. */
.box.box-solid > .box-header .box-title,
.box.box-solid > .box-header h3.box-title {
    color: #ffffff;
}

/* ---- Botones ---- */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}
.btn-primary, .bttn-primary {
    background-color: #81c784 !important;
    border-color: #81c784 !important;
    color: #ffffff !important;
}
.btn-primary:hover {
    background-color: #66bb6a !important;
    border-color: #66bb6a !important;
}
.btn-success {
    background-color: #a5d6a7;
    border-color: #a5d6a7;
    color: #2e3d32;
}
.btn-success:hover {
    background-color: #81c784;
    border-color: #81c784;
    color: #ffffff;
}
.btn-warning {
    background-color: #ffab91;
    border-color: #ffab91;
    color: #5d2e1f;
}
.btn-warning:hover {
    background-color: #ff8a65;
    border-color: #ff8a65;
    color: #ffffff;
}
.btn-info {
    background-color: #ce93d8;
    border-color: #ce93d8;
    color: #4a235a;
}
.btn-info:hover {
    background-color: #ba68c8;
    border-color: #ba68c8;
    color: #ffffff;
}
.btn-danger {
    background-color: #ef9a9a;
    border-color: #ef9a9a;
    color: #5d1f1f;
}
.btn-danger:hover {
    background-color: #e57373;
    border-color: #e57373;
    color: #ffffff;
}
.btn-lg {
    padding: 10px 22px;
    font-size: 15px;
}

/* ---- Inputs ---- */
.form-control {
    border-radius: 6px;
    border-color: #d7d2c4;
    background-color: #ffffff;
}
.form-control:focus {
    border-color: #a5d6a7;
    box-shadow: 0 0 0 3px rgba(165, 214, 167, 0.18);
}

/* ---- Tablas DT ---- */
table.dataTable thead th {
    background-color: #f5f1e8;
    color: #4a5d52;
    font-weight: 600;
    border-bottom: 2px solid #d7d2c4;
}
table.dataTable tbody tr {
    background-color: #ffffff;
}
table.dataTable tbody tr:hover {
    background-color: #f1f8e9 !important;
}
table.dataTable.stripe tbody tr.odd {
    background-color: #fafaf6;
}

/* ---- Estado global (banner superior) ---- */
.well {
    background-color: #f5f1e8;
    border: 1px solid #ebe5d4;
    border-radius: 6px;
    box-shadow: none;
}
.estado-banner {
    padding: 8px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}
.estado-banner.ok {
    background-color: #f1f8e9;
    color: #2e5d33;
    border-left: 4px solid #a5d6a7;
}
.estado-banner.warn {
    background-color: #fff3e0;
    color: #5d3520;
    border-left: 4px solid #ffab91;
}
.estado-banner.err {
    background-color: #fce4ec;
    color: #5d1f3d;
    border-left: 4px solid #ef9a9a;
}

/* ---- Labels (de Bootstrap, usados en estado global) ---- */
.label-success {
    background-color: #a5d6a7;
    color: #2e3d32;
}
.label-danger {
    background-color: #ef9a9a;
    color: #5d1f1f;
}
.label-warning {
    background-color: #ffcc80;
    color: #5d3520;
}
.label-info {
    background-color: #ce93d8;
    color: #4a235a;
}

/* ---- Fase / paso (encabezados) ---- */
.fase-box {
    background: linear-gradient(135deg, #f5f9f1 0%, #e8f5e9 100%);
    padding: 14px 20px;
    border-left: 5px solid #a5d6a7;
    margin-bottom: 16px;
    border-radius: 6px;
}
.fase-titulo {
    margin: 0 0 4px 0;
    color: #4a5d52;
    font-size: 18px;
    font-weight: 600;
}
.fase-numero {
    background: #a5d6a7;
    color: #2e3d32;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.fase-desc {
    color: #6b7d76;
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

/* ---- Encabezados h2 (titulo de cada paso) ---- */
.content-wrapper h2 {
    color: #4a5d52;
    border-bottom: 2px solid #f5f1e8;
    padding-bottom: 8px;
    margin-bottom: 18px;
    font-weight: 600;
}
.content-wrapper h2 .fa,
.content-wrapper h2 .fas,
.content-wrapper h2 .far {
    color: #a5d6a7;
    margin-right: 8px;
}

/* ---- Indicador de paso completado ---- */
.paso-ok {
    color: #2e5d33;
    font-weight: 600;
}
.paso-ok::before {
    content: "OK ";
    color: #81c784;
}
.paso-pendiente {
    color: #b0a890;
    font-style: italic;
}

/* ---- Modal ---- */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(74, 93, 82, 0.18);
}
.modal-header {
    background-color: #a5d6a7;
    color: #2e3d32;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}
.modal-header .close {
    color: #2e3d32;
    opacity: 0.7;
}
.modal-header .modal-title {
    font-weight: 600;
}

/* ---- Codigo / preformateado ---- */
pre {
    background-color: #f5f1e8;
    color: #4a5d52;
    border: 1px solid #ebe5d4;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    font-size: 13px;
}
code {
    background-color: #f5f1e8;
    color: #6a4a3d;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* ---- Sliders ---- */
.irs--shiny .irs-bar {
    background: #a5d6a7;
    border-color: #81c784;
}
.irs--shiny .irs-handle {
    background: #ffffff;
    border: 2px solid #81c784;
}
.irs--shiny .irs-from,
.irs--shiny .irs-to,
.irs--shiny .irs-single {
    background: #81c784;
    color: #ffffff;
}
.irs--shiny .irs-line {
    background: #ebe5d4;
}
.irs--shiny .irs-min,
.irs--shiny .irs-max {
    background: #f5f1e8;
    color: #6b7d76;
}

/* ---- ValueBoxes (azul/violeta originales reemplazados) ---- */
.small-box.bg-blue {
    background-color: #a5d6a7 !important;
    color: #2e3d32 !important;
}
.small-box.bg-purple {
    background-color: #ce93d8 !important;
    color: #4a235a !important;
}
.small-box.bg-green {
    background-color: #c8e6c9 !important;
    color: #2e3d32 !important;
}
.small-box.bg-yellow {
    background-color: #fff59d !important;
    color: #5d3520 !important;
}

/* ---- Spinner / loading ---- */
.shiny-busy::after {
    content: "Procesando...";
    position: fixed;
    top: 70px;
    right: 20px;
    background: #ffab91;
    color: #5d2e1f;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- Alerts (Bootstrap) ---- */
.alert-success {
    background-color: #f1f8e9;
    color: #2e5d33;
    border-color: #a5d6a7;
}
.alert-info {
    background-color: #f3e5f5;
    color: #4a235a;
    border-color: #ce93d8;
}
.alert-warning {
    background-color: #fff3e0;
    color: #5d3520;
    border-color: #ffcc80;
}
.alert-danger {
    background-color: #fce4ec;
    color: #5d1f3d;
    border-color: #ef9a9a;
}

/* ---- Scrollbar (sutil) ---- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #faf8f3;
}
::-webkit-scrollbar-thumb {
    background: #d7d2c4;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a5d6a7;
}

/* ---- Panel de referencias cientificas ---- */
details.ref-panel {
    background-color: #f5f1e8;
    border-left: 4px solid #ce93d8;
    border-radius: 4px;
    margin: 12px 0 18px 0;
    padding: 8px 14px;
}
details.ref-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: #4a235a;
    user-select: none;
    list-style: none;
    padding: 4px 0;
    font-size: 13px;
    outline: none;
}
details.ref-panel summary::-webkit-details-marker { display: none; }
details.ref-panel summary::before {
    content: "+ ";
    color: #ba68c8;
    font-weight: 700;
    margin-right: 4px;
}
details.ref-panel[open] summary::before {
    content: "- ";
}
details.ref-panel summary:hover { color: #ba68c8; }
details.ref-panel summary i, details.ref-panel summary .fa, details.ref-panel summary .fas {
    color: #ce93d8;
    margin-right: 6px;
}
details.ref-panel ol {
    margin-top: 10px;
    margin-bottom: 4px;
    padding-left: 24px;
    font-size: 12.5px;
    color: #455a64;
}
details.ref-panel ol li {
    margin-bottom: 8px;
    line-height: 1.5;
    padding-left: 4px;
}
details.ref-panel ol li i {
    color: #4a5d52;
}

/* ---- Switch ES/EN en header ---- */
.skin-blue .main-header .navbar .dropdown #lang_toggle ~ span,
.skin-blue .main-header .navbar .dropdown label[for="lang_toggle"] {
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
}
.skin-blue .main-header .navbar .dropdown .bootstrap-switch {
    margin-bottom: 0;
}

/* ---- Footer ---- */
.semilla-footer {
    text-align: center;
    color: #b0a890;
    font-size: 12px;
    padding: 15px;
    margin-top: 20px;
    border-top: 1px solid #ebe5d4;
}

/* ===========================================================================
   WIZARD v2 - stepper, barra de navegacion, pantalla de bifurcacion
   =========================================================================== */

/* Menu real oculto (solo navegacion programatica) */
.wizard-hidden-menu-wrap { display: none !important; }

/* ---- Stepper vertical (en el sidebar) ---- */
.wiz-stepper { padding: 10px 8px 30px; }
.wiz-stepper-title {
    color: #c8e6c9;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 12px 12px;
    border-bottom: 1px solid #3d4d44;
    margin-bottom: 10px;
}
.wiz-stepper-title .fa, .wiz-stepper-title .fas { color: #a5d6a7; }
.wiz-phase {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 8px;
    margin: 2px 4px;
    color: #c8d6cb;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}
.wiz-phase .wiz-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #3d4d44;
    color: #c8d6cb;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
    border: 2px solid #5a6f62;
}
.wiz-phase.done { color: #e8efe9; }
.wiz-phase.done .wiz-dot {
    background: #a5d6a7; color: #2e3d32; border-color: #a5d6a7;
}
.wiz-phase.active {
    background: #5a6f62; color: #ffffff;
    border-left-color: #a5d6a7; font-weight: 600;
}
.wiz-phase.active .wiz-dot {
    background: #ffffff; color: #2e3d32; border-color: #ffffff;
}
.wiz-phase-sub {
    font-size: 11px; color: #9ab0a2;
    margin: -2px 0 8px 47px; font-style: italic;
}

/* ---- Barra inferior de navegacion ---- */
.wiz-navbar {
    position: sticky; bottom: 0;
    background: #ffffff;
    border-top: 1px solid #ebe5d4;
    padding: 12px 18px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 -3px 12px rgba(74, 93, 82, 0.07);
    margin: 28px -15px -15px -15px;
    z-index: 800;
}
.wiz-progress-wrap { flex: 1; }
.wiz-progress-track {
    background: #ebe5d4; border-radius: 6px; height: 8px; overflow: hidden;
}
.wiz-progress-fill {
    background: linear-gradient(90deg, #a5d6a7, #81c784);
    height: 100%; transition: width .3s ease;
}
.wiz-progress-label {
    font-size: 12.5px; color: #6b7d76; margin-top: 6px;
    display: flex; align-items: center; gap: 14px;
}
.wiz-exit-link {
    color: #b08; color: #ba68c8 !important;
    font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.wiz-exit-link:hover { color: #8e24aa !important; text-decoration: underline; }
.wiz-navbar .btn { min-width: 110px; }

/* ---- Pantalla de bifurcacion (paso 0) ---- */
.wiz-hero { text-align: center; padding: 28px 16px 4px; }
.wiz-hero h1 { color: #4a5d52; font-weight: 700; margin: 10px 0 6px; }
.wiz-hero p { color: #6b7d76; font-size: 15px; max-width: 620px; margin: 0 auto; }
.wiz-choice-wrap {
    display: flex; gap: 30px; justify-content: center;
    flex-wrap: wrap; margin: 34px 0 18px;
}
.wiz-choice-card {
    width: 340px; background: #ffffff;
    border: 2px solid #e3ddcd; border-radius: 16px;
    padding: 34px 28px; text-align: center; cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 2px 10px rgba(74, 93, 82, 0.06);
}
.wiz-choice-card:hover {
    border-color: #81c784; transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(74, 93, 82, 0.15);
}
.wiz-choice-icon { font-size: 54px; margin-bottom: 16px; }
.wiz-choice-card h3 { color: #4a5d52; font-weight: 700; margin: 4px 0 12px; }
.wiz-choice-card p {
    color: #6b7d76; font-size: 13.5px; line-height: 1.55; margin-bottom: 18px;
}
.wiz-choice-go {
    display: inline-block; font-weight: 600; font-size: 13.5px;
    color: #4a5d52; padding: 6px 16px; border-radius: 20px;
    background: #f1f8e9;
}
.wiz-choice-build .wiz-choice-icon { color: #81c784; }
.wiz-choice-build:hover { border-color: #81c784; }
.wiz-choice-build:hover .wiz-choice-go { background: #a5d6a7; color: #2e3d32; }
.wiz-choice-validate .wiz-choice-icon { color: #ce93d8; }
.wiz-choice-validate:hover { border-color: #ce93d8; }
.wiz-choice-validate:hover .wiz-choice-go { background: #e7c9ec; color: #4a235a; }
.wiz-hero-note {
    text-align: center; color: #6b7d76; font-size: 12.5px;
    max-width: 680px; margin: 6px auto 0;
    background: #f5f1e8; border-radius: 8px; padding: 10px 18px;
    border-left: 4px solid #ce93d8;
}
.wiz-hero-note .fa, .wiz-hero-note .fas { color: #ce93d8; }

/* ===========================================================================
   WIZARD v2.1 - checks reales, fases clicables, guia por paso, boton
   protagonista y pantalla final
   =========================================================================== */

/* Fase visitada pero incompleta (advertencia ambar) */
.wiz-phase.part { color: #e8efe9; }
.wiz-phase.part .wiz-dot {
    background: #f0ad4e; color: #3b2f18; border-color: #f0ad4e;
    font-size: 13px;
}
/* La fase actual conserva su resaltado aunque este completa o parcial */
.wiz-phase.active { background: #5a6f62; color: #ffffff; }

/* Fases desbloqueadas: clicables para saltar directo */
.wiz-phase.clickable { cursor: pointer; }
.wiz-phase.clickable:hover {
    background: #46584d;
    border-left-color: #81c784;
}

/* Etiqueta (opcional) en el stepper */
.wiz-opt-tag {
    display: inline-block; margin-left: 6px;
    font-size: 10px; color: #9ab0a2; font-style: italic;
}

/* Boton "Saltar esta fase" en la navbar */
.wiz-skip-btn { border-style: dashed !important; color: #6b7d76; }

/* Cajita guia por paso (que hace / necesitas / obtendras) */
.wiz-guia {
    display: flex; gap: 14px; align-items: flex-start;
    background: #f1f8e9;
    border: 1px solid #dcedc8;
    border-left: 5px solid #81c784;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 6px 0 18px;
}
.wiz-guia-icon { font-size: 26px; line-height: 1.2; flex-shrink: 0; }
.wiz-guia-text { font-size: 13px; color: #4a5d52; line-height: 1.65; }
.wiz-guia-text b { color: #2e5d3a; }

/* Boton protagonista: UNA accion grande y obvia por pantalla */
.wiz-action {
    display: block !important;
    margin: 18px auto 14px !important;
    min-width: 320px; max-width: 520px;
    font-size: 16.5px !important;
    font-weight: 700 !important;
    padding: 12px 30px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 14px rgba(74, 93, 82, 0.18);
}
.wiz-action:hover { transform: translateY(-1px); }

/* Pantalla final de resumen */
.wiz-final-hero { text-align: center; padding: 18px 16px 10px; }
.wiz-final-hero h1 { color: #4a5d52; font-weight: 700; margin: 8px 0 6px; }
.wiz-final-hero p { color: #6b7d76; font-size: 14.5px; max-width: 640px; margin: 0 auto 8px; }

/* ===========================================================================
   PILOTO AUTOMATICO - panel flotante del agente
   =========================================================================== */
.ap-panel {
    position: fixed; right: 18px; bottom: 86px;
    width: 380px; max-height: 46vh;
    background: #ffffff;
    border: 1px solid #dcedc8; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(46, 61, 50, 0.25);
    z-index: 950; display: flex; flex-direction: column;
    overflow: hidden;
}
.ap-panel-head {
    background: #2f4f3e; color: #fff;
    padding: 9px 14px; font-weight: 700; font-size: 13.5px;
    display: flex; justify-content: space-between; align-items: center;
}
.ap-live { color: #81c784; margin-left: 7px; animation: ap-blink 1.2s infinite; }
@keyframes ap-blink { 50% { opacity: 0.25; } }
.ap-stop-link { color: #ffccbc !important; font-size: 12px; font-weight: 600; }
.ap-panel-log { overflow-y: auto; padding: 8px 10px; font-size: 12.3px; }
.ap-entry { padding: 4px 6px; border-radius: 6px; margin-bottom: 3px; line-height: 1.45; }
.ap-entry .ap-time { color: #9e9e9e; font-size: 10.5px; }
.ap-entry.observa { background: #f5f9f6; color: #2e5d3a; }
.ap-entry.piensa  { background: #f3f0fa; color: #4a3d7a; font-style: italic; }
.ap-entry.decide  { background: #fff8e1; color: #7a5c00; font-weight: 600; }
.ap-entry.ejecuta { background: #e8f5e9; color: #1b5e20; }
.ap-entry.alerta  { background: #ffebee; color: #b71c1c; font-weight: 600; }
.ap-entry.fin     { background: #e0f2f1; color: #00695c; font-weight: 700; }

/* Boton piloto en la navbar */
.wiz-ap-btn { border-color: #81c784 !important; color: #2e7d32 !important; font-weight: 600; }
.wiz-ap-btn:hover { background: #e8f5e9 !important; }

/* ===========================================================================
   CHAT IA "profesor" (pantalla final)
   =========================================================================== */
.chatia-log {
    max-height: 420px; overflow-y: auto;
    background: #fafcf9; border: 1px solid #e6efe4; border-radius: 10px;
    padding: 12px; margin-bottom: 10px;
}
.chatia-hint { color: #7a8a80; font-size: 13px; padding: 14px; text-align: center; }
.chatia-msg {
    max-width: 88%; padding: 10px 14px; border-radius: 12px;
    margin-bottom: 10px; font-size: 13.5px; line-height: 1.55;
}
.chatia-msg.user {
    background: #4a7a5e; color: #fff; margin-left: auto;
    border-bottom-right-radius: 3px;
}
.chatia-msg.assistant {
    background: #ffffff; border: 1px solid #dcedc8; color: #37474f;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 4px rgba(74, 93, 82, 0.08);
}
.chatia-msg.assistant p:last-child { margin-bottom: 0; }
.chatia-msg.assistant code { background: #f1f8e9; padding: 1px 5px; border-radius: 4px; }
.chatia-role { font-size: 10.5px; font-weight: 700; opacity: .75; margin-bottom: 3px; }
.chatia-input { display: flex; gap: 10px; align-items: flex-start; }
.chatia-input .form-group { flex: 1; margin-bottom: 0; }
.chatia-btns { display: flex; flex-direction: column; gap: 6px; }

/* Enlace fijo "Pregunta a SeMiLLa" en el sidebar + CTA en el resumen */
.wiz-chat-link-wrap {
    padding: 10px 12px; margin-top: 4px;
    border-top: 1px solid #3d4d44;
}
.wiz-chat-link {
    display: block; padding: 10px 12px; border-radius: 8px;
    color: #c8e6c9 !important; font-weight: 700; font-size: 13.5px;
    background: #3d4d44; text-decoration: none !important;
    border-left: 3px solid #81c784;
}
.wiz-chat-link:hover { background: #46584d; color: #ffffff !important; }
.wiz-chat-link.active { background: #5a6f62; color: #ffffff !important; }
.wiz-chat-cta {
    text-align: center; background: #f1f8e9; border: 1px solid #dcedc8;
    border-radius: 12px; padding: 20px 24px; margin-top: 6px;
}
.wiz-chat-cta h4 { color: #2e5d3a; font-weight: 700; margin: 8px 0 6px; }
.wiz-chat-cta p { color: #557; color: #5d6d64; max-width: 720px; margin: 0 auto 12px; }

/* Herramientas del chat: adjuntar docs, descargar, microfono */
.chatia-tools { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.chatia-file { flex: 1; }
.chatia-file .form-group { margin-bottom: 4px; }
.chatia-file .input-group .btn { border-radius: 8px 0 0 8px; }
.chatia-docs { margin: 2px 0 10px; }
.chatia-doc-badge {
    display: inline-block; background: #e8f5e9; color: #2e5d3a;
    border: 1px solid #c8e6c9; border-radius: 14px;
    padding: 3px 10px; margin: 0 6px 6px 0; font-size: 12px; font-weight: 600;
}
.chatia-doc-x {
    margin-left: 7px; color: #b71c1c !important; font-weight: 700;
    text-decoration: none !important; font-size: 14px;
}
.chatia-ta-wrap { flex: 1; position: relative; }
.chatia-ta-wrap .form-group { margin-bottom: 0; }
.chatia-mic-btn {
    position: absolute; right: 8px; bottom: 8px;
    border: 1px solid #cfd8dc; background: #f5f7f6; color: #546e7a;
    border-radius: 50%; width: 34px; height: 34px; cursor: pointer;
}
.chatia-mic-btn:hover { background: #e8f5e9; color: #2e5d3a; }
.chatia-mic-btn.mic-active {
    background: #ffcdd2; color: #b71c1c; border-color: #ef9a9a;
    animation: micPulse 1.1s ease-in-out infinite;
}
@keyframes micPulse { 50% { transform: scale(1.12); opacity: .8; } }
.chatia-ta-wrap textarea { padding-right: 50px; }

/* =========================================================================
   COMPUERTA PRE-APLICACION: panel de resultados explicado para principiantes
   Resumen siempre visible + detalle tecnico plegable ("Que significa esto?").
   ========================================================================= */

/* Banda de veredicto */
.cmp-veredicto {
    border-radius: 10px; padding: 16px 20px; margin-bottom: 4px;
    display: flex; align-items: center; gap: 18px;
}
.cmp-veredicto .cmp-emoji { font-size: 34px; line-height: 1; flex-shrink: 0; }
.cmp-veredicto .cmp-titulo { font-size: 1.55em; font-weight: 800; letter-spacing: .3px; }
.cmp-veredicto .cmp-sub { font-size: 14px; line-height: 1.5; margin-top: 3px; opacity: .92; }
.cmp-v-rojo    { background: #fdecea; border: 1px solid #f5c6c2; border-left: 6px solid #A11616; color: #7a1010; }
.cmp-v-ambar   { background: #fff8e1; border: 1px solid #ffe0a3; border-left: 6px solid #b58900; color: #7a5c00; }
.cmp-v-verde   { background: #eaf5ec; border: 1px solid #c3e3ca; border-left: 6px solid #1E8449; color: #17603a; }
/* Sin veredicto: algun eje no se pudo calcular. Gris a proposito, para que no
   se confunda con un resultado -ni bueno ni malo: no lo hay-. */
.cmp-v-gris    { background: #f2f3f4; border: 1px solid #d6d9dc; border-left: 6px solid #6b7378; color: #41484d; }

/* Nota de la regla de agregacion + ficha de parametros */
.cmp-regla {
    font-size: 12.5px; color: #5b6b63; background: #f5f7f6;
    border: 1px dashed #d3ded8; border-radius: 7px;
    padding: 7px 12px; margin: 8px 0 4px; line-height: 1.55;
}
.cmp-params { font-size: 12px; color: #7a8a83; margin: 2px 0 16px; line-height: 1.6; }
.cmp-params code { background: #eef2f0; color: #4a5d52; padding: 1px 5px; border-radius: 4px; }

/* Un bloque por eje */
.cmp-eje { border-top: 1px solid #e4eae7; padding: 16px 2px 4px; }
.cmp-eje-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cmp-eje-num { font-size: 15.5px; font-weight: 700; color: #2e5d3a; }
.cmp-eje-chip {
    font-size: 11px; font-weight: 700; letter-spacing: .5px;
    padding: 2px 9px; border-radius: 11px; text-transform: uppercase;
}
.cmp-chip-ok     { background: #e0f0e5; color: #1E8449; }
.cmp-chip-warn   { background: #fdf3d8; color: #8a6800; }
.cmp-chip-riesgo { background: #fbdedb; color: #A11616; }
.cmp-eje-llano { font-size: 14.5px; color: #37474f; line-height: 1.65; margin: 7px 0 2px; }

/* Plegable "Que significa esto?" */
details.cmp-mas { margin: 8px 0 2px; }
details.cmp-mas > summary {
    cursor: pointer; display: inline-block; list-style: none;
    font-size: 13px; font-weight: 600; color: #2e7d52;
    background: #f1f8e9; border: 1px solid #dcedc8;
    border-radius: 16px; padding: 4px 14px; user-select: none;
}
details.cmp-mas > summary::-webkit-details-marker { display: none; }
details.cmp-mas > summary:hover { background: #e6f3d8; }
details.cmp-mas[open] > summary { border-radius: 8px 8px 0 0; background: #e6f3d8; }
.cmp-mas-body {
    border: 1px solid #dcedc8; border-top: none; border-radius: 0 8px 8px 8px;
    background: #fbfdf8; padding: 13px 16px; font-size: 13.5px;
    color: #40514a; line-height: 1.7;
}
.cmp-mas-body b { color: #2e5d3a; }
.cmp-rotulo { font-weight: 700; color: #2e5d3a; display: block; margin-top: 11px; }
.cmp-rotulo:first-child { margin-top: 0; }

/* Linea cruda que emite el paquete */
.cmp-crudo {
    font-family: Consolas, Monaco, monospace; font-size: 12.5px;
    background: #eef2f0; color: #43524b;
    border-left: 3px solid #b0c4b8; border-radius: 0 6px 6px 0;
    padding: 7px 11px; margin: 5px 0 3px; word-break: break-word;
}

/* Tarjeta de cluster / par de items */
.cmp-grupo {
    background: #fff; border: 1px solid #e2e9e5; border-radius: 8px;
    padding: 10px 13px; margin: 9px 0;
}
.cmp-grupo-tit { font-size: 13px; font-weight: 700; color: #8a5a00; margin-bottom: 6px; }
.cmp-grupo ul { margin: 0; padding-left: 18px; }
.cmp-grupo li { margin: 3px 0; line-height: 1.55; }
.cmp-grupo .cmp-cod { font-weight: 700; color: #7a8a83; margin-right: 4px; }
.cmp-nucleo { background: #fff3cd; font-weight: 700; padding: 0 2px; border-radius: 3px; }

/* Bloque de acciones */
.cmp-acciones {
    border-top: 1px solid #e4eae7; margin-top: 16px; padding-top: 14px;
}
.cmp-acciones h4 { font-size: 15.5px; font-weight: 700; color: #2e5d3a; margin: 0 0 8px; }
.cmp-acciones ol { padding-left: 20px; margin: 0; }
.cmp-acciones li { margin: 6px 0; line-height: 1.65; font-size: 14px; color: #37474f; }
.cmp-nota-modo {
    font-size: 12.5px; color: #6b7d76; background: #f5f7f6;
    border-radius: 7px; padding: 8px 12px; margin-top: 12px; line-height: 1.6;
}

/* Lapiz de edicion manual junto a cada item senalado por la compuerta */
.cmp-edit-btn {
    border: 1px solid #cfd8dc; background: #f5f7f6; color: #6b7d76;
    border-radius: 5px; padding: 0 6px; margin-left: 7px;
    font-size: 12px; line-height: 1.5; cursor: pointer; vertical-align: middle;
}
.cmp-edit-btn:hover { background: #e8f5e9; color: #2e5d3a; border-color: #a5c9ae; }

/* =========================================================================
   PASO 5b redisenado: cabecera compacta, UNA accion visible, y todo lo
   secundario en paneles que se abren con un boton.
   ========================================================================= */
.cmp-hdr { display:flex; align-items:center; gap:14px; margin-bottom:12px;
           flex-wrap:wrap; }
.cmp-hdr h2 { font-size:1.5em; font-weight:700; color:#2e5d3a; }
.cmp-hdr-sub { color:#5b6b63; font-size:.92em; flex:1; min-width:220px; }

.cmp-accion { background:#fff; border:1px solid #e2e9e5; border-radius:12px;
              padding:16px 22px; margin-bottom:14px; }
.cmp-accion .shiny-options-group { display:flex; gap:18px; flex-wrap:wrap; }
.cmp-accion .radio label { font-size:.92em; color:#37474f; }
.cmp-btn-run { display:block !important; width:100%; max-width:440px;
  margin:10px auto 0 !important; font-size:1.05em !important;
  font-weight:700 !important; padding:12px !important; border-radius:10px !important; }
.cmp-eta { text-align:center; color:#8a6800; font-size:.85em; margin-top:8px; }
.cmp-fila-sec { display:flex; gap:10px; margin-top:14px; }
.cmp-fila-sec .btn { flex:1; }

/* Paneles que se despliegan bajo la tarjeta de accion */
.cmp-panel { background:#fff; border:1px solid #e2e9e5; border-radius:12px;
             padding:16px 22px; margin-bottom:14px; }
.cmp-panel h4 { font-size:1em; color:#2e5d3a; font-weight:700; margin-top:0; }

.cmp-resumen { background:#eaf5ec; border-left:4px solid #2e7d52;
  border-radius:0 8px 8px 0; padding:10px 14px; margin-bottom:14px;
  font-size:.9em; color:#2e5d3a; line-height:1.6; }
.cmp-resumen.naranja { background:#fdf3e3; border-left-color:#e67e22; color:#8a5a00; }

.cmp-opcion-extra { border:1px dashed #d3ded8; border-radius:9px;
  padding:6px 14px 2px; margin:14px 0; background:#fbfdfb; }
.cmp-opcion-extra label { font-weight:400; }
.cmp-nota { font-size:.85em; color:#7a8a83; }
.cmp-panel-mejora { background:#fbfdfb; border:1px solid #e9efec;
  border-radius:9px; padding:10px 14px 0; margin:10px 0; }

.cmp-paso-n { display:inline-block; width:22px; height:22px; border-radius:50%;
  background:#2e7d52; color:#fff; text-align:center; line-height:22px;
  font-size:.75em; font-weight:700; margin-right:8px; }
.cmp-paso { margin:10px 0; font-size:.93em; color:#37474f; }

/* Paso 3: notas y paneles plegables (mismo patron que el Paso 5b) */
.p3-nota { font-size:.84em; color:#7a8a83; line-height:1.55; }
.p3-sec { display:flex; gap:10px; margin:0 0 14px; }
.p3-sec .btn { flex:1; }
.p3-panel { background:#fff; border:1px solid #e2e9e5; border-radius:12px;
            padding:16px 20px; margin-bottom:14px; }
.p3-resumen-gen { text-align:center; font-size:.88em; color:#5b6b63;
                  margin:8px auto 4px; max-width:640px; line-height:1.6; }
/* Banda de incertidumbre del eje 3 (2.9.12). Un rango dentro de una frase se
   pierde; sobre una regla con el umbral marcado se ve de un vistazo si el
   resultado cae entero a un lado o lo cruza. */
.cmp-banda { background:#f4f9f6; border:1px solid #e4ebe7; border-left:4px solid #2e7d52;
             border-radius:0 8px 8px 0; padding:12px 16px; margin:12px 0; }
.cmp-banda-cruza { background:#fdf6e3; border-left-color:#b58900; }
.cmp-banda-tit { font-size:.9em; color:#2b3a33; margin-bottom:10px; }
.cmp-banda-cruza .cmp-banda-tit { color:#7a5c00; }
.cmp-banda-regla { position:relative; height:16px; background:#e4ebe7;
                   border-radius:8px; margin:6px 0 4px; }
.cmp-banda-rango { position:absolute; top:0; height:16px; background:#2e7d52;
                   border-radius:8px; opacity:.55; }
.cmp-banda-cruza .cmp-banda-rango { background:#b58900; }
.cmp-banda-med { position:absolute; top:-3px; width:2px; height:22px;
                 background:#1e5738; }
.cmp-banda-cruza .cmp-banda-med { background:#7a5c00; }
/* el umbral de decision: la referencia contra la que se lee todo lo demas */
.cmp-banda-umbral { position:absolute; top:-6px; width:2px; height:28px;
                    background:#a33a3a; }
.cmp-banda-umbral::after { content:"umbral 80%"; position:absolute; top:-14px;
  left:-26px; font-size:.62em; color:#a33a3a; white-space:nowrap; font-weight:700; }
.cmp-banda-pies { display:flex; justify-content:space-between; font-size:.72em;
                  color:#6b7d76; margin-top:8px; }
.cmp-banda-medlbl { font-weight:700; color:#2b3a33; }
.cmp-banda-nota { font-size:.78em; color:#6b7d76; line-height:1.5; margin-top:8px; }

/* Franja de encabezado de cada formato: dice en una linea que es lo que decide
   el instrumento, antes de que el usuario empiece a llenar campos. */
.p3-clave { background:#f4f9f6; border-left:4px solid #2e7d52;
            border-radius:0 8px 8px 0; padding:10px 14px; margin-bottom:14px;
            font-size:.9em; color:#2b3a33; line-height:1.6; }
.p3-sec { flex-wrap:wrap; }
.p3-sec .btn { min-width:200px; }

/* Pares de dimensiones del eje 3 (phi simulado, umbral de fusion 0.65) */
.cmp-pares { width: 100%; border-collapse: collapse; margin: 4px 0 2px; font-size: 13.5px; }
.cmp-pares td { padding: 4px 8px; border-bottom: 1px solid #eef1f4; }
.cmp-pares tr.cmp-par-alto td { background: #fff8e1; color: #7a5c00; }

/* --- Progreso de una corrida en segundo plano, como hitos ---------------- */
.cmp-prog { background: #f7faf8; border: 1px solid #d8e6dd; border-left: 6px solid #1E8449;
  border-radius: 8px; padding: 14px 18px 12px; margin-bottom: 10px; }
.cmp-prog-tit { font-weight: 700; font-size: 15px; color: #17603a; margin-bottom: 12px; }
.cmp-prog-hitos { display: flex; align-items: flex-start; gap: 0; margin: 0 4px 14px; }
.cmp-hito { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto;
  width: 108px; text-align: center; }
.cmp-hito-punto { width: 24px; height: 24px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: #fff; background: #c9d2cc; margin-bottom: 6px; flex-shrink: 0; }
.cmp-hito-nom { font-size: 13px; font-weight: 600; color: #8a938c; line-height: 1.2; }
.cmp-hito-sub { font-size: 11.5px; color: #a3aba5; margin-top: 2px; }
.cmp-hito.hecho  .cmp-hito-punto { background: #1E8449; }
.cmp-hito.hecho  .cmp-hito-nom   { color: #3d4a42; }
.cmp-hito.hecho  .cmp-hito-sub   { color: #1E8449; }
.cmp-hito.activo .cmp-hito-punto { background: #1E8449; box-shadow: 0 0 0 0 rgba(30,132,73,.55);
  animation: cmp-pulso 1.6s ease-out infinite; }
.cmp-hito.activo .cmp-hito-nom   { color: #17603a; font-weight: 700; }
.cmp-hito.activo .cmp-hito-sub   { color: #1E8449; font-weight: 600; }
@keyframes cmp-pulso {
  0%   { box-shadow: 0 0 0 0   rgba(30,132,73,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(30,132,73,0); }
  100% { box-shadow: 0 0 0 0   rgba(30,132,73,0); }
}
.cmp-hito-linea { flex: 1 1 auto; height: 3px; background: #dfe6e1; border-radius: 2px;
  margin-top: 10.5px; min-width: 18px; }
.cmp-hito-linea.hecha { background: #1E8449; }
.cmp-prog-barra { height: 7px; background: #e6ece8; border-radius: 4px; overflow: hidden; }
.cmp-prog-relleno { height: 100%; background: linear-gradient(90deg,#1E8449,#43a06b);
  border-radius: 4px; transition: width .6s ease; }
.cmp-prog-pie { display: flex; align-items: center; gap: 12px; margin-top: 9px;
  font-size: 12.5px; color: #5c6b73; }
.cmp-prog-pie .cmp-prog-nota { flex: 1 1 auto; opacity: .8; }
@media (max-width: 620px) {
  .cmp-hito { width: 74px; }
  .cmp-hito-nom { font-size: 12px; }
}

/* Sello de procedencia del resultado (navegador vs computadora del usuario) */
.cmp-sello { font-size: 13px; padding: 7px 14px; border-radius: 7px 7px 0 0;
  margin-bottom: -2px; border: 1px solid; border-bottom: none; }
.cmp-sello-web { background: #eef3f7; border-color: #d6e2ec; color: #3d5a70; }
.cmp-sello-pc  { background: #eef7f1; border-color: #cfe6d8; color: #1e5738; }

/* ---------------------------------------------------------------------------
   "Es aqui": el boton que toca pulsar cuando se vuelve desde el refinamiento.
   Sin esta marca el usuario aterriza en el Paso 5b, ve resultados (los VIEJOS)
   y no tiene motivo para pulsar nada. El latido para al posar el raton, para
   no molestar mientras se lee.
--------------------------------------------------------------------------- */
/* Triple clase a proposito: paleta_sobria.css fija .btn.btn-primary con
   !important y se carga DESPUES, asi que .cmp-btn-toca a secas perdia y el
   boton seguia verde (el latido si se veia, el color no). */
.btn.btn-primary.cmp-btn-toca,
.btn.btn-success.cmp-btn-toca,
.btn.cmp-btn-toca,
.cmp-btn-toca {
  background: #d68910 !important;
  border-color: #b9770e !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(214, 137, 16, .7);
  animation: cmpLatido 1.9s ease-out infinite;
}
.btn.btn-primary.cmp-btn-toca:hover, .btn.cmp-btn-toca:hover,
.cmp-btn-toca:hover { animation: none; background: #b9770e !important;
  border-color: #935b0b !important; }
@keyframes cmpLatido {
  0%   { box-shadow: 0 0 0 0    rgba(214, 137, 16, .7); }
  70%  { box-shadow: 0 0 0 12px rgba(214, 137, 16, 0);  }
  100% { box-shadow: 0 0 0 0    rgba(214, 137, 16, 0);  }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-btn-toca { animation: none; box-shadow: 0 0 0 3px rgba(214,137,16,.45); }
}
