/* ==========================================================================
   Oompa Loompa · MyVy Tech
   Paleta de marca: azul MyVy Tech (#285697) y azul claro (#93a7cc),
   extraídos directamente del logo, sobre fondo azul-marino y blanco.
   Tipografía display redondeada + utilitaria para dar personalidad sin
   caer en el look genérico de IA.
   ========================================================================== */

:root {
    --navy-950: #16233d;
    --navy-900: #1d3f6b;
    --brand-blue: #285697;
    --brand-blue-light: #93a7cc;
    --brand-blue-light-dark: #7688b0;
    --sky-50: #f4f7fb;
    --sky-100: #e8edf6;
    --status-green: #16a34a;
    --ink: #17233a;
    --line: rgba(23, 35, 58, 0.14);
    --radius-lg: 22px;
    --radius-md: 14px;
    --font-display: 'Baloo 2', system-ui, sans-serif;
    --font-body: 'Work Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(circle at 12% -10%, rgba(147, 167, 204, 0.30), transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(40, 86, 151, 0.35), transparent 40%),
        var(--navy-950);
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    min-height: 100vh;
}

/* --------------------------- Panel de marca --------------------------- */

.brand-panel {
    background: linear-gradient(165deg, var(--navy-900), var(--navy-950) 70%);
    color: var(--sky-50);
    padding: 44px 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    /* En la v2.4.0 este panel creció (ticket destacado + 5 capacidades), así
       que ya no puede quedarse en overflow:hidden: en pantallas bajas el
       contenido de abajo quedaría cortado y sin forma de alcanzarlo.
       Se permite desplazamiento vertical y se recorta solo lo horizontal. */
    overflow-x: hidden;
    overflow-y: auto;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: 24px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(147, 167, 204, 0.30), transparent 70%);
    pointer-events: none;
}

.brand-mark {
    display: flex;
    align-items: center;
}

.brand-logo-plate {
    background: var(--sky-50);
    border-radius: 12px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    display: block;
}

.eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--brand-blue-light);
    margin: 0 0 8px;
}

.agent-intro h1 {
    font-family: var(--font-display);
    font-size: 34px;
    line-height: 1.1;
    margin: 0 0 10px;
}

.agent-intro h1 span {
    color: var(--brand-blue-light);
}

.agent-intro p {
    margin: 0;
    color: rgba(244, 247, 251, 0.78);
    font-size: 15px;
    line-height: 1.55;
}

.capabilities {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.capability-ticket {
    background: rgba(244, 247, 251, 0.06);
    border: 1px solid rgba(244, 247, 251, 0.14);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.capability-ticket .icon {
    font-size: 20px;
    line-height: 1;
}

.capability-ticket strong {
    display: block;
    font-family: var(--font-display);
    font-size: 14px;
    margin-bottom: 3px;
    color: var(--sky-50);
}

.capability-ticket span {
    font-size: 13px;
    color: rgba(244, 247, 251, 0.68);
    line-height: 1.4;
}

.brand-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px dashed rgba(244, 247, 251, 0.2);
    font-size: 12px;
    color: rgba(244, 247, 251, 0.55);
    line-height: 1.6;
}

.brand-footer a { color: var(--brand-blue-light); text-decoration: none; }
.brand-footer a:hover { text-decoration: underline; }

/* --------------------------- Panel de chat --------------------------- */

.chat-panel {
    background: var(--sky-50);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    border-bottom: 1px solid var(--line);
    background: var(--sky-50);
}

.chat-header .who {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-950));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sky-50);
    font-family: var(--font-display);
    font-size: 17px;
}

.chat-header .who strong {
    font-family: var(--font-display);
    font-size: 15px;
    display: block;
}

.chat-header .who .status {
    font-size: 12px;
    color: var(--status-green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header .who .status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--status-green);
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.reset-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.reset-btn:hover { background: rgba(40, 86, 151, 0.08); border-color: var(--brand-blue); }
.reset-btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.agent { justify-content: flex-start; }

.msg-bubble {
    max-width: 70%;
    padding: 13px 16px;
    font-size: 14.5px;
    line-height: 1.55;
    word-wrap: break-word;
    position: relative;
}

/* El mensaje del usuario conserva saltos de línea tal cual los escribió;
   el del agente ahora se estructura con <p>/<br> propios (ver chat.js),
   así que no necesita pre-wrap. */
.msg-row.user .msg-bubble { white-space: pre-wrap; }
.msg-row.agent .msg-bubble { white-space: normal; }

/* Una tabla (calendario de contenido) necesita más espacio que un texto
   normal — si el navegador soporta :has(), la burbuja se ensancha sola. */
.msg-row.agent .msg-bubble:has(.md-table) {
    max-width: 92%;
}

/* Firma visual: burbujas con forma de "ticket de receta" (esquina cortada) */
.msg-row.agent .msg-bubble {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
    color: var(--ink);
}

.msg-row.user .msg-bubble {
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-900));
    color: #ffffff;
    border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
    font-weight: 500;
}

