/* ==========================================================================
   Caso Alquileres (prefijo alq- para la página, jm- para el mapa de experiencia)
   Se apoya en las clases de case-visuals.css (nx-card, nxt-ph, nxh-shot, nxh-live).
   ========================================================================== */

/* ---------- Mapa de experiencia actual (journey map as-is) ---------- */
.jm { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jm__legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.jm__legend li { display: inline-flex; align-items: center; gap: 8px; }

.jm-chip { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 13px; line-height: 1.45; font-weight: 700; background: var(--primary-50); color: var(--primary-600); box-shadow: inset 0 0 0 1px var(--primary-200); }
.jm-chip--out { background: var(--white); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--secondary-200); font-weight: 600; }
.jm-chip--none { background: var(--white); color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-border); font-weight: 600; }

/* Móvil: una tarjeta por etapa, con cada fila rotulada */
.jm__stages { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.jm-st { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 16px; background: var(--white); border: 1px solid var(--border-soft); border-radius: var(--radius-12); }
.jm-st--hot { border-color: var(--primary-200); box-shadow: inset 4px 0 0 var(--primary-500); }
.jm-st__head { display: flex; align-items: center; gap: 12px; }
.jm-st__n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-500); color: var(--white); font-size: 14px; font-weight: 700; }
.jm-st--out .jm-st__n { background: var(--secondary-200); color: var(--secondary-900); }
.jm-st__name { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; color: var(--gray-900); }
.jm-c { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0; font-size: 14px; line-height: 1.5; color: var(--gray-900); }
.jm-k { margin: 0; font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.jm-c p { margin: 0; }
.jm-c p + p { margin-top: 6px; }
.jm-c--pain { color: var(--gray-900); }
.jm-c--emo { color: var(--text-muted); }
.jm-q { font-style: italic; color: var(--gray-900); }
.jm-src { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 1.6; font-weight: 700; letter-spacing: 0.02em; background: var(--secondary-100); color: var(--secondary-800); white-space: nowrap; }
.jm-big { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 4px; font-weight: 800; background: var(--danger-bg); color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-border); }
.jm-cover { display: flex; flex-wrap: wrap; gap: 6px; }
.jm-aside { color: var(--text-muted); font-size: 13px; }
.jm__rows { display: none; }
.jm__band { display: none; }

.jm__foot { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); max-width: 78ch; }

