/* ============================================================================
   ChatPlus · App del cliente (Opción C · Híbrida: chat con formularios)
   ----------------------------------------------------------------------------
   Mismo diseño que el "Chat del cliente" del backoffice (ChatPlus.Web/wwwroot/css/chat-cliente.css, aprobado),
   a pantalla completa: encabezado noche con el logo, burbujas claras, tarjetas de opciones, formularios dentro del
   chat y tarjeta de éxito. Sin marco de teléfono; áreas seguras (notch de iOS, barras de Android) con env().
   Tamaños para el dedo: botones de al menos 40-44 px y campos de 16 px (iOS no hace zoom al enfocar).
   Solo modo claro: es el diseño aprobado (el encabezado noche ya da el contraste); los colores están en variables
   por si después se agrega un tema oscuro con su propio pase de diseño.
   ============================================================================ */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(fonts/inter-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: light;
    --cc-night: #0d0f16;
    --cc-night-2: #1b1f2a;
    --cc-teal: #0e7489;
    --cc-teal-hover: #0b6274;
    --cc-teal-ink: #0a5d6e;
    --cc-cyan: #29d7eb;
    --cc-seg: #18a3b8;
    --cc-bg: #eef2f6;
    --cc-surface: #ffffff;
    --cc-line: #dbe1e8;
    --cc-ink: #161c28;
    --cc-ink-2: #3a4352;
    --cc-muted: #6b7584;
    --cc-select-bg: #e2f4f7;
    --cc-ok-bg: #ddf3f6;
    --cc-ok-line: #a6dbe3;
    --cc-danger: #c43d3d;
    --cc-favor: #1d8a57;
    --cc-radius: 14px;
    --cc-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --cc-safe-top: env(safe-area-inset-top, 0px);
    --cc-safe-bottom: env(safe-area-inset-bottom, 0px);
    --cc-safe-left: env(safe-area-inset-left, 0px);
    --cc-safe-right: env(safe-area-inset-right, 0px);
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--cc-night);
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

body { font-family: var(--cc-font); color: var(--cc-ink); }

/* MudBlazor trae un reset global de button (inline-flex centrado, sin selección): lo de la app define el suyo. */
.cc-app button { user-select: auto; -webkit-user-select: auto; }

/* Íconos (SVG de Material, ver Chat/Icono.razor). */
.cc-ic { display: inline-block; flex: none; width: 1.15em; height: 1.15em; fill: currentColor; vertical-align: -.2em; }
.me-1 { margin-right: .3rem; }

.cc-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------------- Pantalla ---------------- */

.cc-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    overflow: hidden;
    background: var(--cc-bg);
    color: var(--cc-ink);
    font-family: var(--cc-font);
    font-size: 15px;
    line-height: 1.45;
}

/* En pantallas anchas (PWA en la compu) la app queda como una columna centrada. */
@media (min-width: 700px) {
    .cc-app { box-shadow: 0 0 0 1px #1f2430, 0 30px 60px -20px rgba(0, 0, 0, .5); }
}

.cc-app [hidden] { display: none !important; }

/* ---------------- Encabezado ---------------- */

.cc-header {
    flex: none;
    padding: calc(12px + var(--cc-safe-top)) calc(14px + var(--cc-safe-right)) 12px calc(14px + var(--cc-safe-left));
    background: var(--cc-night);
    color: #fff;
}

.cc-header-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }

