/* Programas 29N · estilo de casa del superartículo: monocromo iOS, un acento, tarjetas suaves. */
:root {
  --acc: #3f4b5e; --txt: #3c424d; --h: #1c1f26; --mut: #8a909c; --line: #ececf0; --soft: #f5f6f8;
  --p2: #2f7a58; --p1: #93c9ad; --z: #d6d9df; --n1: #eaa9a2; --n2: #c0473d; --na: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--txt); font-family: var(--font); -webkit-text-size-adjust: 100%; }
button, input { font: inherit; color: inherit; }
#app { padding: 4px 2px 8px; }
.boot { display: grid; place-items: center; min-height: 160px; }
.boot i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kick { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin: 0 0 6px; }
.title { font-size: clamp(17px, 4.6vw, 20px); font-weight: 700; color: var(--h); margin: 0 0 4px; letter-spacing: -.01em; }
.note { font-size: 13px; color: var(--mut); margin: 0 0 14px; line-height: 1.45; }

/* Chips de filtro */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--txt); }
.chip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #fff; }
.chip img { width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 5px; object-fit: contain; background: #fff; }

/* Leyenda */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--mut); margin: 4px 0 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.s2 { background: var(--p2); } .sw.s1 { background: var(--p1); } .sw.s0 { background: var(--z); } .sw.sm1 { background: var(--n1); } .sw.sm2 { background: var(--n2); }
.sw.sna { background: var(--na); box-shadow: inset 0 0 0 1px #d9dce2; background-image: repeating-linear-gradient(135deg, transparent 0 3px, #eceef2 3px 4px); }

/* Matriz: una fila por afirmación y una columna por partido. Puntos en vez de casillas:
   el tamaño marca la intensidad y el color el sentido; las columnas se leen por el fondo alterno. */
.mx-head, .mx-row .cells { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); }
.mx-head { position: sticky; top: 0; background: rgba(255,255,255,.97); padding: 8px 0 7px; z-index: 2; border-bottom: 1px solid var(--line); }
.mx-head img { width: 100%; max-width: 24px; aspect-ratio: 1; object-fit: contain; display: block; margin: 0 auto; border-radius: 5px; opacity: .9; transition: transform .15s, opacity .15s; }
.mx-head img.hl { transform: scale(1.18); opacity: 1; }
.mx-axis { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); margin: 22px 0 4px; }
.mx-row { padding: 9px 0 6px; border-bottom: 1px solid var(--line); }
.mx-row p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.38; color: var(--h); font-weight: 600; }
.cell { position: relative; height: 26px; width: 100%; border: 0; padding: 0; cursor: pointer; background: transparent; }
.mx-row .cells > .cell:nth-child(even) { background: #f6f7f9; }
.cell.hl { background: #e9ecf1 !important; }
.cell::before { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); transition: transform .15s; }
.cell.s2::before  { width: 14px; height: 14px; background: var(--p2); }
.cell.s1::before  { width: 9px;  height: 9px;  background: var(--p2); opacity: .55; }
.cell.s0::before  { width: 9px;  height: 9px;  box-shadow: inset 0 0 0 2px #9aa0ab; }
.cell.sm1::before { width: 9px;  height: 9px;  background: var(--n2); opacity: .55; }
.cell.sm2::before { width: 14px; height: 14px; background: var(--n2); }
.cell.sna::before { width: 4px;  height: 4px;  background: #d3d6dc; }
.cell:hover::before, .cell:focus-visible::before { transform: translate(-50%, -50%) scale(1.3); }
.cell:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; border-radius: 4px; }

/* Leyenda con los mismos puntos */
.legend .sw { width: 14px; height: 14px; border-radius: 50%; background: none !important; box-shadow: none !important; position: relative; }
.legend .sw::before { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.legend .s2::before  { width: 14px; height: 14px; background: var(--p2); }
.legend .s1::before  { width: 9px;  height: 9px;  background: var(--p2); opacity: .55; }
.legend .s0::before  { width: 9px;  height: 9px;  box-shadow: inset 0 0 0 2px #9aa0ab; }
.legend .sm1::before { width: 9px;  height: 9px;  background: var(--n2); opacity: .55; }
.legend .sm2::before { width: 14px; height: 14px; background: var(--n2); }
.legend .sna::before { width: 4px;  height: 4px;  background: #d3d6dc; }

/* Espectro por afirmación */
.sp { border: 1px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; margin: 0 0 12px; background: #fff; box-shadow: 0 4px 18px rgba(20,24,33,.04); }
.sp > p { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--h); line-height: 1.4; }
.sp-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.sp-col { min-height: 46px; border-radius: 10px; padding: 6px 2px; display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; justify-content: center; }
.sp-col.c2 { background: rgba(47,122,88,.10); } .sp-col.c1 { background: rgba(147,201,173,.16); } .sp-col.c0 { background: var(--soft); }
.sp-col.cm1 { background: rgba(234,169,162,.18); } .sp-col.cm2 { background: rgba(192,71,61,.10); }
.sp-lab { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 10.5px; color: var(--mut); text-align: center; margin-top: 5px; line-height: 1.2; }
.lg { width: 28px; height: 28px; border-radius: 8px; border: 0; padding: 2px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(20,24,33,.08); cursor: pointer; }
.lg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lg:hover, .lg:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.sp-na { margin-top: 8px; font-size: 11.5px; color: var(--mut); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.sp-na .lg { width: 22px; height: 22px; opacity: .55; }

/* Medidas */
.ms { display: grid; gap: 8px; }
.m { border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.m img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.m b { display: block; font-size: 14px; color: var(--h); line-height: 1.35; }
.m q, .hit q { display: block; margin-top: 4px; font-size: 12.5px; color: var(--mut); font-style: italic; line-height: 1.45; quotes: "«" "»"; }
.meta { margin-top: 5px; font-size: 11.5px; color: var(--mut); }
.meta a { color: var(--acc); font-weight: 600; text-decoration: none; }
.meta a:hover { text-decoration: underline; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--acc); background: var(--soft); border-radius: 999px; padding: 2px 8px; margin-left: 4px; font-style: normal; }
.more { margin: 10px auto 0; display: block; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* Buscador */
.search { position: relative; margin: 0 0 10px; }
.search input { width: 100%; border: 1px solid #dcdfe5; border-radius: 14px; padding: 13px 14px 13px 40px; font-size: 16px; background: #fff; outline: none; color: var(--h); }
.search input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(63,75,94,.12); }
.search::before { content: ""; position: absolute; left: 15px; top: 50%; width: 13px; height: 13px; margin-top: -9px; border: 2px solid var(--mut); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 27px; top: 50%; width: 2px; height: 7px; margin-top: 3px; background: var(--mut); transform: rotate(-45deg); }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: 12.5px; color: var(--mut); align-items: center; }
.sugg button { border: 0; background: var(--soft); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--txt); }
.res-sum { font-size: 13px; color: var(--mut); margin: 4px 0 12px; }
.grp { border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; overflow: hidden; }
.grp > button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: #fff; padding: 11px 13px; cursor: pointer; text-align: left; }
.grp > button img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.grp > button b { flex: 1; font-size: 14.5px; color: var(--h); }
.grp > button span { font-size: 12px; color: var(--mut); font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--acc); opacity: .75; margin-left: auto; }
.hits { padding: 0 13px 10px; display: grid; gap: 8px; }
.hit { border-top: 1px solid var(--line); padding-top: 9px; font-size: 13.5px; line-height: 1.5; color: var(--txt); }
.hit .k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); display: block; margin-bottom: 2px; }
mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { text-align: center; color: var(--mut); font-size: 14px; padding: 26px 10px; }

/* Detalle desplegado (en línea: en un iframe de altura automática un modal fijo quedaría fuera de la vista) */
.det { position: relative; margin: 8px 0 4px; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 6px 22px rgba(20,24,33,.07); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.det-x { position: absolute; right: 8px; top: 8px; border: 0; background: var(--soft); width: 28px; height: 28px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; color: var(--mut); }
.d-head { display: flex; align-items: center; gap: 10px; margin: 0 34px 12px 0; }
.d-head img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.d-head b { font-size: 16px; color: var(--h); display: block; }
.d-head small { font-size: 12px; color: var(--mut); }
.d-q { font-size: 14px; font-weight: 600; color: var(--h); margin: 0 0 10px; line-height: 1.4; }
.d-st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.d-ev { font-size: 14px; line-height: 1.6; margin: 0 0 10px; }
.d-quote { margin: 0 0 10px; padding: 10px 12px; background: var(--soft); border-radius: 12px; font-size: 13px; font-style: italic; line-height: 1.5; color: var(--txt); }
@media (prefers-reduced-motion: reduce) { .det { animation: none; } .cell { transition: none; } }
