/*
 * Nota de crédito CFDI 4.0 — Crédito y cobranza. Página informativa primero: qué es una nota de crédito, para qué
 * sirve, cómo se relaciona con la factura y, después, cómo se gestiona en Evidence ERP.
 * Concepto: "tinta roja". Azul marino = la factura original (CFDI de Ingreso); rojo contable = la nota de crédito
 * (CFDI de Egreso), como las cifras que disminuyen en un libro; dorado = el UUID y la clave 01 que los relacionan.
 * El hero son los dos comprobantes del ejemplo práctico ($11,600 y una bonificación de $1,000 más IVA). Los modos
 * (Factura original, Nota de crédito, Relación 01) son radios (sin JS ni :has): resaltan un comprobante o encienden el
 * UUID relacionado y el importe después del ajuste. Sin líneas sobre la tarjeta.
 * Display Arvo (slab de comprobante) con cifras tabulares; cuerpo Inter.
 * Movimiento: al cargar, la foto se acerca; al cambiar de modo, el comprobante se resalta y el mensaje entra. Al hacer
 * scroll, las cadenas avanzan, las líneas del ejemplo se asientan y los pasos suben, solo donde el navegador lo
 * soporta y sin movimiento reducido.
 */
[data-function-layout="nota-credito"] {
    --ne-ink: #041f49;
    --ne-ink-tint: #e4eaf4;
    --ne-red: #b3192b;
    --ne-red-tint: #fbe8ea;
    --ne-gold: #fac63f;
    --ne-gold-tint: #fff3cf;
    --ne-paper: #f2f4f7;
    --ne-rule: #e0e5ea;
    --ne-line: #c3ccd3;
    --ne-muted: #4a5260;
    --ne-text: #1f2937;
    --ne-display: "Arvo", Rockwell, Georgia, serif;
    --ne-code: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --ne-ease: cubic-bezier(.2, .7, .2, 1);
    font-variant-numeric: lining-nums;
}
[data-function-layout="nota-credito"] .cv-hero-title,
[data-function-layout="nota-credito"] .cv-section-title,
[data-function-layout="nota-credito"] .cv-form-title { font-family: var(--ne-display); font-weight: 700; letter-spacing: -.01em; }
[data-function-layout="nota-credito"] .cv-section-title { font-size: clamp(1.8rem, 2.6vw, 2.45rem); line-height: 1.15; }
[data-function-layout="nota-credito"] .ne-narrow { max-width: 50rem; }
[data-function-layout="nota-credito"] .ne-subtitle { margin: 2.4rem 0 0; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.35rem; font-weight: 700; }

/* ---------- Superficies ---------- */
[data-function-layout="nota-credito"] .ne-paper { background: var(--ne-paper); }
[data-function-layout="nota-credito"] .ne-navy { background: var(--ne-ink); color: #fff; }
[data-function-layout="nota-credito"] .ne-navy .cv-section-title { color: #fff; }
[data-function-layout="nota-credito"] .ne-split { display: grid; gap: 2.5rem 4rem; align-items: center; }
[data-function-layout="nota-credito"] .ne-split--top { align-items: start; }
[data-function-layout="nota-credito"] .ne-lead { max-width: 42rem; margin-top: 1.25rem; color: var(--ne-text); font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); line-height: 1.75; }
/* El dato enmascarado: barra rayada en lugar del RFC. */
[data-function-layout="nota-credito"] .ne-mask { display: inline-block; width: 6.5em; height: .9em; border-radius: 2px; background: repeating-linear-gradient(135deg, currentColor 0 2px, transparent 2px 5px); opacity: .55; vertical-align: -.1em; }

/* ---------- Hero ---------- */
[data-function-layout="nota-credito"] #inicio { background: linear-gradient(155deg, #041f49 0%, #0a2c5c 70%, #0f3870 100%); color: #fff; }
[data-function-layout="nota-credito"] #inicio .function-hero__media img { object-position: 72% 50%; }
[data-function-layout="nota-credito"] #inicio .function-hero__overlay {
    background:
        linear-gradient(180deg, transparent 65%, rgb(4 31 73 / .7) 100%),
        linear-gradient(90deg, rgb(4 31 73 / .97) 0%, rgb(4 31 73 / .9) 42%, rgb(10 44 92 / .72) 70%, rgb(15 56 112 / .55) 100%);
}
[data-function-layout="nota-credito"] .rh-hero-layout { position: relative; z-index: 1; align-items: center; }
[data-function-layout="nota-credito"] #inicio .cv-hero-title { max-width: 19ch; color: #fff; font-size: clamp(2.1rem, 3.5vw, 3.1rem); line-height: 1.1; }
[data-function-layout="nota-credito"] #inicio .cv-hero-description { max-width: 36rem; margin-top: 1.5rem; color: rgb(255 255 255 / .86); font-size: 1.02rem; }
[data-function-layout="nota-credito"] .ne-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
[data-function-layout="nota-credito"] #inicio .cv-primary-button { border-color: var(--ne-gold); background: var(--ne-gold); color: var(--ne-ink); box-shadow: 0 14px 30px rgb(0 0 0 / .3); text-decoration: none; }
[data-function-layout="nota-credito"] #inicio .cv-primary-button:hover,
[data-function-layout="nota-credito"] #inicio .cv-primary-button:focus-visible { background: #ffd666; }
[data-function-layout="nota-credito"] #inicio .cv-primary-button:focus-visible { outline: 3px solid var(--ne-gold); outline-offset: 3px; }