.cc-back, .cc-menu-btn {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: var(--cc-night-2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.cc-menu-btn { background: transparent; }
.cc-back:hover, .cc-menu-btn:hover { background: #262b38; }
.cc-back:focus-visible, .cc-menu-btn:focus-visible { outline: 2px solid var(--cc-cyan); outline-offset: 2px; }
.cc-punto { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--cc-danger); box-shadow: 0 0 0 2px var(--cc-night); }

.cc-logo { flex: none; width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.cc-logo--der { margin-left: auto; width: 32px; height: 32px; }

.cc-header-text { min-width: 0; flex: 1; }
.cc-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-subtitle { font-size: 12.5px; color: #a3abba; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cc-progress { display: flex; gap: 5px; margin-top: 12px; }
.cc-progress span { flex: 1; height: 3px; border-radius: 3px; background: #2b303c; transition: background-color .3s ease; }
.cc-progress span.is-on { background: var(--cc-seg); }

/* Franjas bajo el encabezado: datos de prueba y sin conexión. */
.cc-banda {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px calc(14px + var(--cc-safe-right)) 7px calc(14px + var(--cc-safe-left));
    font-size: 12.5px;
    font-weight: 600;
}
.cc-banda--prueba { background: #f6e7f5; color: #87337f; }
.cc-banda--offline { background: #fff3d6; color: #6b4b00; }
.cc-banda--offline span { flex: 1; }
.cc-banda button { min-height: 32px; padding: 0 12px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }

/* Menú de la app (MudMenu). */
.cc-menu .mud-list { padding: 6px 0; }
.cc-menu-item { display: inline-flex; align-items: center; gap: 10px; font-family: var(--cc-font); font-size: 15px; color: var(--cc-ink); }
.cc-menu-item .cc-ic { color: var(--cc-teal); font-size: 18px; }
.cc-menu-version { padding: 8px 16px 6px; border-top: 1px solid #edf1f4; margin-top: 4px; font-family: var(--cc-font); font-size: 12px; color: var(--cc-muted); }
.cc-badge--menu { position: static; margin-left: 4px; }

/* ---------------- Cuerpo ---------------- */

.cc-body { position: relative; flex: 1; min-height: 0; }

.cc-chat, .cc-vista {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px calc(14px + var(--cc-safe-right)) 18px calc(14px + var(--cc-safe-left));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.cc-chat { display: flex; flex-direction: column; gap: 10px; }
.cc-vista { display: flex; flex-direction: column; gap: 10px; }

/* Fila del asistente: avatar + contenido */
.cc-bot { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; animation: cc-in .22s ease-out both; }
.cc-bot > .cc-avatar { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.cc-bot.cc-cont > .cc-avatar { visibility: hidden; }
.cc-stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.cc-bubble {
    justify-self: start;
    max-width: 100%;
    padding: 11px 14px;
    border-radius: var(--cc-radius);
    background: var(--cc-surface);
    color: var(--cc-ink);
    box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
    overflow-wrap: anywhere;
}
.cc-bubble strong { font-weight: 700; }
.cc-bubble .cc-ayuda { display: block; margin-top: 4px; color: var(--cc-muted); font-size: 13px; }
.cc-bubble a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }

.cc-user {
    align-self: flex-end;
    max-width: 82%;
    padding: 9px 14px;
    border-radius: 18px;
    background: var(--cc-teal);
    color: #fff;
    font-size: 14.5px;
    overflow-wrap: anywhere;
    animation: cc-in .18s ease-out both;
}
.cc-user a { color: #fff; }
.cc-user--foto { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 14px; background: var(--cc-night-2); }
.cc-user--foto img { width: 60px; height: 60px; border-radius: 9px; object-fit: cover; }
.cc-user--foto span { font-size: 12.5px; color: #c7cdd8; padding-right: 6px; overflow-wrap: anywhere; }

@keyframes cc-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* Escribiendo… */
.cc-typing { display: inline-flex; gap: 4px; padding: 14px 15px; }
.cc-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b2; animation: cc-dot 1s infinite ease-in-out; }
.cc-typing i:nth-child(2) { animation-delay: .15s; }
.cc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cc-dot {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.cc-spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid #c9d3dd; border-top-color: var(--cc-teal); border-radius: 50%; animation: cc-giro .8s linear infinite; }
@keyframes cc-giro { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .cc-bot, .cc-user, .cc-agt, .cc-sis { animation: none; }
}

/* ---------------- Tarjetas (menú) ---------------- */

.cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

.cc-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    min-height: 88px;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    background: var(--cc-surface);
    color: var(--cc-ink);
    text-align: left;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
    cursor: pointer;
    transition: background-color .15s ease, transform .1s ease;
}
.cc-tile .cc-ic { font-size: 19px; color: var(--cc-teal); }
.cc-tile:hover:not(:disabled) { background: #f6fafb; }
.cc-tile:active:not(:disabled) { transform: scale(.98); }
.cc-tile:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-tile.is-sel { background: #13161e; color: #fff; }
.cc-tile.is-sel .cc-ic { color: var(--cc-cyan); }
.cc-tile:disabled:not(.is-sel) { opacity: .55; cursor: default; }
.cc-tile--gest { position: relative; }
.cc-tile--gest .cc-ic { color: var(--cc-ink-2); }

/* ---------------- Lista (paso del árbol) ---------------- */

.cc-card { padding: 14px; border-radius: var(--cc-radius); background: var(--cc-surface); box-shadow: 0 1px 1px rgba(16, 24, 40, .03); }
.cc-q { margin: 0 0 10px; font-size: 16.5px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.cc-q--info { font-size: 15px; font-weight: 500; line-height: 1.45; letter-spacing: 0; }
.cc-chat a { overflow-wrap: anywhere; word-break: break-word; }
.cc-q-ayuda { margin: -6px 0 10px; color: var(--cc-muted); font-size: 13px; }

.cc-opts { display: flex; flex-direction: column; gap: 8px; }

.cc-opt {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--cc-line);
    border-radius: 11px;
    background: var(--cc-surface);
    color: var(--cc-ink);
    text-align: left;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.cc-opt:hover:not(:disabled) { border-color: #b8c3cf; background: #fafcfd; }
.cc-opt:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-opt.is-sel { border: 1.5px solid var(--cc-teal); padding: 10.5px 13.5px; background: var(--cc-select-bg); color: var(--cc-teal-ink); font-weight: 600; }
.cc-opt:disabled:not(.is-sel) { opacity: .5; cursor: default; }
.cc-opt--sec { color: var(--cc-muted); }

.cc-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1.5px dashed #9fbcc6;
    border-radius: 11px;
    background: transparent;
    color: var(--cc-teal-ink);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}
.cc-foto:hover:not(:disabled):not(.is-disabled) { background: #f3fafb; }
.cc-foto:focus-within, .cc-foto:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-foto:disabled, .cc-foto.is-disabled { opacity: .5; cursor: default; pointer-events: none; }

/* Selector de archivos del navegador dentro del botón (label): invisible pero accesible. */
label { position: relative; }
.cc-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.is-disabled { opacity: .5; pointer-events: none; }

/* ---------------- Botones y respuestas rápidas ---------------- */

.cc-acciones { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cc-acciones--izq { justify-content: flex-start; }

.cc-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--cc-teal);
    border-radius: 999px;
    background: var(--cc-surface);
    color: var(--cc-teal-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}
.cc-chip:hover:not(:disabled) { background: var(--cc-select-bg); }
.cc-chip--pri { background: var(--cc-teal); color: #fff; }
.cc-chip--pri:hover:not(:disabled) { background: var(--cc-teal-hover); }
.cc-chip:focus-visible, .cc-chip:focus-within { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-chip:disabled { opacity: .5; cursor: default; }
.cc-chip.is-sel, .cc-chip.is-sel:disabled { background: var(--cc-teal); color: #fff; opacity: 1; }

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    background: var(--cc-teal);
    color: #fff;
    font: inherit;
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}
.cc-btn:hover:not(:disabled) { background: var(--cc-teal-hover); }
.cc-btn:focus-visible { outline: 2px solid var(--cc-night); outline-offset: 2px; }
.cc-btn:disabled { opacity: .55; cursor: default; }
.cc-btn--block { width: 100%; margin-top: 6px; }

/* ---------------- Formulario en el chat ---------------- */

.cc-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 9px; }
.cc-field { grid-column: span 2; min-width: 0; }
.cc-field--medio { grid-column: span 1; }
.cc-field label, .cc-field .cc-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--cc-ink); }
.cc-opcional { font-weight: 500; color: var(--cc-muted); }
.cc-foto-campo .cc-foto { margin-top: 0; }
.cc-foto-vista { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cc-foto-vista img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.cc-foto-vista span { font-size: 12.5px; color: var(--cc-muted); overflow-wrap: anywhere; }

.cc-field input, .cc-field textarea {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--cc-line);
    border-radius: 10px;
    background: var(--cc-surface);
    color: var(--cc-ink);
    font: inherit;
    font-size: 16px;
    box-sizing: border-box;
}
.cc-field textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.cc-field input:focus, .cc-field textarea:focus { outline: none; border-color: var(--cc-teal); box-shadow: 0 0 0 3px rgba(14, 116, 137, .15); }
.cc-field input:disabled, .cc-field textarea:disabled { background: #f6f8fa; color: var(--cc-ink-2); }
.cc-field.is-error input, .cc-field.is-error textarea { border-color: var(--cc-danger); }
.cc-help { margin-top: 3px; font-size: 12px; color: var(--cc-muted); line-height: 1.35; }
.cc-err { margin-top: 3px; font-size: 12.5px; color: var(--cc-danger); line-height: 1.35; }
.cc-form .cc-btn--block { grid-column: span 2; }

/* DNI solo: campo grande + "Entrar" */
.cc-dni-row { display: flex; gap: 8px; }
.cc-dni-row input {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 12px;
    border: 1.5px solid var(--cc-teal);
    border-radius: 11px;
    font: inherit;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--cc-ink);
    box-sizing: border-box;
}
.cc-dni-row input:focus { outline: none; box-shadow: 0 0 0 3px rgba(14, 116, 137, .15); }
.cc-dni-row input:disabled { background: #f6f8fa; border-color: var(--cc-line); }
.cc-dni-row .cc-btn { min-height: 50px; padding: 0 16px; }
.cc-field.is-error .cc-dni-row input { border-color: var(--cc-danger); }

/* Formulario ya enviado: queda como lo dejó el cliente, sin poder editarse. */
.cc-card.is-enviado .cc-field input,
.cc-card.is-enviado .cc-field textarea,
.cc-card.is-enviado .cc-dni-row input { background: var(--cc-surface); color: var(--cc-ink); }
.cc-card.is-enviado .cc-dni-row input { border-color: var(--cc-line); }
.cc-card.is-enviado .cc-btn:disabled { opacity: .85; }

/* ---------------- Información (saldo, cuenta corriente) ---------------- */

.cc-info-tit { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--cc-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.cc-info-tit .cc-ic { color: var(--cc-teal); }
.cc-dest { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.cc-dest > div { padding: 10px 12px; border-radius: 10px; background: #f4f7f9; }
.cc-dest span { display: block; font-size: 12.5px; color: var(--cc-muted); }
.cc-dest strong { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.cc-dest small { display: block; font-size: 12px; color: var(--cc-muted); }
.cc-dest .is-deuda strong { color: var(--cc-danger); }
.cc-dest .is-favor strong { color: var(--cc-favor); }
.cc-dest .is-alerta strong { font-size: 14.5px; font-weight: 600; line-height: 1.4; letter-spacing: 0; color: #92400e; }
.cc-lineas { margin: 10px 0 0; padding: 0; list-style: none; }
.cc-lineas li { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 8px; padding: 8px 0; border-top: 1px solid #edf1f4; font-size: 13.5px; }
.cc-lineas .f { color: var(--cc-muted); }
.cc-lineas .c small { display: block; color: var(--cc-muted); font-size: 12px; }
.cc-lineas .i { font-weight: 600; text-align: right; }
.cc-lineas .is-pago .i { color: var(--cc-favor); }
.cc-info-nota { margin-top: 8px; font-size: 12px; color: var(--cc-muted); }
.cc-card--alerta { border-left: 3px solid #d97706; }
.cc-card--alerta .cc-info-tit .cc-ic { color: #d97706; }
.cc-card > .cc-card { margin-bottom: 10px; padding: 0; box-shadow: none; }

/* ---------------- Éxito / error ---------------- */

.cc-ok { padding: 12px 14px 13px; border: 1px solid var(--cc-ok-line); border-radius: var(--cc-radius); background: var(--cc-ok-bg); color: var(--cc-ink-2); font-size: 14.5px; }
.cc-ok-tit { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--cc-teal-ink); font-size: 15px; font-weight: 700; }
.cc-ok strong { color: var(--cc-ink); }
.cc-ok a { color: var(--cc-teal-ink); font-weight: 600; }

.cc-error { padding: 11px 14px; border: 1px solid #f0c4c4; border-radius: var(--cc-radius); background: #fdf1f1; color: #8e2a2a; font-size: 14px; }

.cc-bubble .cc-ok-txt { color: var(--cc-teal); }
.cc-bubble .cc-mal-txt { color: var(--cc-danger); }

/* ---------------- Barra de escritura ---------------- */

.cc-input {
    flex: none;
    display: flex;
    gap: 8px;
    padding: 10px calc(12px + var(--cc-safe-right)) calc(10px + var(--cc-safe-bottom)) calc(12px + var(--cc-safe-left));
    border-top: 1px solid #e3e8ee;
    background: var(--cc-surface);
}
.cc-input input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #e0e5eb;
    border-radius: 13px;
    background: #f4f6f9;
    color: var(--cc-ink);
    font: inherit;
    font-size: 16px;
    box-sizing: border-box;
}
.cc-input input::placeholder { color: #8b94a3; }
.cc-input input:focus { outline: none; border-color: var(--cc-teal); background: #fff; }
.cc-input input:disabled { opacity: .6; }

.cc-send, .cc-clip {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    background: var(--cc-teal);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-sizing: border-box;
}
.cc-send:hover:not(:disabled) { background: var(--cc-teal-hover); }
.cc-send:focus-visible { outline: 2px solid var(--cc-night); outline-offset: 2px; }
.cc-send:disabled { opacity: .55; cursor: default; }
.cc-clip { border: 1px solid #e0e5eb; background: #f4f6f9; color: var(--cc-teal-ink); }
.cc-clip:hover:not(.is-disabled) { background: var(--cc-select-bg); }
.cc-clip:focus-within { outline: 2px solid var(--cc-teal); outline-offset: 2px; }

/* ---------------- Mis gestiones ---------------- */

.cc-vista-tit { margin: 2px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.cc-vacio { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; text-align: center; color: var(--cc-muted); }
.cc-vacio .cc-ic { font-size: 26px; color: #b3bdc9; }
.cc-vacio--chico { padding: 8px; }

.cc-gest {
    display: block;
    width: 100%;
    padding: 13px 14px;
    border: 0;
    border-radius: var(--cc-radius);
    background: var(--cc-surface);
    color: var(--cc-ink);
    text-align: left;
    font: inherit;
    box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
    cursor: pointer;
}
.cc-gest:hover { background: #f8fbfc; }
.cc-gest:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-gest-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-gest-num { font-size: 15.5px; font-weight: 700; }
.cc-gest-tema { margin-top: 2px; font-size: 14.5px; color: var(--cc-ink-2); }
.cc-gest-meta { margin-top: 6px; font-size: 12.5px; color: var(--cc-muted); }
.cc-gest-meta .cc-ic { margin-right: 3px; }

.cc-pill { flex: none; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.cc-pill--abierta { background: var(--cc-cyan); color: #06333b; }
.cc-pill--espera { background: #ffe9b5; color: #6b4b00; }
.cc-pill--resuelta { background: #d7f2e3; color: #145c39; }
.cc-pill--cerrada { background: #e6e9ee; color: #4b5563; }

.cc-det-head { padding: 15px; border-radius: var(--cc-radius); background: var(--cc-night); color: #fff; }
.cc-det-tit { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cc-det-head h3 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.cc-det-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 12.5px; color: #a3abba; }
.cc-eta { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--cc-night-2); font-size: 13px; color: #d9dee6; }
.cc-eta .cc-ic { color: var(--cc-cyan); }
.cc-eta strong { color: #fff; }

.cc-timeline { margin: 0; padding: 4px 4px 4px 6px; list-style: none; }
.cc-timeline li { position: relative; padding: 0 0 14px 24px; }
.cc-timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: #cfe3e8; }
.cc-timeline li:last-child::before { display: none; }
.cc-timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--cc-teal); box-sizing: border-box; }
.cc-timeline li.is-actual::after { background: var(--cc-surface); border: 2.5px solid var(--cc-teal); }
.cc-timeline li.is-pendiente::after { background: var(--cc-surface); border: 2px solid #c3cbd5; }
.cc-timeline .t { font-size: 14.5px; font-weight: 600; }
.cc-timeline .is-pendiente .t { font-weight: 500; color: var(--cc-muted); }
.cc-timeline .d { font-size: 12.5px; color: var(--cc-muted); }

.cc-ini { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--cc-night); color: #fff; font-size: 9.5px; font-weight: 700; }
.cc-msg-adj { margin-top: 6px; font-size: 12.5px; color: var(--cc-muted); }
.cc-user .cc-msg-adj { color: #d5eef3; }
.cc-nota { padding: 10px 12px; border-radius: 10px; background: #e9edf2; color: var(--cc-ink-2); font-size: 13px; }

/* ---------------- Respuestas del equipo en el chat ---------------- */

.cc-agt { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: start; animation: cc-in .22s ease-out both; }
.cc-ini--agt { width: 30px; height: 30px; margin-top: 18px; font-size: 11px; letter-spacing: .02em; }
.cc-agt .cc-stack { gap: 4px; }
.cc-agt-autor { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; padding-left: 2px; font-size: 12px; color: var(--cc-muted); }
.cc-agt-autor strong { color: var(--cc-ink-2); font-weight: 600; }
.cc-bubble--agt { border: 1px solid #d5e9ee; }
.cc-nueva { margin-left: 4px; padding: 0 7px; border-radius: 999px; background: var(--cc-cyan); color: #06333b; font-size: 10.5px; font-weight: 700; line-height: 17px; }

.cc-nov-tit { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.cc-nov-tit .cc-ic { color: var(--cc-teal); align-self: center; }
.cc-nov-tit small { grid-column: 2; color: var(--cc-muted); font-size: 12.5px; }
.cc-acciones--agt { padding-left: 38px; }

.cc-sis {
    align-self: center;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 92%;
    padding: 6px 13px;
    border-radius: 999px;
    background: #e3e9ef;
    color: var(--cc-ink-2);
    font-size: 12.5px;
    text-align: center;
    animation: cc-in .18s ease-out both;
}
.cc-sis .cc-ic { color: var(--cc-teal); }
.cc-sis time { color: var(--cc-muted); }

.cc-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--cc-danger);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 21px;
    text-align: center;
    box-sizing: border-box;
}
.cc-nuevas { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #fde8e8; color: #9b2c2c; font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* ---------------- Fotos en la respuesta del cliente ---------------- */

.cc-adj { display: flex; flex-wrap: wrap; gap: 10px; }
.cc-adj-item { position: relative; width: 62px; height: 62px; }
.cc-adj-item img, .cc-adj-sin { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; border: 1px solid var(--cc-line); box-sizing: border-box; }
.cc-adj-sin { display: grid; place-items: center; color: var(--cc-muted); background: #f4f6f9; }
.cc-adj-item.is-subiendo img { opacity: .45; }
.cc-adj-spin { position: absolute; inset: 0; display: none; place-items: center; }
.cc-adj-item.is-subiendo .cc-adj-spin { display: grid; }
.cc-adj-quitar {
    position: absolute;
    top: -8px;
    right: -8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid var(--cc-surface);
    border-radius: 50%;
    background: var(--cc-night);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    z-index: 1;
}
.cc-adj-quitar:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 1px; }
.cc-adj-quitar:disabled { opacity: .5; cursor: default; }
.cc-adj-barra { flex: none; padding: 12px calc(12px + var(--cc-safe-right)) 4px calc(12px + var(--cc-safe-left)); border-top: 1px solid #e3e8ee; background: var(--cc-surface); }
.cc-adj-barra + .cc-input { border-top: 0; }

.cc-user--adj { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.cc-user--adj .cc-user-txt { padding: 0 8px 3px; }
.cc-user-fotos { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-user-fotos img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; }
.cc-envio { align-self: flex-end; display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; max-width: 82%; margin-top: -6px; font-size: 12px; color: var(--cc-muted); }
.cc-envio.is-ok .cc-ic { color: var(--cc-teal); }
.cc-envio.is-error { color: var(--cc-danger); }
.cc-envio-btn { min-height: 32px; border: 0; padding: 0 4px; background: none; color: var(--cc-teal-ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* "Tus gestiones en curso" antes del menú (cliente con gestiones abiertas) y límite por área. */
.cc-abiertas { display: flex; flex-direction: column; gap: 8px; }
.cc-abiertas-tit { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--cc-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.cc-abiertas-tit .cc-ic { color: var(--cc-teal); }
.cc-abierta-fila { display: flex; align-items: stretch; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; overflow: hidden; }
.cc-abierta { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; text-align: left; padding: 11px 12px; border: 0; border-radius: 0;
    background: transparent; font: inherit; color: inherit; cursor: pointer; overflow-wrap: anywhere; }
.cc-abierta:hover { background: #f8fbfc; }
.cc-abierta-esc { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 72px;
    padding: 6px 4px; border: 0; border-left: 1px solid #dfe6ee; background: #f4fafb; color: var(--cc-teal-ink); font: inherit;
    font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cc-abierta-esc .cc-ic { font-size: 16px; }
.cc-abierta-esc:hover { background: var(--cc-select-bg); }
.cc-abierta-esc:focus-visible, .cc-abierta:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: -3px; }
.cc-abierta .cc-gest-num { font-size: 14.5px; }
.cc-abierta .cc-gest-meta { margin-top: 2px; }
.cc-abierta .cc-nuevas { align-self: flex-start; margin: 4px 0 0; }
.cc-abiertas-mas { align-self: flex-start; min-height: 36px; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 14px; font-weight: 600; color: var(--cc-teal); cursor: pointer; }

.cc-limite { gap: 9px; }
/* Avisos (push): oferta, instrucciones para iPhone, bloqueados */
.cc-avisos { display: flex; flex-direction: column; gap: 6px; }
.cc-avisos-tit { display: flex; align-items: center; gap: 7px; color: var(--cc-teal-ink); font-size: 15px; font-weight: 700; }
.cc-avisos-tit .cc-ic { color: var(--cc-teal); }
.cc-avisos-txt { margin: 0; color: var(--cc-ink-2); font-size: 14.5px; }
.cc-avisos .cc-acciones { margin-top: 4px; }
.cc-spinner--chico { width: 14px; height: 14px; margin-right: 6px; border-width: 2px; vertical-align: -2px; }
.cc-limite-tit { display: flex; align-items: center; gap: 7px; color: var(--cc-teal-ink); font-size: 15px; font-weight: 700; }
.cc-limite-tit .cc-ic { color: var(--cc-teal); }
.cc-limite-txt { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--cc-ink); }

/* ---------------- Gestión activa ---------------- */

.cc-ctx {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px calc(10px + var(--cc-safe-right)) 7px calc(14px + var(--cc-safe-left));
    border-top: 1px solid #d5e9ee;
    background: var(--cc-ok-bg);
    color: var(--cc-teal-ink);
    font-size: 13px;
}
.cc-ctx > .cc-ic { color: var(--cc-teal); font-size: 17px; }
.cc-ctx-txt { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; }
.cc-ctx-l1, .cc-ctx-l2 { display: block; overflow: hidden; text-overflow: ellipsis; }
.cc-ctx-l1 { font-size: 11.5px; color: var(--cc-muted); }
.cc-ctx-l2 { font-size: 13.5px; }
.cc-ctx-txt strong { color: var(--cc-ink); }
.cc-ctx-tema { color: var(--cc-ink-2); }
.cc-ctx-btn { flex: none; min-height: 36px; padding: 0 13px; border: 1px solid var(--cc-ok-line); border-radius: 999px; background: #fff; color: var(--cc-teal-ink);
    font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cc-ctx-btn:hover { background: var(--cc-select-bg); }
.cc-ctx-btn:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-ctx.is-cerrada { border-top-color: #e3e8ee; background: #eef1f5; color: var(--cc-ink-2); }
.cc-ctx.is-cerrada > .cc-ic { color: var(--cc-muted); }
.cc-ctx + .cc-adj-barra { border-top: 0; }

/* ---------------- "Elegir": servicios y fechas del compromiso de pago ---------------- */

.cc-opt--det { display: flex; align-items: flex-start; gap: 10px; }
.cc-opt--det > .cc-ic { margin-top: 2px; color: var(--cc-teal); }
.cc-opt--det b { display: block; font-weight: 600; }
.cc-opt--det small { display: block; margin-top: 2px; color: var(--cc-muted); font-size: 13px; font-weight: 400; line-height: 1.35; }
.cc-opt--det.is-sel small { color: var(--cc-teal-ink); }

.cc-fechas-tit { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--cc-ink); }
.cc-fechas-tit .cc-ic { color: var(--cc-teal); }
.cc-fechas-fila { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-fechas-no { margin-top: 12px; text-align: center; }

/* ---------------- Pantallas simples (encuesta, no encontrado) ---------------- */

.cc-simple { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px calc(16px + var(--cc-safe-right)) calc(18px + var(--cc-safe-bottom)) calc(16px + var(--cc-safe-left)); }
.cc-estrellas { display: flex; justify-content: space-between; gap: 4px; margin: 8px 0 2px; }
.cc-estrella { flex: 1; display: grid; place-items: center; min-height: 52px; border: 0; border-radius: 12px; background: #f4f7f9; color: #c3cbd5; font-size: 30px; cursor: pointer; }
.cc-estrella.is-on { color: #e0a106; background: #fff6df; }
.cc-estrella:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-estrellas-ref { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 12px; color: var(--cc-muted); }
/* Encuesta dentro de la app (conversación y detalle de la gestión) */
.cc-encuesta .cc-estrella { min-height: 44px; font-size: 26px; }
.cc-encuesta .cc-ok { border: 0; padding: 0; background: none; }
.cc-encuesta .cc-acciones { margin-top: 4px; }

/* Error de Blazor */
#blazor-error-ui {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 2000;
    display: none;
    width: 100%;
    padding: .6rem 1.25rem calc(.7rem + var(--cc-safe-bottom));
    background: #fff3d6;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    font-family: var(--cc-font);
    box-sizing: border-box;
}
#blazor-error-ui .dismiss { position: absolute; top: .5rem; right: .75rem; cursor: pointer; }

/* ---------------- Control de versión (Layout/ControlVersion.razor) ---------------- */

/* Actualización obligatoria y novedades: tapan la app (arriba de los menús y diálogos de MudBlazor). */
.cc-vr-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(20px + var(--cc-safe-top)) calc(16px + var(--cc-safe-right)) calc(20px + var(--cc-safe-bottom)) calc(16px + var(--cc-safe-left));
    background: rgba(13, 15, 22, .94);
    font-family: var(--cc-font);
    color: var(--cc-ink);
}
.cc-vr-overlay--suave { background: rgba(13, 15, 22, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cc-vr-card {
    width: 100%;
    max-width: 400px;
    max-height: 100%;
    box-sizing: border-box;
    padding: 26px 22px 20px;
    border-radius: 18px;
    background: var(--cc-surface);
    text-align: center;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55);
}
.cc-vr-icono { display: flex; justify-content: center; margin-bottom: 10px; color: var(--cc-teal); font-size: 48px; }
.cc-vr-titulo { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--cc-ink); }
.cc-vr-mensaje { margin: 0 0 12px; color: var(--cc-ink-2); font-size: 15px; line-height: 1.45; }
.cc-vr-versiones { margin: 0 0 14px; color: var(--cc-muted); font-size: 13px; }
.cc-vr-error { margin: 10px 0 0; color: var(--cc-danger); font-size: 13.5px; }
.cc-vr-salir {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    border: 1px solid var(--cc-line);
    border-radius: 11px;
    background: #fff;
    color: var(--cc-ink-2);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.cc-spinner--claro { width: 18px; height: 18px; border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }

/* Actualización opcional: aviso flotante arriba, dentro de la columna de la app. */
.cc-vr-aviso {
    position: fixed;
    top: calc(68px + var(--cc-safe-top));
    left: 50%;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 24px - var(--cc-safe-left) - var(--cc-safe-right));
    max-width: 616px;
    box-sizing: border-box;
    padding: 10px 8px 10px 12px;
    border: 1px solid var(--cc-ok-line);
    border-radius: var(--cc-radius);
    background: var(--cc-surface);
    color: var(--cc-ink);
    font-family: var(--cc-font);
    font-size: 14px;
    transform: translateX(-50%);
    box-shadow: 0 12px 30px -12px rgba(16, 24, 40, .35);
}
.cc-vr-aviso-ic { flex: none; color: var(--cc-teal); font-size: 22px; display: flex; }
.cc-vr-aviso-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cc-vr-aviso-texto span { color: var(--cc-muted); font-size: 13px; }
.cc-vr-aviso-btn {
    flex: none;
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: var(--cc-teal);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.cc-vr-aviso-btn:disabled { opacity: .6; cursor: default; }
.cc-vr-aviso-cerrar {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Novedades de la versión. */
.cc-vr-card--novedades { display: flex; flex-direction: column; text-align: left; }
.cc-nv-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cc-nv-chip { display: inline-block; margin-bottom: 8px; padding: 3px 11px; border-radius: 999px; background: var(--cc-select-bg); color: var(--cc-teal-ink); font-size: 12px; font-weight: 600; }
.cc-nv-lista { margin: 4px 0 8px; padding: 0; list-style: none; }
.cc-nv-lista li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #edf1f4; }
.cc-nv-lista li:first-child { border-top: 0; }
.cc-nv-lista strong { display: block; font-size: 15px; }
.cc-nv-lista span span { color: var(--cc-ink-2); font-size: 13.5px; }
.cc-nv-ic { flex: none; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: var(--cc-select-bg); color: var(--cc-teal); font-size: 20px; }

/* ---------------- Fotos de los mensajes de las gestiones (miniaturas + visor) ---------------- */

.cc-adj-fotos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cc-adj-foto {
    display: block;
    width: 140px;
    height: 140px;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(0, 0, 0, .06);
    overflow: hidden;
    cursor: zoom-in;
}
.cc-adj-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-adj-foto:focus-visible { outline: 2px solid var(--cc-teal); outline-offset: 2px; }
.cc-adj-foto.is-cargando { animation: cc-adj-late 1.2s ease-in-out infinite; cursor: default; }
.cc-adj-foto.is-error { width: auto; height: auto; padding: 4px 8px; background: transparent; color: inherit; font-size: 12.5px; cursor: default; opacity: .85; }
.cc-user .cc-adj-foto { background: rgba(255, 255, 255, .15); }
@keyframes cc-adj-late { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .cc-adj-foto.is-cargando { animation: none; } }

.cc-visor {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(56px + var(--cc-safe-top)) calc(12px + var(--cc-safe-right)) calc(20px + var(--cc-safe-bottom)) calc(12px + var(--cc-safe-left));
    background: rgba(13, 15, 22, .94);
    outline: none;
}
.cc-visor img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.cc-visor-cerrar {
    position: absolute;
    top: calc(10px + var(--cc-safe-top));
    right: calc(12px + var(--cc-safe-right));
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}
.cc-visor-cerrar:focus-visible { outline: 2px solid var(--cc-cyan, #29d7eb); outline-offset: 2px; }