/* Formato enriquecido dentro de las burbujas del agente (Markdown-lite) */
.msg-body p { margin: 0 0 10px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body ul, .msg-body ol { margin: 0 0 10px 20px; padding: 0; }
.msg-body li { margin-bottom: 4px; }
.msg-body h3, .msg-body h4 {
    font-family: var(--font-display);
    margin: 14px 0 6px;
    line-height: 1.3;
}
.msg-body h3:first-child, .msg-body h4:first-child { margin-top: 0; }
.msg-body code {
    background: rgba(23, 35, 58, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.92em;
}
.msg-body strong { font-weight: 700; }

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 4px 0 10px;
    max-width: 100%;
}
.msg-attachment {
    display: block;
    max-width: 100%;
    max-height: 180px;
    border-radius: 10px;
    margin-bottom: 8px;
    object-fit: cover;
}

.msg-attachment-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12.5px;
}

.msg-row.agent .msg-attachment-chip {
    background: var(--sky-100);
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 13px;
}
.md-table th, .md-table td {
    border: 1px solid var(--line);
    padding: 7px 9px;
    text-align: left;
    vertical-align: top;
}
.md-table th {
    background: rgba(23, 35, 58, 0.05);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12.5px;
}
.md-table tr:nth-child(even) td { background: rgba(23, 35, 58, 0.02); }

/* ---------------------------------------------------------------------------
   Bloque de código (el HTML del correo, y cualquier otro código)
   Se ve como un editor: barra con el lenguaje + acciones, y el código en su
   propio scroll. Un correo HTML pesa decenas de KB, así que el bloque NO
   puede crecer sin control y empujar el chat — de ahí el max-height.
   --------------------------------------------------------------------------- */
.msg-row.agent .msg-bubble:has(.code-block) { max-width: 96%; }

.code-block {
    margin: 12px 0;
    border: 1px solid rgba(23, 35, 58, 0.25);
    border-radius: 10px;
    overflow: hidden;
    background: var(--navy-950);
}

.code-block-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px 7px 13px;
    background: rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-lang {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--brand-blue-light);
}

.code-warn { font-size: 11px; line-height: 1.2; color: #ffcf8a; }

.code-block-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.code-btn {
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border: 1px solid rgba(147, 167, 204, 0.45);
    border-radius: 999px;
    background: transparent;
    color: var(--sky-100);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.code-btn:hover { background: rgba(147, 167, 204, 0.18); border-color: var(--brand-blue-light); }
.code-btn:focus-visible { outline: 2px solid var(--brand-blue-light); outline-offset: 2px; }
.code-btn.is-done { background: rgba(22, 163, 74, 0.28); border-color: var(--status-green); color: #d6f5e0; }
.code-btn.is-error { background: rgba(217, 98, 43, 0.28); border-color: #d9622b; color: #ffd9c7; }

.code-pre {
    margin: 0;
    padding: 12px 14px;
    max-height: 420px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.55;
    color: #dbe4f0;
    white-space: pre;
    tab-size: 2;
}

/* Anula el estilo de <code> en línea que se aplica dentro de las burbujas:
   aquí el código va en bloque, sin fondo ni padding propios. */
.code-pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre;
}

/* Bloque que no cerró: casi siempre significa respuesta truncada. */
.code-block-truncated { border-color: rgba(217, 98, 43, 0.65); }

.msg-meta {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-blue);
    margin-bottom: 4px;
    font-weight: 600;
}

.msg-row.user .msg-meta { color: rgba(255, 255, 255, 0.75); text-align: right; }

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-blue);
    animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 32px 16px;
}