/* Los dos comprobantes del ejemplo. */
[data-function-layout="nota-credito"] .ne-pair { position: relative; justify-self: center; width: 100%; max-width: 36rem; min-width: 0; margin: 0; padding: 1.1rem 1.1rem .9rem; overflow: hidden; border-radius: .6rem; background: #fff; box-shadow: 0 24px 50px rgb(0 0 0 / .35); color: var(--ne-text); font-variant-numeric: lining-nums tabular-nums; }
[data-function-layout="nota-credito"] .ne-pair .cv-icon { width: 15px; height: 15px; flex-basis: 15px; flex-shrink: 0; }
[data-function-layout="nota-credito"] .ne-pair p,
[data-function-layout="nota-credito"] .ne-pair dl,
[data-function-layout="nota-credito"] .ne-pair dd { margin: 0; }
[data-function-layout="nota-credito"] .ne-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
[data-function-layout="nota-credito"] .ne-pair .ne-pair__title { display: flex; align-items: center; gap: .45rem; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.08rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-pair__title .cv-icon { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-pair .ne-modes { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .75rem; }
[data-function-layout="nota-credito"] .ne-mode { padding: .32rem .7rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--ne-rule); color: var(--ne-ink); cursor: pointer; font-size: .74rem; font-weight: 800; transition: background-color .2s, box-shadow .2s, color .2s; }
[data-function-layout="nota-credito"] .ne-mode:hover { box-shadow: inset 0 0 0 1px var(--ne-line); }
[data-function-layout="nota-credito"] .ne-docs { display: grid; grid-template-columns: minmax(0, 1fr) 2.2rem minmax(0, 1fr); align-items: center; margin-top: .9rem; }
[data-function-layout="nota-credito"] .ne-doc { display: grid; gap: .5rem; min-width: 0; padding: .75rem .75rem .7rem; border-radius: .4rem; background: var(--ne-paper); transition: opacity .25s, box-shadow .25s, background-color .25s; }
[data-function-layout="nota-credito"] .ne-doc--i { box-shadow: inset 0 3px 0 var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-doc--e { box-shadow: inset 0 3px 0 var(--ne-red); }
[data-function-layout="nota-credito"] .ne-pair .ne-doc__head { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); align-items: center; gap: .5rem; font-size: .66rem; font-weight: 700; line-height: 1.25; color: var(--ne-muted); }
[data-function-layout="nota-credito"] .ne-doc__head b { display: block; color: var(--ne-ink); font-size: .76rem; font-weight: 800; }
[data-function-layout="nota-credito"] .ne-doc__type { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .3rem; color: #fff; font-family: var(--ne-display); font-size: 1.3rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-doc--i .ne-doc__type { background: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-doc--e .ne-doc__type { background: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-doc__rows { display: grid; gap: .2rem; }
[data-function-layout="nota-credito"] .ne-doc__rows > div { display: flex; justify-content: space-between; gap: .4rem; font-size: .74rem; }
[data-function-layout="nota-credito"] .ne-doc__rows dt { color: var(--ne-muted); font-weight: 600; }
[data-function-layout="nota-credito"] .ne-doc__rows dd { color: var(--ne-ink); font-weight: 700; white-space: nowrap; }
[data-function-layout="nota-credito"] .ne-doc--e .ne-doc__rows dd { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-doc__rows > .ne-doc__total { margin-top: .15rem; padding-top: .3rem; border-top: 1.5px solid var(--ne-line); }
[data-function-layout="nota-credito"] .ne-doc__total dt { color: var(--ne-ink); font-weight: 800; }
[data-function-layout="nota-credito"] .ne-doc__total dd { font-family: var(--ne-display); font-size: 1rem; }
[data-function-layout="nota-credito"] .ne-pair .ne-doc__meta { display: grid; padding: .3rem .45rem; border-radius: .3rem; background: #fff; font-size: .7rem; line-height: 1.3; transition: background-color .25s, box-shadow .25s; }
[data-function-layout="nota-credito"] .ne-doc__meta small { color: var(--ne-muted); font-size: .6rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-doc__meta b { color: var(--ne-ink); font-family: var(--ne-display); font-size: .82rem; }
[data-function-layout="nota-credito"] .ne-rel { display: flex; align-items: center; color: var(--ne-line); }
[data-function-layout="nota-credito"] .ne-rel i { flex: 1; height: 0; border-top: 2px dashed var(--ne-line); transition: border-color .25s; }
[data-function-layout="nota-credito"] .ne-rel b { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 1.6rem; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ne-line); color: var(--ne-muted); font-family: var(--ne-display); font-size: .68rem; transition: background-color .25s, box-shadow .25s, color .25s; }
[data-function-layout="nota-credito"] .ne-pair .ne-net { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin-top: .7rem; padding: .5rem .7rem; border-radius: .4rem; background: var(--ne-ink); color: rgb(255 255 255 / .82); font-size: .74rem; font-weight: 700; opacity: .18; transition: opacity .3s; }
[data-function-layout="nota-credito"] .ne-net b { color: #fff; font-family: var(--ne-display); font-size: 1.15rem; white-space: nowrap; }
[data-function-layout="nota-credito"] .ne-pair .ne-status { min-height: 2.8em; margin-top: .75rem; color: var(--ne-ink); font-size: .76rem; font-weight: 700; line-height: 1.4; }
[data-function-layout="nota-credito"] .ne-s { display: none; }
[data-function-layout="nota-credito"] .ne-pair figcaption { margin-top: .4rem; color: var(--ne-muted); font-size: .66rem; line-height: 1.4; }

/* El modo elegido: su botón, el comprobante que resalta y su mensaje. Relación 01 enciende el UUID y el importe neto. */
[data-function-layout="nota-credito"] #ne-m-0:checked ~ .ne-modes .ne-mode--0,
[data-function-layout="nota-credito"] #ne-m-1:checked ~ .ne-modes .ne-mode--1,
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-modes .ne-mode--2 { background: var(--ne-ink); box-shadow: none; color: #fff; }
[data-function-layout="nota-credito"] #ne-m-0:checked ~ .ne-docs .ne-doc--e,
[data-function-layout="nota-credito"] #ne-m-1:checked ~ .ne-docs .ne-doc--i { opacity: .4; }
[data-function-layout="nota-credito"] #ne-m-0:checked ~ .ne-docs .ne-doc--i { background: var(--ne-ink-tint); box-shadow: inset 0 3px 0 var(--ne-ink), inset 0 0 0 1.5px var(--ne-ink); }
[data-function-layout="nota-credito"] #ne-m-1:checked ~ .ne-docs .ne-doc--e { background: var(--ne-red-tint); box-shadow: inset 0 3px 0 var(--ne-red), inset 0 0 0 1.5px var(--ne-red); }
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-docs .ne-rel i { border-top-style: solid; border-top-color: var(--ne-gold); }
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-docs .ne-rel b { background: var(--ne-gold); box-shadow: none; color: var(--ne-ink); }
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-docs .ne-doc__uuid { background: var(--ne-gold-tint); box-shadow: inset 3px 0 0 var(--ne-gold); }
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-net { opacity: 1; }
[data-function-layout="nota-credito"] #ne-m-0:checked ~ .ne-status .ne-s--0,
[data-function-layout="nota-credito"] #ne-m-1:checked ~ .ne-status .ne-s--1,
[data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-status .ne-s--2 { display: inline; }
[data-function-layout="nota-credito"] #ne-m-0:focus-visible ~ .ne-modes .ne-mode--0,
[data-function-layout="nota-credito"] #ne-m-1:focus-visible ~ .ne-modes .ne-mode--1,
[data-function-layout="nota-credito"] #ne-m-2:focus-visible ~ .ne-modes .ne-mode--2 { outline: 3px solid var(--ne-gold); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
    [data-function-layout="nota-credito"] #inicio .function-hero__media img { animation: ne-zoom 18s ease-out both; }
    /* Al cambiar de modo, el mensaje entra. */
    [data-function-layout="nota-credito"] .ne-s { animation: ne-tick .3s var(--ne-ease) backwards; }
}

/* ---------- 1. Qué es: la respuesta rápida y los tipos I y E ---------- */
[data-function-layout="nota-credito"] .ne-key { margin-top: 1.4rem; padding: 1rem 1.1rem; border-radius: .5rem; background: var(--ne-gold-tint); box-shadow: inset 4px 0 0 var(--ne-gold); }
[data-function-layout="nota-credito"] .ne-key p { margin: 0; color: var(--ne-text); font-size: 1rem; line-height: 1.6; }
[data-function-layout="nota-credito"] .ne-key .ne-key__title { display: flex; align-items: center; gap: .45rem; margin-bottom: .35rem; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.15rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-key__title .cv-icon { width: 18px; height: 18px; flex-basis: 18px; color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 0; }
[data-function-layout="nota-credito"] .ne-types p { margin: 0; }
[data-function-layout="nota-credito"] .ne-types .ne-types__tile { display: grid; align-content: start; gap: .2rem; padding: 1.1rem 1.1rem 1.2rem; border-radius: .5rem; background: var(--ne-paper); color: var(--ne-muted); font-size: .95rem; font-weight: 600; line-height: 1.45; }
[data-function-layout="nota-credito"] .ne-types__tile span { font-family: var(--ne-display); font-size: clamp(4rem, 7vw, 5.5rem); font-weight: 700; line-height: 1; }
[data-function-layout="nota-credito"] .ne-types__tile--i span { color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-types__tile--e span { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-types__tile b { color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.25rem; }
[data-function-layout="nota-credito"] .ne-types__tile--i { box-shadow: inset 0 4px 0 var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-types__tile--e { box-shadow: inset 0 4px 0 var(--ne-red); }
[data-function-layout="nota-credito"] .ne-types .ne-types__rel { display: grid; grid-column: 1 / -1; grid-template-columns: 3.2rem minmax(0, 1fr); align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: .5rem; background: var(--ne-ink); color: #fff; font-family: var(--ne-display); font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
[data-function-layout="nota-credito"] .ne-types__rel b { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--ne-gold); color: var(--ne-ink); font-size: 1.3rem; }
[data-function-layout="nota-credito"] .ne-types__rel small { display: block; color: rgb(255 255 255 / .7); font-family: var(--ne-code); font-size: .76rem; font-weight: 600; }

/* ---------- 2. Para qué sirve ---------- */
[data-function-layout="nota-credito"] .ne-uses { display: grid; gap: 1.5rem 3rem; margin: 2.25rem 0 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-uses li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; align-items: start; padding-top: 1.25rem; border-top: 3px solid var(--ne-red); }
[data-function-layout="nota-credito"] .ne-uses__icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .45rem; background: var(--ne-red-tint); color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-uses__icon .cv-icon { width: 22px; height: 22px; flex-basis: 22px; }
[data-function-layout="nota-credito"] .ne-uses p { margin: .3rem 0 0; color: var(--ne-ink); font-size: 1.1rem; font-weight: 600; line-height: 1.5; }

/* ---------- 3. Nota de crédito vs. cancelación ---------- */
[data-function-layout="nota-credito"] .ne-versus { display: grid; gap: 1rem; margin-top: 1.6rem; }
[data-function-layout="nota-credito"] .ne-versus p { margin: 0; }
[data-function-layout="nota-credito"] .ne-versus .ne-versus__case { min-height: 6.4rem; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: .1rem 1.1rem; padding: 1rem 1.2rem; border-radius: .5rem; background: var(--ne-paper); color: var(--ne-muted); font-size: 1rem; font-weight: 600; line-height: 1.45; }
[data-function-layout="nota-credito"] .ne-versus__case b { align-self: end; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.25rem; }
[data-function-layout="nota-credito"] .ne-versus__case--note b { color: var(--ne-red); }
/* Las miniaturas: la factura sigue y la nota se le une; en la cancelación, la factura queda tachada. */
[data-function-layout="nota-credito"] .ne-mini { position: relative; display: grid; grid-row: 1 / 3; place-items: center; width: 2.9rem; height: 3.6rem; border-radius: .3rem; background: #fff; font-family: var(--ne-display); font-size: 1.5rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-mini--i { box-shadow: inset 0 4px 0 var(--ne-ink), 0 6px 14px rgb(4 31 73 / .12); color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-mini--e { grid-column: 1; margin-left: 1.9rem; margin-top: .9rem; box-shadow: inset 0 4px 0 var(--ne-red), 0 6px 14px rgb(4 31 73 / .16); color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-versus__case--note .ne-mini--i { grid-column: 1; margin-right: 1.9rem; margin-bottom: .9rem; }
[data-function-layout="nota-credito"] .ne-versus .ne-versus__case--note { grid-template-columns: 4.8rem minmax(0, 1fr); }
[data-function-layout="nota-credito"] .ne-mini--void { color: var(--ne-muted); }
[data-function-layout="nota-credito"] .ne-mini--void::after { content: ""; position: absolute; top: 50%; left: -.3rem; right: -.3rem; border-top: 3px solid var(--ne-red); transform: rotate(-52deg); }
[data-function-layout="nota-credito"] .ne-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
[data-function-layout="nota-credito"] .ne-table--3 { margin-top: 1.4rem; }
[data-function-layout="nota-credito"] .ne-table thead th { padding: .8rem 1rem; border-bottom: 3px solid var(--ne-rule); color: var(--ne-muted); font-size: .95rem; font-weight: 700; text-align: left; }
[data-function-layout="nota-credito"] .ne-table thead th:nth-child(2) { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-table--3 thead th:first-child { width: 24%; }
[data-function-layout="nota-credito"] .ne-table tbody th,
[data-function-layout="nota-credito"] .ne-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--ne-rule); font-size: 1.02rem; line-height: 1.5; text-align: left; vertical-align: top; }
[data-function-layout="nota-credito"] .ne-table tbody th { color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.1rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-table td { color: var(--ne-muted); font-weight: 500; }

/* ---------- 4. La relación: el XML y la cadena fiscal ---------- */
[data-function-layout="nota-credito"] .ne-xml { min-width: 0; margin: 0; padding: 1.2rem 1.3rem 1rem; border-radius: .55rem; background: var(--ne-ink); box-shadow: 0 18px 40px rgb(4 31 73 / .2); }
[data-function-layout="nota-credito"] .ne-xml pre { margin: 0; overflow-x: auto; color: rgb(255 255 255 / .8); font-family: var(--ne-code); font-size: .84rem; line-height: 1.75; white-space: pre; }
[data-function-layout="nota-credito"] .ne-xml__tag { color: #9ec3ff; }
[data-function-layout="nota-credito"] .ne-xml__attr { color: rgb(255 255 255 / .62); }
[data-function-layout="nota-credito"] .ne-xml__e { color: #ff9aa5; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-xml__key { color: var(--ne-gold); font-weight: 700; }
[data-function-layout="nota-credito"] .ne-xml .ne-mask { width: 5.5em; color: #fff; }
[data-function-layout="nota-credito"] .ne-xml figcaption { margin-top: .8rem; color: rgb(255 255 255 / .62); font-size: .78rem; line-height: 1.4; }
[data-function-layout="nota-credito"] .ne-flow { grid-column: 1 / -1; padding: 1.1rem 1.2rem; border-radius: .5rem; background: #fff; box-shadow: inset 4px 0 0 var(--ne-gold); }
[data-function-layout="nota-credito"] .ne-flow p { margin: 0; }
[data-function-layout="nota-credito"] .ne-flow .ne-flow__title { display: flex; align-items: center; gap: .45rem; margin-bottom: .8rem; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.15rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-flow__title .cv-icon { width: 17px; height: 17px; flex-basis: 17px; color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-flow ol { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-flow li { position: relative; padding: .4rem .8rem; border-radius: 999px; background: var(--ne-ink-tint); color: var(--ne-ink); font-family: var(--ne-display); font-size: .98rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-flow li:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -1.45rem; width: .55rem; height: .55rem; border-top: 2px solid var(--ne-red); border-right: 2px solid var(--ne-red); transform: translateY(-50%) rotate(45deg); }
/* En la relación fiscal: el UUID en dorado, el Egreso en rojo y la clave 01 en azul marino. */
[data-function-layout="nota-credito"] .ne-flow:not(.ne-flow--erp) .ne-flow__node--1 { background: var(--ne-gold-tint); box-shadow: inset 0 0 0 1.5px var(--ne-gold); }
[data-function-layout="nota-credito"] .ne-flow:not(.ne-flow--erp) .ne-flow__node--2,
[data-function-layout="nota-credito"] .ne-flow--erp .ne-flow__node--1 { background: var(--ne-red-tint); color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-flow li:last-child { background: var(--ne-ink); color: #fff; }
[data-function-layout="nota-credito"] .ne-flow ol + p { margin-top: .8rem; color: var(--ne-text); font-size: 1rem; line-height: 1.6; }
[data-function-layout="nota-credito"] .ne-flow--erp { margin-top: 1.6rem; }

/* ---------- 5. Los pasos ---------- */
[data-function-layout="nota-credito"] .ne-steps { display: grid; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-steps li { display: grid; align-content: start; gap: .55rem; padding: 1.1rem 1.2rem; border-radius: .5rem; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .18); }
[data-function-layout="nota-credito"] .ne-steps__head { display: flex; align-items: center; justify-content: space-between; margin: 0; }
[data-function-layout="nota-credito"] .ne-steps__head i { color: var(--ne-gold); font-family: var(--ne-display); font-size: 2.1rem; font-style: normal; font-weight: 700; line-height: 1; }
[data-function-layout="nota-credito"] .ne-steps__icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .4rem; background: var(--ne-gold); color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-steps__icon .cv-icon { width: 17px; height: 17px; flex-basis: 17px; }
[data-function-layout="nota-credito"] .ne-steps b { color: #fff; font-family: var(--ne-display); font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
[data-function-layout="nota-credito"] .ne-steps .ne-steps__text { margin: 0; color: rgb(255 255 255 / .82); font-size: .98rem; line-height: 1.5; }

/* ---------- 6. El ejemplo en cifras y la diferencia con el REP ---------- */
[data-function-layout="nota-credito"] .ne-ledger { display: grid; gap: .1rem; margin: 0; padding: 1.3rem 1.4rem 1.1rem; border-radius: .5rem; background: #fff; box-shadow: inset 0 4px 0 var(--ne-ink), 0 1px 0 var(--ne-rule), 0 16px 36px rgb(4 31 73 / .1); font-variant-numeric: lining-nums tabular-nums; }
[data-function-layout="nota-credito"] .ne-ledger p { margin: 0; }
[data-function-layout="nota-credito"] .ne-ledger .ne-ledger__line { display: flex; align-items: baseline; gap: .6rem; padding: .45rem 0; color: var(--ne-ink); font-size: 1rem; font-weight: 600; }
/* El guion de puntos entre concepto e importe. */
[data-function-layout="nota-credito"] .ne-ledger__line span { display: flex; flex: 1; align-items: baseline; gap: .6rem; }
[data-function-layout="nota-credito"] .ne-ledger__line span::after { content: ""; flex: 1; border-bottom: 2px dotted var(--ne-line); }
[data-function-layout="nota-credito"] .ne-ledger__line b { font-family: var(--ne-display); font-size: 1.15rem; white-space: nowrap; }
[data-function-layout="nota-credito"] .ne-ledger .ne-ledger__line--detail { padding: .2rem 0 .2rem 1.2rem; color: var(--ne-muted); font-size: .92rem; }
[data-function-layout="nota-credito"] .ne-ledger__line--detail b { font-size: 1rem; }
[data-function-layout="nota-credito"] .ne-ledger .ne-ledger__line--e { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-ledger .ne-ledger__line--net { margin-top: .4rem; padding-top: .7rem; border-top: 4px double var(--ne-ink); font-weight: 800; }
[data-function-layout="nota-credito"] .ne-ledger__line--net span::after { border-bottom-color: transparent; }
[data-function-layout="nota-credito"] .ne-ledger__line--net b { font-size: 1.5rem; }
[data-function-layout="nota-credito"] .ne-ledger figcaption { margin-top: .5rem; color: var(--ne-muted); font-size: .8rem; font-style: italic; }
[data-function-layout="nota-credito"] .ne-rep { grid-column: 1 / -1; display: grid; gap: .8rem 3rem; padding: 1.4rem 1.5rem; border-radius: .55rem; background: var(--ne-paper); }
[data-function-layout="nota-credito"] .ne-rep .ne-rep__title { margin: 0; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.4rem; font-weight: 700; line-height: 1.25; }
[data-function-layout="nota-credito"] .ne-rep .ne-rep__text { max-width: 44rem; margin: 0; color: var(--ne-text); font-size: 1.05rem; line-height: 1.7; }
[data-function-layout="nota-credito"] .ne-rep__pair { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.6rem; align-self: center; }
/* El signo de "no es igual" entre los dos comprobantes. */
[data-function-layout="nota-credito"] .ne-rep__pair::before { content: "≠"; position: absolute; top: 50%; left: 50%; color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.8rem; font-weight: 700; line-height: 1; transform: translate(-50%, -50%); }
[data-function-layout="nota-credito"] .ne-rep .ne-rep__side { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); align-items: center; gap: .7rem; margin: 0; padding: .9rem 1rem; border-radius: .45rem; background: #fff; color: var(--ne-muted); font-size: .92rem; font-weight: 600; line-height: 1.35; }
[data-function-layout="nota-credito"] .ne-rep__side b { display: block; font-family: var(--ne-display); font-size: 1.12rem; }
[data-function-layout="nota-credito"] .ne-rep__side .cv-icon { box-sizing: content-box; width: 18px; height: 18px; padding: .55rem; border-radius: .4rem; }
[data-function-layout="nota-credito"] .ne-rep__side--0 { box-shadow: inset 0 3px 0 var(--ne-red); }
[data-function-layout="nota-credito"] .ne-rep__side--0 b { color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-rep__side--0 .cv-icon { background: var(--ne-red-tint); color: var(--ne-red); }
[data-function-layout="nota-credito"] .ne-rep__side--1 { box-shadow: inset 0 3px 0 var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-rep__side--1 b { color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-rep__side--1 .cv-icon { background: var(--ne-ink-tint); color: var(--ne-ink); }

/* ---------- 7. En Evidence ERP ---------- */
[data-function-layout="nota-credito"] .ne-can { display: grid; gap: 1rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-can li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); align-content: start; gap: .3rem .9rem; padding: 1.1rem 1.2rem; border-radius: .5rem; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ne-rule); }
[data-function-layout="nota-credito"] .ne-can__icon { display: grid; grid-row: span 2; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .45rem; background: var(--ne-ink); color: var(--ne-gold); }
[data-function-layout="nota-credito"] .ne-can__icon .cv-icon { width: 18px; height: 18px; flex-basis: 18px; }
[data-function-layout="nota-credito"] .ne-can b { color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.12rem; line-height: 1.3; }
[data-function-layout="nota-credito"] .ne-can p { margin: 0; color: var(--ne-muted); font-size: .98rem; line-height: 1.5; }

/* ---------- 8. Errores comunes ---------- */
[data-function-layout="nota-credito"] .ne-mistakes { display: grid; gap: .8rem 2.5rem; margin: 1.8rem 0 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-mistakes li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); align-items: start; gap: .8rem; padding: .9rem 1rem; border-radius: .45rem; background: var(--ne-red-tint); color: var(--ne-ink); font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
[data-function-layout="nota-credito"] .ne-mistakes .cv-icon { box-sizing: content-box; width: 18px; height: 18px; padding: .3rem; color: var(--ne-red); stroke-width: 2.2; }

/* ---------- 9. Para qué empresas ---------- */
[data-function-layout="nota-credito"] .ne-fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-fit li { display: grid; align-content: start; gap: .7rem; padding: 1.1rem; border-radius: .5rem; background: #fff; box-shadow: inset 0 4px 0 var(--ne-ink); color: var(--ne-ink); font-family: var(--ne-display); font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
[data-function-layout="nota-credito"] .ne-fit li:first-child { box-shadow: inset 0 4px 0 var(--ne-red); }
[data-function-layout="nota-credito"] .ne-fit .cv-icon { box-sizing: content-box; width: 20px; height: 20px; padding: .55rem; border-radius: .45rem; background: var(--ne-ink-tint); color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-fit li:first-child .cv-icon { background: var(--ne-red-tint); color: var(--ne-red); }

/* ---------- Fuentes ---------- */
[data-function-layout="nota-credito"] .ne-sources { display: grid; gap: .8rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
[data-function-layout="nota-credito"] .ne-sources a { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: .8rem; align-items: start; height: 100%; padding: 1rem 1.1rem; border-radius: .5rem; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ne-rule); color: var(--ne-ink); text-decoration: none; transition: box-shadow .2s; }
[data-function-layout="nota-credito"] .ne-sources a:hover { box-shadow: inset 0 0 0 2px var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-sources a:focus-visible { outline: 3px solid var(--ne-ink); outline-offset: 3px; }
[data-function-layout="nota-credito"] .ne-sources .cv-icon { box-sizing: content-box; width: 18px; height: 18px; padding: .5rem; border-radius: .45rem; background: var(--ne-ink-tint); color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-sources b { display: block; font-family: var(--ne-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
[data-function-layout="nota-credito"] .ne-sources small { display: block; margin-top: .25rem; color: var(--ne-muted); font-size: .9rem; font-weight: 500; line-height: 1.45; }

/* ---------- Contenido relacionado ---------- */
[data-function-layout="nota-credito"] .ne-related { display: grid; gap: .8rem; margin-top: 1.6rem; }
[data-function-layout="nota-credito"] .ne-related__link { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1.1rem 1.2rem; border-radius: .55rem; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ne-ink); color: var(--ne-ink); text-decoration: none; transition: box-shadow .2s; }
[data-function-layout="nota-credito"] .ne-related__link:hover { box-shadow: inset 0 0 0 2.5px var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-related__link:focus-visible { outline: 3px solid var(--ne-ink); outline-offset: 3px; }
[data-function-layout="nota-credito"] .ne-related__icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: .45rem; background: var(--ne-ink-tint); color: var(--ne-ink); }
[data-function-layout="nota-credito"] .ne-related__icon .cv-icon { width: 22px; height: 22px; flex-basis: 22px; }
[data-function-layout="nota-credito"] .ne-related__link b { display: block; font-family: var(--ne-display); font-size: 1.1rem; font-weight: 700; }
[data-function-layout="nota-credito"] .ne-related__link small { display: block; margin-top: .2rem; color: var(--ne-muted); font-size: .92rem; font-weight: 500; line-height: 1.45; }
[data-function-layout="nota-credito"] .ne-related__go .cv-icon { width: 20px; height: 20px; flex-basis: 20px; }

/* ---------- Entradas al hacer scroll: una distinta por figura ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        /* Las cadenas avanzan. */
        [data-function-layout="nota-credito"] .ne-flow li { animation: ne-from-left linear both; animation-timeline: view(); animation-range: entry 10% cover 30%; }
        /* Las líneas del ejemplo se asientan una a una. */
        [data-function-layout="nota-credito"] .ne-ledger__line { animation: ne-rise linear both; animation-timeline: view(); animation-range: entry 5% cover 25%; }
        /* Los pasos suben. */
        [data-function-layout="nota-credito"] .ne-steps li { animation: ne-rise linear both; animation-timeline: view(); animation-range: entry 5% cover 25%; }
    }
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    [data-function-layout="nota-credito"] .ne-uses,
    [data-function-layout="nota-credito"] .ne-related,
    [data-function-layout="nota-credito"] .ne-mistakes,
    [data-function-layout="nota-credito"] .ne-can,
    [data-function-layout="nota-credito"] .ne-versus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [data-function-layout="nota-credito"] .ne-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [data-function-layout="nota-credito"] .ne-sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    [data-function-layout="nota-credito"] .rh-hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    [data-function-layout="nota-credito"] .ne-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [data-function-layout="nota-credito"] .ne-related,
    [data-function-layout="nota-credito"] .ne-can,
    [data-function-layout="nota-credito"] .ne-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    [data-function-layout="nota-credito"] .ne-uses { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2rem; }
    [data-function-layout="nota-credito"] .ne-rep { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    [data-function-layout="nota-credito"] .ne-rep__title,
    [data-function-layout="nota-credito"] .ne-rep__text { grid-column: 1; }
    [data-function-layout="nota-credito"] .ne-rep__pair { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 1023px) {
    [data-function-layout="nota-credito"] #inicio .function-hero__overlay { background: linear-gradient(180deg, rgb(4 31 73 / .95) 0%, rgb(4 31 73 / .86) 50%, rgb(10 44 92 / .7) 100%); }
    [data-function-layout="nota-credito"] #inicio .cv-hero-title { max-width: none; }
}
@media (max-width: 767px) {
    [data-function-layout="nota-credito"] .ne-hero__actions > * { width: 100%; }
    [data-function-layout="nota-credito"] .ne-pair { padding: .9rem .8rem .8rem; }
    [data-function-layout="nota-credito"] .ne-docs { grid-template-columns: minmax(0, 1fr); }
    [data-function-layout="nota-credito"] .ne-rel { height: 1.9rem; flex-direction: column; }
    [data-function-layout="nota-credito"] .ne-rel i { flex: 1; width: 0; height: auto; border-top: 0; border-left: 2px dashed var(--ne-line); }
    [data-function-layout="nota-credito"] #ne-m-2:checked ~ .ne-docs .ne-rel i { border-left-style: solid; border-left-color: var(--ne-gold); }
    [data-function-layout="nota-credito"] .ne-rel b { width: 1.5rem; height: 1.5rem; flex-basis: 1.5rem; }
    [data-function-layout="nota-credito"] .ne-doc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; gap: .45rem .7rem; }
    [data-function-layout="nota-credito"] .ne-doc__head,
    [data-function-layout="nota-credito"] .ne-doc__meta { grid-column: 1; }
    [data-function-layout="nota-credito"] .ne-doc__rows { grid-column: 2; grid-row: 1 / 3; }
    [data-function-layout="nota-credito"] .ne-xml { padding: 1rem; }
    [data-function-layout="nota-credito"] .ne-xml pre { font-size: .66rem; }
    [data-function-layout="nota-credito"] .ne-types__tile span { font-size: 3.4rem; }
    [data-function-layout="nota-credito"] .ne-flow ol { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
    [data-function-layout="nota-credito"] .ne-flow li:not(:last-child)::after { top: auto; right: auto; bottom: -.95rem; left: 1.2rem; transform: rotate(135deg); }
    [data-function-layout="nota-credito"] .ne-ledger { padding: 1.1rem 1rem .9rem; }
    [data-function-layout="nota-credito"] .ne-ledger .ne-ledger__line { font-size: .92rem; }
    [data-function-layout="nota-credito"] .ne-rep { padding: 1.1rem 1rem; }
    [data-function-layout="nota-credito"] .ne-rep__pair { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
    [data-function-layout="nota-credito"] .ne-rep .ne-rep__side { font-size: .9rem; }
    [data-function-layout="nota-credito"] .ne-table--3 thead { display: none; }
    [data-function-layout="nota-credito"] .ne-table--3,
    [data-function-layout="nota-credito"] .ne-table--3 tbody,
    [data-function-layout="nota-credito"] .ne-table--3 tr,
    [data-function-layout="nota-credito"] .ne-table--3 tbody th,
    [data-function-layout="nota-credito"] .ne-table--3 td { display: block; width: 100%; }
    [data-function-layout="nota-credito"] .ne-table--3 tr { padding: .75rem .25rem; border-bottom: 1px solid var(--ne-rule); }
    [data-function-layout="nota-credito"] .ne-table--3 tbody th,
    [data-function-layout="nota-credito"] .ne-table--3 td { padding: .3rem 0; border: 0; }
    [data-function-layout="nota-credito"] .ne-table--3 td::before { content: attr(data-label); display: block; color: var(--ne-muted); font-size: .8rem; font-weight: 700; }
    [data-function-layout="nota-credito"] .ne-related__link { grid-template-columns: 3rem minmax(0, 1fr); }
    [data-function-layout="nota-credito"] .ne-related__go { display: none; }
}

@keyframes ne-zoom { from { transform: scale(1.08); } }
@keyframes ne-tick { from { opacity: 0; transform: translateY(-.35rem); } }
@keyframes ne-rise { from { opacity: 0; transform: translateY(1rem); } }
@keyframes ne-from-left { from { opacity: 0; transform: translateX(-1.5rem); } }
