/* ═══════════════════════════════════════════════════
   FICHA DEL CLIENTE — ui/ficha-cliente.js (columna derecha de Chats, PC)
   Registro sereno. Lo que manda es "el siguiente paso": una tarjeta con un
   solo botón en tinta. Los pasos (Cotización · Datos · Venta · Pago) son una
   fila de puntos; lavanda marca lo que la app leyó de un mensaje; durazno,
   lo que conviene revisar.
═══════════════════════════════════════════════════ */

.wa-ctx .fc { display: flex; flex-direction: column; gap: 14px; }

.fc-quien { display: flex; align-items: center; gap: 12px; }
.fc-quien > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fc-quien b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-quien > div > span { font-size: 12.5px; color: var(--tinta-3, #6B6E79); font-variant-numeric: tabular-nums; }
.fc-av { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--lavanda-g, #E4DEFC); color: var(--lavanda-gt, #3F3470); font: 700 15px var(--font); }
.fc-ico { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--tinta-2, #50535E); display: grid; place-items: center; cursor: pointer; transition: background-color .15s; }
.fc-ico:hover { background: var(--hundido, #F2F3F6); color: var(--tinta, #141519); }
.fc-ico svg, .fc-link svg, .fc-principal svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Pasos */
.fc-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.fc-pasos::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 5px; height: 2px; background: var(--gray-200, #E7E8EE); }
.fc-pasos li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 11px; color: var(--tinta-3, #6B6E79); }
.fc-pasos i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface, #fff); box-shadow: inset 0 0 0 2px var(--gray-300, #D3D6E0); z-index: 1; transition: box-shadow .3s var(--salida, ease), background-color .3s; }
.fc-pasos li.hecho i { background: var(--tinta, #141519); box-shadow: none; }
.fc-pasos li.ahora i { box-shadow: inset 0 0 0 4px var(--tinta, #141519); }
.fc-pasos li.ahora span, .fc-pasos li.hecho span { color: var(--tinta, #141519); font-weight: 600; }

/* El siguiente paso */
.fc-proximo { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: var(--hundido, #F2F3F6); }
.fc-proximo.fc-cambia { animation: fc-entra .32s var(--salida, ease) both; }
.fc-proximo > p { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3, #6B6E79); }
.fc-proximo h2 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.fc-proximo > span { font-size: 13px; line-height: 1.45; color: var(--tinta-2, #50535E); }
.fc-principal {
  margin-top: 6px; height: 46px; border: 0; border-radius: 999px; background: var(--tinta, #141519); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px var(--font); cursor: pointer;
  box-shadow: var(--sombra-toque, none); transition: background-color .15s, transform .12s;
}
.fc-principal:hover { background: #2A2C33; }
.fc-principal:active { transform: scale(.98); }
.fc-principal:focus-visible, .fc-alt:focus-visible, .fc-chip:focus-visible, .fc-link:focus-visible { outline: 2px solid var(--tinta, #141519); outline-offset: 2px; }
.fc-alt { justify-self: center; border: 0; background: none; padding: 6px 8px; font: 600 12.5px var(--font); color: var(--tinta-2, #50535E); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; border-radius: 8px; }
.fc-alt:hover { color: var(--tinta, #141519); }

/* Secciones */
.fc-sec { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--linea, rgba(20, 21, 25, .07)); }
.fc-sec > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-sec h3 { margin: 0; font-size: 13px; font-weight: 600; }
.fc-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px; border-radius: 8px; font: 600 12px var(--font); color: var(--tinta-2, #50535E); cursor: pointer; }
.fc-link:hover { color: var(--tinta, #141519); background: var(--hundido, #F2F3F6); }
.fc-nota { margin: 0; font-size: 12px; line-height: 1.45; color: var(--lavanda-gt, #3F3470); }
.fc-aviso { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--lavanda-g, #E4DEFC); font-size: 12px; color: var(--lavanda-gt, #3F3470); }
.fc-aviso .fc-alt { color: var(--lavanda-gt, #3F3470); padding: 2px 4px; }

.fc-campos { display: grid; gap: 6px; }
.fc-campo { display: grid; grid-template-columns: 1fr; gap: 3px; }
.fc-campo > span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--tinta-3, #6B6E79); }
.fc-campo em { font-style: normal; padding: 1px 7px; border-radius: 999px; background: var(--durazno-g, #FCE3CC); color: var(--durazno-gt, #6E4516); font-size: 10.5px; }
.fc-campo input, .fc-campo select, .fc-otra select {
  height: 36px; padding: 0 12px; border: 0; border-radius: 12px; background: var(--hundido, #F2F3F6);
  font: 400 13.5px var(--font); color: var(--tinta, #141519); min-width: 0; width: 100%; box-sizing: border-box;
}
.fc-campo:has(select) { grid-template-columns: 76px minmax(0, 1fr); }
.fc-campo:has(select) > span { grid-column: 1 / -1; }
.fc-campo.fc-det input { background: color-mix(in oklab, var(--lavanda-g, #E4DEFC) 55%, white); box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--lavanda-gt, #3F3470) 45%, transparent); }
.fc-campo input:focus, .fc-campo select:focus, .fc-otra select:focus, .fc-pegar textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--tinta, #141519); }

.fc-pegar { display: grid; gap: 8px; }
.fc-pegar textarea { width: 100%; box-sizing: border-box; border: 0; border-radius: 14px; padding: 10px 12px; background: var(--hundido, #F2F3F6); font: 400 13px/1.45 var(--font); resize: vertical; }
.fc-fila-btn { display: flex; justify-content: flex-end; gap: 8px; }
.fc-btn-tinta { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--tinta, #141519); color: #fff; font: 600 13px var(--font); cursor: pointer; }

.fc-cot { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--hundido, #F2F3F6); }
.fc-cot-cab { display: flex; justify-content: space-between; font-size: 13px; }
.fc-cot-cab span { font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-cot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fc-cot li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--tinta-2, #50535E); }
.fc-cot li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-cot li em { font-style: normal; color: var(--tinta-3, #6B6E79); white-space: nowrap; }
.fc-cot .fc-mas { color: var(--tinta-3, #6B6E79); }
.fc-otra { display: grid; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--tinta-3, #6B6E79); }

.fc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-chip { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--hundido, #F2F3F6); color: var(--tinta, #141519); font: 600 12.5px var(--font); cursor: pointer; transition: background-color .15s, transform .12s; }
.fc-chip:hover { background: var(--gray-200, #E7E8EE); }
.fc-chip:active { transform: scale(.97); }

/* Marca en la burbuja del mensaje que trae los datos */
.wa-tag-datos { display: inline-flex; align-self: flex-start; margin-bottom: 4px; padding: 2px 8px; border-radius: 999px; background: var(--lavanda-g, #E4DEFC); color: var(--lavanda-gt, #3F3470); font-size: 11px; font-weight: 600; }

@keyframes fc-entra { from { opacity: 0; transform: translateY(4px); filter: blur(var(--borron, 2px)); } }
@media (prefers-reduced-motion: reduce) {
  .fc-proximo.fc-cambia { animation: none; }
  .fc-pasos i, .fc-principal, .fc-chip { transition: none; }
}

/* Dirección 1: el siguiente paso es la pieza de arte oscura de la pantalla */
.fc-proximo.fc-arte {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(143, 110, 255, .55), transparent 55%),
    radial-gradient(90% 80% at 0% 110%, rgba(232, 100, 31, .40), transparent 60%),
    radial-gradient(60% 60% at 70% 120%, rgba(143, 193, 245, .35), transparent 70%),
    #17151F;
}
.fc-arte > p { color: rgba(255, 255, 255, .6); }
.fc-arte > span { color: rgba(255, 255, 255, .78); }
.fc-arte .fc-principal { background: #fff; color: var(--tinta, #141519); }
.fc-arte .fc-principal:hover { background: #F2F3F6; }
.fc-arte .fc-alt { color: rgba(255, 255, 255, .78); }
.fc-arte .fc-alt:hover { color: #fff; }
.fc-arte .fc-principal:focus-visible, .fc-arte .fc-alt:focus-visible { outline-color: #fff; }

/* ── Su historia con la tienda (ui/historia-cliente.js) ── */
.fc-hist { display: grid; gap: 8px; }
.fc-cifras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fc-cifras > div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 14px; background: var(--hundido, #F2F3F6); min-width: 0; }
.fc-cifras b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-cifras span { font-size: 11.5px; color: var(--tinta-3, #6B6E79); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-hist-pie { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tinta-3, #6B6E79); }
.fc-tipo { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fc-tipo-cie { background: var(--cielo-g, #DCE5FF); color: var(--cielo-gt, #1B3A86); }
.fc-tipo-gris { background: var(--hundido, #F2F3F6); color: var(--tinta-2, #50535E); }
.fc-tipo-men { background: var(--menta-g, #CFEEDD); color: var(--menta-gt, #1F5A3C); }
.fc-tipo-lav { background: var(--lavanda-g, #E4DEFC); color: var(--lavanda-gt, #3F3470); }
.fc-tipo-dur { background: var(--durazno-g, #FCE3CC); color: var(--durazno-gt, #6E4516); }
.fc-sug { margin: 0; padding: 9px 12px; border-radius: 12px; background: color-mix(in oklab, var(--lavanda-g, #E4DEFC) 55%, white); color: var(--lavanda-gt, #3F3470); font-size: 12.5px; line-height: 1.45; font-weight: 500; }

.fc-hist-det h4 { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--tinta-3, #6B6E79); }
.fc-hist-datos > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--linea, rgba(20, 21, 25, .07)); font-size: 12.5px; }
.fc-hist-datos > div:first-child { border-top: 0; }
.fc-hist-datos span { color: var(--tinta-3, #6B6E79); white-space: nowrap; }
.fc-hist-datos b { font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-nocompro { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fc-nocompro li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--hundido, #F2F3F6); font-size: 12.5px; }
.fc-nocompro li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-nocompro li em { flex: none; font-style: normal; font-weight: 600; color: var(--tinta-2, #50535E); font-variant-numeric: tabular-nums; }
.fc-linea { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.fc-linea li { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px; padding: 6px 0; font-size: 12.5px; position: relative; }
.fc-linea li::before { content: ""; position: absolute; left: 4.5px; top: 18px; bottom: -6px; width: 1px; background: var(--gray-200, #E7E8EE); }
.fc-linea li:last-child::before { display: none; }
.fc-linea i { width: 10px; height: 10px; margin-top: 3px; border-radius: 50%; background: var(--gray-300, #D3D6E0); }
.fc-l-compra i { background: var(--menta-gt, #1F5A3C); }
.fc-l-cotizacion i { background: var(--lavanda-gt, #3F3470); }
.fc-l-perdida i { background: var(--rosa-gt, #6F2A47); }
.fc-l-pago i { background: var(--durazno-gt, #6E4516); }
.fc-linea span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tinta, #141519); }
.fc-linea em { grid-column: 2; font-style: normal; font-size: 11.5px; color: var(--tinta-3, #6B6E79); }
.fc-ver-todo { justify-self: start; padding-left: 0; }
.fc-nota-gris { margin: 0; font-size: 11px; color: var(--tinta-3, #6B6E79); }

/* ── Fiel a la maqueta aprobada: datos y cotización como filas limpias ── */
.fc-quien > div > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-cab-der { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tinta-3, #6B6E79); }
.fc-link-plano { padding: 2px 4px; text-decoration: underline; text-underline-offset: 3px; }
.fc-filas > .fc-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 0; font-size: 13px; }
.fc-fila > span { flex: none; color: var(--tinta-3, #6B6E79); display: inline-flex; align-items: center; gap: 6px; }
.fc-fila > span em { font-style: normal; padding: 1px 7px; border-radius: 999px; background: var(--durazno-g, #FCE3CC); color: var(--durazno-gt, #6E4516); font-size: 10.5px; font-weight: 600; }
.fc-fila > b { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.fc-fila > b.fc-falta { color: var(--durazno-gt, #6E4516); font-weight: 600; }
.fc-cot ul { gap: 6px; }
.fc-cot li { font-size: 12.5px; color: var(--tinta, #141519); align-items: baseline; }
.fc-cot li span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-cot li b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-cot-total { display: flex; justify-content: space-between; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--linea, rgba(20, 21, 25, .07)); font-size: 14px; font-weight: 700; }
.fc-cot-total b { font-variant-numeric: tabular-nums; }
.fc-hist-sec { gap: 10px; }

/* Lo que pidió en el chat (domain/detectar-productos.js) */
.fc-pedido ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fc-pedido li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 9px 10px; border-radius: 12px; background: var(--hundido, #F2F3F6); font-size: 12.5px; }
.fc-pedido label { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.fc-pedido label span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-pedido input { width: 16px; height: 16px; accent-color: var(--tinta, #141519); flex: none; }
.fc-pedido b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-pedido i { grid-column: 1 / -1; font-style: normal; padding-left: 24px; }

/* La cotización no se ensancha con nombres largos o con el aviso de existencias */
.fc-cot { grid-template-columns: minmax(0, 1fr); }
.fc-cot > *, .fc-cot li > span { min-width: 0; }
.fc-cot li span .ex { flex: none; }
.fc-cot li > span { flex: 1; }
.fc-cot-nom { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Envío estimado (domain/envio.js) */
.fc-envio { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 14px; border-radius: 14px; background: var(--cielo-g, #DCE5FF); color: var(--cielo-gt, #1B3A86); }
.fc-envio > div { display: grid; gap: 2px; min-width: 0; }
.fc-envio span { font-size: 13px; font-weight: 600; }
.fc-envio small { font-size: 11.5px; opacity: .85; }
.fc-envio b { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Factura electrónica */
.fc-fe-ok { background: var(--menta-g, #CFEEDD); color: var(--menta-gt, #1F5A3C); }
.fc-cufe { word-break: break-all; }
.fc-fe-prueba summary { cursor: pointer; font-size: 12.5px; font-weight: 600; padding: 4px 0; }
.fc-fe-prueba pre { max-height: 260px; overflow: auto; margin: 6px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--hundido, #F2F3F6); font-size: 11px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* Cotizar sin salir del chat: referencias y opciones de la IA (ui/ficha-cliente.js) */
.fc-buscar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--hundido, #F2F3F6); }
.fc-buscar svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--tinta-3, #6B6E79); stroke-width: 1.8; stroke-linecap: round; }
.fc-buscar input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 13px var(--font); color: var(--tinta, #141519); }
.fc-buscar input:focus { outline: none; }
.fc-buscar:focus-within { box-shadow: 0 0 0 2px var(--tinta, #141519); }
.fc-refs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fc-refs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; padding: 9px 10px; border-radius: 12px; background: var(--hundido, #F2F3F6); font-size: 12.5px; transition: background-color .15s; }
.fc-refs li.fc-ref-sel { background: var(--menta-g, #CFEEDD); }
.fc-ref-nom { display: grid; gap: 2px; min-width: 0; }
.fc-ref-nom i { font-style: normal; }
.fc-refs b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-ref-btn { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface, #fff); color: var(--tinta, #141519); font: 600 12px var(--font); cursor: pointer; transition: transform .12s; }
.fc-ref-btn:active { transform: scale(.96); }
.fc-ref-btn:focus-visible { outline: 2px solid var(--tinta, #141519); outline-offset: 2px; }
.fc-ref-sel .fc-ref-btn { background: var(--tinta, #141519); color: #fff; }
.fc-menu-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--tinta-2, #50535E); }
.fc-menu-total b { font-size: 16px; color: var(--tinta, #141519); font-variant-numeric: tabular-nums; }
.fc-armado { gap: 10px; }
.fc-op { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: var(--hundido, #F2F3F6); }
.fc-op-centro { background: var(--surface, #fff); box-shadow: 0 0 0 2px var(--tinta, #141519); }
.fc-op-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fc-op-nom { height: 24px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; background: var(--lavanda-g, #E4DEFC); color: var(--lavanda-gt, #3F3470); }
.fc-op-cab b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-op-dif { margin-top: -4px; font-size: 12px; color: var(--tinta-3, #6B6E79); }
.fc-op ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.fc-op li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; color: var(--tinta-2, #50535E); }
.fc-op li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-op li b { font-weight: 500; font-variant-numeric: tabular-nums; }
.fc-op-txt { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--tinta, #141519); }
.fc-op-cargando { height: 120px; background: linear-gradient(90deg, var(--hundido, #F2F3F6), #fff, var(--hundido, #F2F3F6)); background-size: 200% 100%; animation: fc-brillo 1.4s linear infinite; }
@keyframes fc-brillo { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .fc-op-cargando { animation: none; } }
.fc-error { color: var(--rosa-gt, #6F2A47); }
.fc-op-hay { font-size: 12px; color: var(--menta-gt, #1F5A3C); }
.fc-op-hay.fc-op-pedido { color: var(--durazno-gt, #6E4516); }
.fc-op-mal { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--rosa-g, #F9D7E4); color: var(--rosa-gt, #6F2A47); font-size: 12px; }
.fc-op-mal b { font-weight: 600; }

/* 3 cartas elegibles dentro del chat (estilo Discover / Hearthstone) */
#waHilo { position: relative; }
.fc-cartas-fondo {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(20, 21, 25, .42); backdrop-filter: blur(4px);
}
.fc-cartas-caja {
  width: 100%; max-width: 980px; max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--lienzo, #ECEDF2); border-radius: 22px; padding: 18px;
  box-shadow: 0 20px 50px rgba(20, 21, 25, .28); box-sizing: border-box;
}
.fc-cartas-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fc-cartas-cab h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--tinta, #141519); }
.fc-cartas-cab small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--tinta-2, #50535E); }
.fc-cartas-acc { display: flex; gap: 8px; }
.fc-cartas-rej { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.fc-carta {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px;
  background: var(--surface, #fff); color: var(--tinta, #141519);
  border-top: 4px solid var(--tinta, #141519);
  box-shadow: 0 4px 16px rgba(20, 21, 25, .07);
  transition: transform .16s ease, box-shadow .16s ease;
}
.fc-carta:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(20, 21, 25, .15); }
.fc-carta-centro { box-shadow: 0 0 0 2px var(--tinta, #141519), 0 10px 26px rgba(20, 21, 25, .12); }
.fc-hoja-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-hoja-marca { font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--tinta, #141519); }
.fc-hoja-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -4px; }
.fc-hoja-sub small { margin-left: auto; font-size: 11.5px; color: var(--tinta-3, #6B6E79); }
.fc-hoja-chip { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.fc-hoja-chip.ok { background: var(--menta-g, #CFEEDD); color: var(--menta-gt, #1F5A3C); }
.fc-hoja-chip.warn { background: var(--durazno-g, #FCE3CC); color: var(--durazno-gt, #6E4516); }
.fc-hoja-th {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: 8px; background: var(--tinta, #141519); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
}
.fc-hoja-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 12px; background: var(--tinta, #141519); color: #fff;
}
.fc-hoja-total span { font-size: 11px; font-weight: 600; letter-spacing: .06em; opacity: .75; }
.fc-hoja-total b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fc-hoja-txt {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12px; line-height: 1.45; color: var(--tinta-2, #50535E);
}
.fc-carta-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; line-height: 1.35; }
.fc-carta-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding-top: 6px; border-top: 1px solid var(--linea, rgba(20, 21, 25, .07)); color: var(--tinta-2, #50535E); }
.fc-carta-lista li:first-child { border-top: 0; padding-top: 0; }
.fc-carta-lista li span { min-width: 0; white-space: normal; word-break: break-word; }
.fc-carta-lista li b { font-weight: 600; color: var(--tinta, #141519); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-carta-pie { margin-top: auto; padding-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fc-carta-pie button { width: 100%; }
.fc-cartas-sub { margin: 0; text-align: center; font-size: 13px; color: var(--tinta-2, #50535E); }
.fc-cartas-carg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; }
.fc-cartas-err { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; background: var(--surface, #fff); border-radius: 16px; }
@media (max-width: 1280px) { .fc-cartas-rej { grid-template-columns: minmax(0, 1fr); } }
.of-sinfecha { padding: 8px 12px; border-radius: 12px; background: var(--durazno-g, #FCE3CC); color: var(--durazno-gt, #6E4516); font-weight: 600; }

/* ── Columna angosta: nada se sale por la derecha ──
   Las grillas con columna implícita "auto" crecían hasta el texto más largo
   (nombres de producto en una sola línea) y empujaban la ficha fuera de la
   tarjeta. Con minmax(0, 1fr) el texto largo se corta con "…" adentro. */
.wa-ctx { container-type: inline-size; }
.fc-sec, .fc-hist, .fc-cot ul, .fc-nocompro, .fc-hist-datos, .fc-proximo, .fc-campos, .fc-refs, .fc-pedido ul, .fc-op ul { grid-template-columns: minmax(0, 1fr); }
.fc-sec > *, .fc-hist > *, .fc-proximo > * { min-width: 0; }
.fc-principal { height: auto; min-height: 46px; padding: 10px 18px; text-align: center; line-height: 1.25; }
.fc-principal svg { flex: none; }
.fc-hist-pie { flex-wrap: wrap; row-gap: 4px; }
.fc-hist-pie > span:not(.fc-tipo) { white-space: nowrap; }
.fc-hist-datos span { white-space: normal; }

/* Si la columna queda muy angosta, las tres cifras pasan a filas */
@container (max-width: 320px) {
  .fc-cifras { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .fc-cifras > div { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 12px; }
  .fc-cifras b { font-size: 15px; flex: none; }
  .fc-cifras span { font-size: 12px; }
  .fc-pasos li { font-size: 10.5px; }
}

/* Secciones plegadas según la etapa de la venta (plegable() en ficha-cliente.js) */
.fc-plegado {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 11px 0; border: 0; border-top: 1px solid var(--linea, rgba(20, 21, 25, .07)); background: none;
  text-align: left; cursor: pointer; color: var(--tinta, #141519); font: inherit;
}
.fc-plegado > span { display: grid; gap: 1px; min-width: 0; }
.fc-plegado b { font-size: 13px; font-weight: 600; }
.fc-plegado small { font-size: 12px; color: var(--tinta-3, #6B6E79); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-plegado svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--tinta-3, #6B6E79); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fc-plegado:hover svg { stroke: var(--tinta, #141519); }
.fc-plegado:focus-visible { outline: 2px solid var(--tinta, #141519); outline-offset: 2px; border-radius: 8px; }