.chip {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 12.5px;
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.chip:hover { border-color: var(--brand-blue); transform: translateY(-1px); }
.chip:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.attach-btn {
    border: none;
    background: transparent;
    color: var(--brand-blue);
    font-size: 19px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.attach-btn:hover { background: rgba(40, 86, 151, 0.08); }
.attach-btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.attachment-preview {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 0 32px 12px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.attachment-preview.visible { display: flex; }

.attachment-preview .thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--sky-100);
    flex-shrink: 0;
}

.attachment-preview .file-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--sky-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.attachment-preview .info {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    color: var(--ink);
}

.attachment-preview .info strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-preview .remove-attachment {
    border: none;
    background: transparent;
    color: rgba(23, 35, 58, 0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}

.attachment-preview .remove-attachment:hover { color: #a13a1c; }

.chat-input-bar {
    border-top: 1px solid var(--line);
    padding: 18px 32px 24px;
    background: var(--sky-50);
}

.chat-form {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 10px;
}

.chat-form:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(40, 86, 151, 0.12); }

#message-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.5;
    padding: 10px 0;
    max-height: 140px;
    background: transparent;
    color: var(--ink);
}

#message-input::placeholder { color: rgba(23, 35, 58, 0.4); }

.send-btn {
    border: none;
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-900));
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(40, 86, 151, 0.3); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.send-btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.input-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 4px 0;
}

.attach-hint {
    font-size: 11px;
    color: rgba(23, 35, 58, 0.45);
}

.char-counter {
    font-size: 11px;
    color: rgba(23, 35, 58, 0.45);
    text-align: right;
    flex-shrink: 0;
}

.inline-error {
    font-size: 12.5px;
    color: #a13a1c;
    background: rgba(161, 58, 28, 0.1);
    border: 1px solid rgba(161, 58, 28, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 32px 12px;
    display: none;
}

.inline-error.visible { display: block; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-pill {
    font-size: 12.5px;
    color: var(--brand-blue);
    background: rgba(40, 86, 151, 0.08);
    border: 1px solid rgba(40, 86, 151, 0.25);
    padding: 7px 13px;
    border-radius: 999px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------- Gate de identificación --------------------------- */

.gate-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.gate-card {
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 16px 40px rgba(23, 35, 58, 0.08);
}

.gate-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 6px;
}

.gate-card h2 {
    font-family: var(--font-display);
    font-size: 21px;
    margin: 0;
}

.gate-card > p {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: rgba(23, 35, 58, 0.65);
    line-height: 1.5;
}

.gate-card label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    margin-top: 4px;
}

.gate-card input[type="text"],
.gate-card input[type="email"] {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--ink);
}

.gate-card input[type="text"]:focus,
.gate-card input[type="email"]:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(40, 86, 151, 0.12);
}

.gate-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    font-weight: 400;
    color: rgba(23, 35, 58, 0.7);
    line-height: 1.45;
    margin-top: 6px;
}

.gate-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.gate-card .inline-error {
    margin: 4px 0 0;
}

#gate-submit {
    margin-top: 10px;
    border: none;
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-900));
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14.5px;
    padding: 13px;
    border-radius: 12px;
    cursor: pointer;
}

#gate-submit:hover:not(:disabled) { filter: brightness(1.04); }
#gate-submit:disabled { opacity: 0.6; cursor: not-allowed; }
#gate-submit:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* ===========================================================================
   v2.4.0 · Marca, atajos guiados, entrevista y Kit
   =========================================================================== */

/* --- Marca (MyVy Tech / Victor J. Medina) --- */
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-blue-light);
    margin: 0 0 8px;
}

.brand-footer-marca {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--sky-50);
    letter-spacing: 0.2px;
}

.brand-footer-dev { margin-top: 2px; }
.brand-footer-dev strong { color: var(--brand-blue-light); }

/* Ticket resaltado: las dos formas de llevarse el resultado. */
.capability-ticket-destacado {
    background: linear-gradient(135deg, rgba(232, 163, 61, 0.16), rgba(217, 98, 43, 0.10));
    border-color: rgba(232, 163, 61, 0.45);
}