/* Escritorio: 7 columnas y 5 filas con rótulos a la izquierda */
@media (min-width: 768px) and (max-width: 1179px) {
  .jm__stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (min-width: 1180px) {
  .jm__grid { display: grid; grid-template-columns: 92px repeat(7, minmax(0, 1fr)); grid-template-rows: auto auto auto auto auto auto; column-gap: 10px; row-gap: 0; }
  .jm__band { display: flex; align-items: center; justify-content: center; grid-row: 1; grid-column: 4 / 7; margin: 0 0 6px; padding: 4px 8px; border-radius: 6px 6px 0 0; font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--primary-500); color: var(--white); text-align: center; }
  .jm__rows { display: grid; grid-row: 2 / 7; grid-column: 1; grid-template-rows: subgrid; margin: 0; padding: 0; list-style: none; }
  .jm__rows li { display: flex; align-items: flex-start; padding: 12px 8px 12px 0; font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); border-top: 1px solid var(--border-soft); }
  .jm__rows li:first-child { border-top: 0; align-items: center; padding-top: 12px; }
  .jm__stages { display: contents; }
  .jm-st { grid-row: 2 / 7; grid-template-rows: subgrid; display: grid; gap: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .jm-st--hot { box-shadow: none; border: 0; }
  .jm-st > * { padding: 12px 8px; border-top: 1px solid var(--border-soft); }
  .jm-st > .jm-st__head { border-top: 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .jm-st > .jm-st__head { padding-top: 12px; }
  .jm-st--hot > * { background: color-mix(in srgb, var(--primary-50) 55%, var(--white)); }
  .jm-st--hot > .jm-st__head { border-radius: 0; }
  .jm-st--out > * { background: color-mix(in srgb, var(--secondary-100) 35%, var(--white)); }
  .jm-st--out .jm-st__name, .jm-st--out .jm-c { color: var(--text-muted); }
  .jm-st__name { font-size: 15px; line-height: 1.25; }
  .jm-c { font-size: 13px; line-height: 1.5; }
  .jm-c .jm-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .jm-c--cover { justify-content: flex-start; }
  .jm-chip { font-size: 12px; }
}
@media (min-width: 1280px) {
  .jm__grid { column-gap: 12px; grid-template-columns: 104px repeat(7, minmax(0, 1fr)); }
}

/* ---------- Diagramas de flujo (task flow y user flow, SVG en línea) ---------- */
.fl-scroll { overflow-x: auto; margin-inline: -4px; padding: 4px; }
.fl-scroll:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; border-radius: 6px; }
.fl-svg { display: block; width: 100%; min-width: 880px; height: auto; font-family: var(--font); }
.fl-hint { margin: -8px 0 0; font-size: 13px; line-height: 1.4; color: var(--text-muted); }
@media (min-width: 920px) { .fl-hint { display: none; } }
.fl-mk { fill: var(--text-muted); }
.fl-e { fill: none; stroke: var(--text-muted); stroke-width: 1.6; stroke-linejoin: round; }
.fl-e--dash { stroke-dasharray: 6 4; }
.fl-e--dot { stroke-dasharray: 2 4; stroke-linecap: round; stroke: var(--primary-500); }
.fl-n { stroke-width: 1.4; }
.fl-n--step, .fl-n--screen { fill: var(--white); stroke: var(--secondary-200); }
.fl-n--dec { fill: var(--primary-50); stroke: var(--primary-200); }
.fl-n--start { fill: var(--primary-500); stroke: var(--primary-500); }
.fl-n--out { fill: color-mix(in srgb, var(--secondary-100) 50%, var(--white)); stroke: var(--secondary-200); stroke-dasharray: 5 4; }
.fl-chip { fill: var(--white); stroke: var(--secondary-200); stroke-dasharray: 4 3; stroke-width: 1.3; }
.fl-t { font-size: 13px; font-weight: 600; fill: var(--gray-900); }
.fl-t--start { fill: var(--white); }
.fl-t--dec { fill: var(--primary-700); }
.fl-t--chip { font-size: 12px; font-weight: 600; fill: var(--text-muted); }
.fl-l { font-size: 12px; font-weight: 700; fill: var(--text-muted); }
.fl-l--dot { fill: var(--primary-600); font-weight: 600; }
.fl-l--note { font-weight: 500; }
.fl-sc { font-size: 14px; font-weight: 700; fill: var(--gray-900); }
.fl-sc--out { fill: var(--text-muted); }
.fl-ss { font-size: 12px; font-weight: 500; fill: var(--text-muted); }
.fl-ss--s { font-size: 11px; }
.fl-sst { font-size: 12px; font-weight: 700; fill: var(--primary-600); }
.fl-st { fill: var(--primary-50); }
.fl-panel { fill: var(--white); stroke: var(--primary-500); stroke-width: 1.3; stroke-dasharray: 3 3; }
.fl-ps { font-size: 11px; font-weight: 700; fill: var(--primary-600); }
.fl-lg { font-size: 12px; font-weight: 500; fill: var(--gray-900); }
.fl-lg-h { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--text-muted); }

