/* Extraido de application/modules/homepage/views/app_chat.php (bloque <style> inline original) */
    .awx-topbar-action {
        appearance: none;
        border: 0;
        background: transparent;
        font: inherit;
        cursor: pointer;
    }

    .awx-history-reset {
        display: inline-flex;
        align-items: center;
        gap: .45rem;
        min-height: 34px;
        padding: .45rem .7rem;
        border: 1px solid rgba(180, 35, 35, .18);
        border-radius: 999px;
        background: rgba(180, 35, 35, .06);
        color: inherit;
        transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
    }

    .awx-history-reset:hover,
    .awx-history-reset:focus-visible {
        transform: translateY(-1px);
        background: rgba(180, 35, 35, .1);
        border-color: rgba(180, 35, 35, .3);
        outline: none;
    }

    .awx-history-reset:disabled {
        opacity: .55;
        cursor: not-allowed;
        transform: none;
    }

    .awx-agent-avatar.is-active,
    .awx-msg-row.is-auto-trigger .awx-msg-avatar {
        animation: awxAgentPulse 1.8s ease-in-out infinite;
    }

    .awx-stage-bubble {
        position: relative;
        overflow: hidden;
    }

    .awx-stage-bubble::after {
        content: "";
        position: absolute;
        inset: auto 0 0;
        height: 2px;
        background: currentColor;
        opacity: .14;
        transform-origin: left center;
        animation: awxStageProgress 2.4s ease-in-out infinite;
    }

    .awx-auto-idle {
        display: flex;
        align-items: center;
        gap: .6rem;
        min-height: 28px;
    }

    .awx-auto-idle-dot {
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
        border-radius: 50%;
        background: currentColor;
        opacity: .7;
        animation: awxIdleDot 1.5s ease-in-out infinite;
    }

    .awx-auto-idle-copy {
        min-width: 0;
        transition: opacity .2s ease, transform .2s ease;
    }

    .awx-auto-idle-copy.is-changing {
        opacity: .35;
        transform: translateY(2px);
    }

    .awx-msg-row.is-entering {
        animation: awxMessageEnter .28s ease-out both;
    }

    @keyframes awxAgentPulse {
        0%, 100% {
            transform: scale(1);
            filter: none;
        }
        50% {
            transform: scale(1.045);
            filter: brightness(1.08);
        }
    }

    @keyframes awxIdleDot {
        0%, 100% {
            transform: scale(.82);
            opacity: .45;
        }
        50% {
            transform: scale(1.18);
            opacity: .95;
        }
    }

    @keyframes awxStageProgress {
        0% {
            transform: scaleX(.08);
            opacity: .05;
        }
        50% {
            transform: scaleX(.72);
            opacity: .16;
        }
        100% {
            transform: scaleX(1);
            opacity: .04;
        }
    }

    @keyframes awxMessageEnter {
        from {
            opacity: 0;
            transform: translateY(7px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .awx-agent-avatar.is-active,
        .awx-msg-row.is-auto-trigger .awx-msg-avatar,
        .awx-stage-bubble::after,
        .awx-auto-idle-dot,
        .awx-msg-row.is-entering {
            animation: none !important;
        }

        .awx-history-reset,
        .awx-auto-idle-copy {
            transition: none !important;
        }
    }

    /* Respuestas enriquecidas: enlaces, CTA, listas, tablas y datos estructurados */
    .awx-rich-content {
        display: grid;
        gap: .7rem;
        min-width: 0;
    }

    .awx-rich-paragraph,
    .awx-rich-quote {
        margin: 0;
        overflow-wrap: anywhere;
    }

    .awx-rich-heading {
        margin: .2rem 0 0;
        line-height: 1.3;
        font-weight: 700;
    }

    .awx-rich-heading[data-level="1"],
    .awx-rich-heading[data-level="2"] {
        font-size: 1.05rem;
    }

    .awx-rich-heading[data-level="3"],
    .awx-rich-heading[data-level="4"] {
        font-size: .98rem;
    }

    .awx-rich-list {
        margin: 0;
        padding-left: 1.35rem;
        display: grid;
        gap: .35rem;
    }

    .awx-rich-list li {
        padding-left: .15rem;
        overflow-wrap: anywhere;
    }

    .awx-rich-quote {
        padding: .65rem .8rem;
        border-left: 3px solid currentColor;
        background: rgba(127, 127, 127, .08);
        border-radius: .55rem;
    }

    .awx-rich-code {
        margin: 0;
        padding: .8rem;
        overflow-x: auto;
        border-radius: .65rem;
        background: rgba(20, 25, 35, .08);
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
        font-size: .86rem;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .awx-rich-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        border: 1px solid rgba(127, 127, 127, .22);
        border-radius: .75rem;
        -webkit-overflow-scrolling: touch;
    }

    .awx-rich-table {
        width: 100%;
        min-width: 420px;
        border-collapse: collapse;
        font-size: .9rem;
    }

    .awx-rich-table th,
    .awx-rich-table td {
        padding: .62rem .7rem;
        text-align: left;
        vertical-align: top;
        border-bottom: 1px solid rgba(127, 127, 127, .16);
        overflow-wrap: anywhere;
    }

    .awx-rich-table th {
        font-weight: 700;
        background: rgba(127, 127, 127, .08);
    }

    .awx-rich-table tr:last-child td {
        border-bottom: 0;
    }

    .awx-rich-kv-key {
        width: 34%;
        min-width: 125px;
        font-weight: 700;
    }

    .awx-inline-link {
        text-decoration: underline;
        text-underline-offset: 2px;
        overflow-wrap: anywhere;
    }

    .awx-cta-block {
        display: grid;
        gap: .5rem;
        margin-top: .2rem;
    }

    .awx-cta-title {
        font-size: .8rem;
        font-weight: 700;
        opacity: .78;
        text-transform: uppercase;
        letter-spacing: .035em;
    }

    .awx-cta-actions {
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .awx-cta-link {
        display: inline-flex;
        align-items: center;
        gap: .48rem;
        min-height: 40px;
        max-width: 100%;
        padding: .58rem .78rem;
        border: 1px solid rgba(35, 105, 190, .25);
        border-radius: .7rem;
        background: rgba(35, 105, 190, .08);
        color: inherit;
        text-decoration: none;
        font-weight: 650;
        line-height: 1.25;
        transition: transform .16s ease, background-color .16s ease, border-color .16s ease;
    }

    .awx-cta-link:hover,
    .awx-cta-link:focus-visible {
        transform: translateY(-1px);
        background: rgba(35, 105, 190, .14);
        border-color: rgba(35, 105, 190, .38);
        outline: none;
        text-decoration: none;
    }

    .awx-cta-link-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .awx-cta-link-host {
        font-size: .72rem;
        opacity: .62;
        font-weight: 500;
    }

    .awx-data-block {
        display: grid;
        gap: .5rem;
        margin-top: .15rem;
    }

    .awx-data-title {
        font-size: .8rem;
        font-weight: 700;
        opacity: .78;
    }

    @media (max-width: 640px) {
        .awx-cta-actions {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
        }

        .awx-cta-link {
            width: 100%;
            justify-content: flex-start;
        }

        .awx-rich-table {
            min-width: 520px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .awx-cta-link {
            transition: none !important;
        }
    }


    /* Navegación conversacional: opciones numéricas como acciones táctiles */
    .awx-bubble-options {
        display: grid;
        gap: .55rem;
        margin-top: .25rem;
    }

    .awx-bubble-options .awx-bubble-section-title {
        font-size: .78rem;
        font-weight: 700;
        letter-spacing: .025em;
        opacity: .72;
    }

    .awx-inline-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
    }

    .awx-inline-action-btn {
        width: 100%;
        min-height: 46px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: .65rem;
        padding: .62rem .72rem;
        border: 1px solid rgba(32, 120, 190, .2);
        border-radius: .85rem;
        background: rgba(33, 150, 243, .055);
        color: inherit;
        text-align: left;
        line-height: 1.25;
        cursor: pointer;
        transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
    }

    .awx-inline-action-btn:hover,
    .awx-inline-action-btn:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(32, 120, 190, .42);
        background: rgba(33, 150, 243, .1);
        box-shadow: 0 8px 18px rgba(18, 70, 110, .08);
        outline: none;
    }

    .awx-inline-action-btn:disabled {
        cursor: default;
        opacity: .54;
        transform: none;
        box-shadow: none;
    }

    .awx-inline-action-btn.is-selected {
        opacity: 1;
        border-color: rgba(26, 115, 185, .48);
        background: rgba(33, 150, 243, .14);
    }

    .awx-choice-index {
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(24, 126, 197, .11);
        font-size: .78rem;
        font-weight: 800;
        color: #1672b5;
    }

    .awx-choice-label {
        min-width: 0;
        font-weight: 650;
        overflow-wrap: anywhere;
    }

    .awx-choice-arrow {
        font-size: .72rem;
        opacity: .42;
    }

    /* La acción destructiva pertenece al contexto de conversación, no a la navegación global. */
    .awx-history-reset-composer {
        min-height: 30px;
        padding: .28rem .58rem;
        font-size: .78rem;
        background: transparent;
    }

    .awx-history-reset-composer.is-confirming {
        border-color: rgba(190, 45, 45, .42);
        background: rgba(190, 45, 45, .1);
    }

    .awx-composer-meta,
    .awx-meta-right {
        flex-wrap: wrap;
    }

    /* Fallback visual si Bootstrap Notify todavía no fue cargado por el layout. */
    .awx-notify-host {
        position: fixed;
        top: 1rem;
        right: 1rem;
        z-index: 10950;
        width: min(360px, calc(100vw - 2rem));
        display: grid;
        gap: .55rem;
        pointer-events: none;
    }

    .awx-notify-fallback {
        margin: 0;
        box-shadow: 0 12px 30px rgba(15, 30, 45, .14);
        pointer-events: auto;
    }

    @media (max-width: 720px) {
        .awx-inline-actions {
            grid-template-columns: minmax(0, 1fr);
        }

        .awx-history-reset-composer span {
            display: none;
        }

        .awx-history-reset-composer {
            width: 30px;
            padding: 0;
            justify-content: center;
            border-radius: 50%;
        }
    }