.capability-ticket-destacado b { color: #ffd9a8; font-weight: 600; }

/* --- Atajos guiados: los lanzadores de la entrevista --- */
.atajos-guiados { padding: 0 32px 14px; }

.atajos-titulo {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(23, 35, 58, 0.55);
}

.atajos-botones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.atajo {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    padding: 14px 16px;
    border: 1px solid rgba(40, 86, 151, 0.28);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff, var(--sky-100));
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.atajo:hover {
    border-color: var(--brand-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 35, 61, 0.14);
}

.atajo:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.atajo-icono { font-size: 24px; line-height: 1; }
.atajo-texto { display: flex; flex-direction: column; gap: 3px; }
.atajo-texto strong { font-family: var(--font-display); font-size: 15px; }
.atajo-texto span { font-size: 12px; color: rgba(23, 35, 58, 0.68); line-height: 1.45; }

/* --- Panel de la entrevista guiada --- */
.entrevista-panel {
    margin: 0 32px 14px;
    border: 1px solid rgba(40, 86, 151, 0.3);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(22, 35, 61, 0.16);
    overflow: hidden;
}

.entrevista-panel[hidden] { display: none; }

.entrevista-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--navy-900), var(--brand-blue));
    color: #ffffff;
}

.entrevista-head-titulo { display: flex; align-items: center; gap: 9px; }
.entrevista-icono { font-size: 18px; }
.entrevista-head strong { font-family: var(--font-display); font-size: 15px; }

.entrevista-panel .reset-btn {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.entrevista-progreso {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px 0;
}

.entrevista-progreso-barra {
    flex: 1;
    height: 5px;
    border-radius: 999px;
    background: var(--sky-100);
    overflow: hidden;
}

.entrevista-progreso-barra span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-light));
    transition: width 0.25s ease;
}

.entrevista-paso {
    font-size: 11px;
    font-weight: 600;
    color: rgba(23, 35, 58, 0.55);
    white-space: nowrap;
}

.entrevista-cuerpo { padding: 14px 18px 4px; }

.entrevista-cuerpo h3 {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.35;
    color: var(--ink);
}

.entrevista-ayuda {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(23, 35, 58, 0.62);
}

.entrevista-opciones { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.entrevista-opcion {
    border: 1px solid rgba(40, 86, 151, 0.3);
    background: var(--sky-50);
    color: var(--ink);
    font-size: 13px;
    padding: 9px 15px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.entrevista-opcion:hover { border-color: var(--brand-blue); background: var(--sky-100); transform: translateY(-1px); }
.entrevista-opcion:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.entrevista-opcion.is-selected {
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-900));
    border-color: var(--brand-blue);
    color: #ffffff;
    font-weight: 600;
}

.entrevista-campo {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--ink);
    margin-bottom: 10px;
    resize: vertical;
}

.entrevista-campo:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(40, 86, 151, 0.14); }

.entrevista-aviso {
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(217, 98, 43, 0.1);
    border: 1px solid rgba(217, 98, 43, 0.3);
    color: #a13a1c;
    font-size: 12.5px;
}

.entrevista-aviso[hidden] { display: none; }

/* Elección de modo: Kit .md o Listo para usar */
.entrevista-modos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }

.entrevista-modo {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    text-align: left;
    padding: 15px 17px;
    border: 1px solid rgba(40, 86, 151, 0.3);
    border-radius: var(--radius-md);
    background: var(--sky-50);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.entrevista-modo:hover {
    border-color: var(--brand-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(22, 35, 61, 0.12);
}

.entrevista-modo:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.entrevista-modo-icono { font-size: 26px; line-height: 1; }
.entrevista-modo-cuerpo { display: flex; flex-direction: column; gap: 4px; }
.entrevista-modo-cuerpo strong { font-family: var(--font-display); font-size: 15.5px; }
.entrevista-modo-cuerpo span { font-size: 12.5px; line-height: 1.5; color: rgba(23, 35, 58, 0.68); }

.entrevista-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--line);
    margin-top: 10px;
}

.entrevista-pie .chip[hidden] { display: none; }
.entrevista-pie .chip:disabled { opacity: 0.45; cursor: not-allowed; }
.chip-decide { border-style: dashed; }
.chip-continuar { border-color: var(--brand-blue); color: var(--brand-blue); font-weight: 600; }

.entrevista-generar {
    margin-left: auto;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-blue), var(--navy-900));
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.entrevista-generar:hover { filter: brightness(1.1); transform: translateY(-1px); }
.entrevista-generar:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.entrevista-generar[hidden] { display: none; }