/* ---------- Matriz de la auditoría (tres plataformas) ---------- */
.aud-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.aud-s { display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.5; font-weight: 700; white-space: nowrap; }
.aud-s--bad { background: var(--danger-bg); color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-border); }
.aud-s--mid { background: var(--warning-50); color: var(--warning-800); box-shadow: inset 0 0 0 1px #ffe69c; }
.aud-s--ok { background: var(--success-bg); color: var(--success-text); box-shadow: inset 0 0 0 1px var(--success-border); }
.aud-s--na { background: var(--white); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--secondary-200); font-weight: 600; }
.aud-wrap { min-width: 0; }
.aud { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.aud th, .aud td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.aud thead th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.aud tbody th[scope="row"] { width: 26%; font-weight: 600; color: var(--gray-900); }
.aud td { width: 24.66%; }
.aud td .aud-s { display: block; width: fit-content; }
.aud-d { display: block; margin-top: 6px; color: var(--text-muted); }
.aud-grp th { padding: 20px 14px 10px; border-bottom: 2px solid var(--primary-200); background: none; }
.aud-grp__t { display: block; font-size: 15px; font-weight: 700; color: var(--primary-600); }
.aud-grp__s { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
@media (max-width: 899px) {
  .aud, .aud tbody, .aud tr, .aud th, .aud td { display: block; }
  .aud thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .aud tr:not(.aud-grp) { margin-bottom: 12px; padding: 6px 0; border: 1px solid var(--border-soft); border-radius: var(--radius-12); background: var(--white); }
  .aud tbody th[scope="row"] { width: auto; padding: 10px 14px 4px; border: 0; }
  .aud td { width: auto; padding: 6px 14px; border: 0; }
  .aud td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
  .aud-grp th { padding: 16px 0 10px; }
}

/* ---------- Grilla del test (tareas por participantes) ---------- */
.gt-people { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.gt-people li { display: inline-flex; align-items: baseline; gap: 6px; }
.gt-people b { font-weight: 700; color: var(--gray-900); }
.aud-legend .gt-lg { margin-left: 6px; font-size: 13px; color: var(--text-muted); }
.aud-legend li { display: inline-flex; align-items: center; margin-right: 8px; }
.gt { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.gt th, .gt td { padding: 12px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.gt thead th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.gt tbody th { width: 24%; font-weight: 600; color: var(--gray-900); }
.gt-code { display: inline-block; margin-right: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--primary-600); }
.gt td:not(.gt-read) { width: 9%; }
.gt-s { display: inline-block; min-width: 52px; text-align: center; }
.gt-d { display: block; margin-top: 4px; font-size: 11.5px; line-height: 1.3; color: var(--text-muted); }
.gt-read { width: 27%; color: var(--text-muted); }
.gt-tag { display: block; width: fit-content; margin-top: 6px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: var(--primary-50); color: var(--primary-600); box-shadow: inset 0 0 0 1px var(--primary-200); }
.gt-tag--ok { background: var(--success-bg); color: var(--success-text); box-shadow: inset 0 0 0 1px var(--success-border); }
@media (max-width: 899px) {
  .gt, .gt tbody, .gt tr, .gt th, .gt td { display: block; }
  .gt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gt tbody tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; padding: 12px 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-12); background: var(--white); }
  .gt tbody th { grid-column: 1 / -1; width: auto; padding: 0 0 4px; border: 0; }
  .gt td:not(.gt-read) { width: auto; padding: 0; border: 0; text-align: center; }
  .gt td:not(.gt-read)::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); }
  .gt-s { min-width: 0; width: 100%; padding-inline: 2px; }
  .gt td.gt-read { grid-column: 1 / -1; width: auto; padding: 8px 0 0; border: 0; }
}

/* ---------- Matriz de hipótesis (evidencia por método) ---------- */
.hy { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.hy th, .hy td { padding: 14px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.hy thead th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.hy tbody th { width: 17%; font-weight: 600; color: var(--gray-900); }
.hy td { width: 20%; }
.hy td .aud-s { display: block; width: fit-content; }
.hy-n { display: block; margin-top: 2px; }
.hy .hy-v { width: 23%; background: color-mix(in srgb, var(--primary-50) 60%, var(--white)); color: var(--gray-900); }
.hy .hy-v b { display: block; font-size: 14.5px; color: var(--gray-900); }
.hy .hy-v .aud-d { margin-top: 2px; }
.hy-merged .aud-d { max-width: 60ch; }
.gt-tag--out { background: var(--white); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--secondary-200); }
@media (max-width: 899px) {
  .hy, .hy tbody, .hy tr, .hy th, .hy td { display: block; }
  .hy thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hy tbody tr { margin-bottom: 12px; padding: 6px 0 0; border: 1px solid var(--border-soft); border-radius: var(--radius-12); background: var(--white); overflow: hidden; }
  .hy tbody th { width: auto; padding: 10px 14px 4px; border: 0; }
  .hy td { width: auto; padding: 6px 14px; border: 0; }
  .hy td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
  .hy .hy-v { width: auto; margin-top: 8px; padding: 12px 14px; border: 0; }
}

/* ---------- Pares antes/después ---------- */
.alq-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 28px 24px; align-items: start; }
.alq-acts .nxh-live { width: 320px; max-width: 100%; }
.alq-acts .nxt-ph__cap { max-width: 320px; }
.alq-desk { display: flex; flex-direction: column; gap: 28px; }
.alq-mob { display: none; }
@media (max-width: 699px) {
  .alq-desk { display: none !important; }
  .alq-mob { display: grid; }
}
.alq-img img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px rgba(7, 78, 155, 0.16); background: #fff; }
.alq-shot iframe { top: calc(var(--y, 0) * var(--s, 0.84) * -1px); height: calc((var(--h, 520) + var(--y, 0)) * 1px); }
.alq-scroll { overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.alq-scroll:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.alq-scroll img { display: block; width: 100%; height: auto; }
.alq-open { margin: 4px 0 0; }