/* --- Burbuja de bienvenida con instrucciones --- */
.msg-bubble-guia { background: linear-gradient(135deg, #ffffff, var(--sky-50)); }
.msg-nota { font-size: 12.5px; color: rgba(23, 35, 58, 0.68); margin-top: 8px; }
.msg-bubble-guia ul { margin: 8px 0 0 18px; padding: 0; }
.msg-bubble-guia li { margin-bottom: 6px; }

.quick-chips-label {
    align-self: center;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(23, 35, 58, 0.5);
    margin-right: 2px;
}

/* ===========================================================================
   v2.5.0 · Muestras de marca (varias por envío)
   =========================================================================== */

/* El contenedor del chat pasa de una fila única a una lista vertical: ahora
   puede haber hasta MAX_ATTACHMENTS_COUNT muestras, cada una con su botón
   de quitar. */
.attachment-preview {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.attachment-total {
    font-size: 11.5px;
    color: rgba(23, 35, 58, 0.55);
    text-align: right;
    border-top: 1px dashed var(--line);
    padding-top: 6px;
}

/* --- Paso de muestras dentro de la entrevista --- */
.muestras-sugerencias {
    margin-bottom: 14px;
    border: 1px solid rgba(40, 86, 151, 0.22);
    border-radius: var(--radius-md);
    background: var(--sky-50);
    padding: 10px 14px;
}

.muestras-sugerencias summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-900);
}

.muestras-sugerencias ul {
    margin: 9px 0 2px 18px;
    padding: 0;
    font-size: 12.5px;
    color: rgba(23, 35, 58, 0.72);
    line-height: 1.55;
}

.muestras-sugerencias li { margin-bottom: 3px; }

.muestras-subir {
    width: 100%;
    padding: 13px 16px;
    border: 1px dashed rgba(40, 86, 151, 0.45);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #ffffff, var(--sky-100));
    color: var(--navy-900);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.muestras-subir:hover { border-color: var(--brand-blue); transform: translateY(-1px); }
.muestras-subir:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

.muestras-lista {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.muestra-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    font-size: 12.5px;
    min-width: 0;
}

.muestra-icono { font-size: 15px; flex-shrink: 0; }

.muestra-nombre {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.muestra-peso { color: rgba(23, 35, 58, 0.5); flex-shrink: 0; font-size: 11.5px; }

.muestra-chip .remove-attachment {
    border: none;
    background: transparent;
    color: rgba(23, 35, 58, 0.5);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 7px;
    flex-shrink: 0;
}

.muestra-chip .remove-attachment:hover { color: #a13a1c; }

.muestras-nota {
    margin: 10px 0 4px;
    font-size: 11.5px;
    color: rgba(23, 35, 58, 0.55);
    line-height: 1.5;
}

/* --------------------------- Responsive --------------------------- */
@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .brand-panel { padding: 28px 22px; }
    .agent-intro h1 { font-size: 26px; }
    .chat-header, .chat-scroll, .quick-chips, .chat-input-bar, .inline-error { padding-left: 18px; padding-right: 18px; }
    .attachment-preview { margin-left: 18px; margin-right: 18px; }
    .msg-bubble { max-width: 85%; }
    .chat-header { flex-wrap: wrap; row-gap: 10px; }
    .atajos-guiados { padding-left: 18px; padding-right: 18px; }
    .entrevista-panel { margin-left: 18px; margin-right: 18px; }
}

/* En móvil el bloque de código necesita más ancho útil y menos alto:
   el teléfono no tiene espacio para una barra de acciones en una sola fila
   junto al lenguaje, así que la barra se acomoda y el código se desplaza. */
@media (max-width: 640px) {
    .msg-bubble { max-width: 96%; }
    .code-block-head { flex-wrap: wrap; }
    .code-block-actions { margin-left: 0; width: 100%; }
    .code-btn { flex: 1; text-align: center; }
    .code-pre { font-size: 11px; max-height: 300px; padding: 10px; }

    /* La entrevista en el teléfono: opciones a lo ancho (más fáciles de
       tocar con el pulgar) y el pie en dos filas. */
    .atajos-botones { grid-template-columns: 1fr; }
    .entrevista-opciones { flex-direction: column; }
    .entrevista-opcion { width: 100%; text-align: left; }
    .entrevista-pie { padding: 12px 14px 16px; }
    .entrevista-generar { margin-left: 0; width: 100%; }
    .entrevista-cuerpo { padding: 14px 14px 4px; }
}
