/* ═══════════════════════════════════════════════════════════════════
   Malla Curricular Interactiva — CFT de Magallanes
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Paleta refinada y cohesiva con la identidad burdeo del CFT.
     Cada categoría tiene un tono de acento (para barra y chip) y un fondo
     muy claro; el nombre del módulo va en tono oscuro para máxima legibilidad. */
  --malla-sello:            #A83030;
  --malla-sello-bg:         #fbf3f3;
  --malla-sello-border:     rgba(168,48,48,0.18);
  --malla-generica:         #5b6472;
  --malla-generica-bg:      #f6f7f8;
  --malla-generica-border:  rgba(91,100,114,0.16);
  --malla-especialidad:     #0f766e;   /* petróleo, complementa el burdeo sin competir */
  --malla-especialidad-bg:  #f0f7f6;
  --malla-especialidad-border: rgba(15,118,110,0.18);
  --malla-practica:         #b45309;   /* ámbar cálido */
  --malla-practica-bg:      #fdf6ec;
  --malla-practica-border:  rgba(180,83,9,0.18);
  --malla-texto:            #26262b;   /* nombre de módulo, legible sobre cualquier tinte */
}

/* ── Sección ────────────────────────────────────────────────────── */
.malla-section {
  background: #f0f0ee;
  padding-block: 4rem 3rem;
}

/* ── Encabezado + stats ─────────────────────────────────────────── */
.malla-header {
  display: flex; flex-wrap: wrap;
  align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.malla-header-text { flex: 1 1 300px; }
.malla-header-text h2 { margin-bottom: 0.2rem; }
.malla-intro { font-size: 0.85rem; color: var(--cft-gray); }

.malla-stats {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  align-items: center;
}
.malla-stat-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.02em;
}
.malla-stat-pill--sello        { background: var(--malla-sello-bg);        color: var(--malla-sello);        border: 1px solid var(--malla-sello-border); }
.malla-stat-pill--generica     { background: var(--malla-generica-bg);     color: var(--malla-generica);     border: 1px solid var(--malla-generica-border); }
.malla-stat-pill--especialidad { background: var(--malla-especialidad-bg); color: var(--malla-especialidad); border: 1px solid var(--malla-especialidad-border); }
.malla-stat-pill--practica     { background: var(--malla-practica-bg);     color: var(--malla-practica);     border: 1px solid var(--malla-practica-border); }
.malla-stat-num { font-size: 1rem; font-weight: 900; }

/* ── Barra de herramientas ──────────────────────────────────────── */
.malla-toolbar {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.6rem;
  margin-bottom: 1rem;
}
.malla-filtros {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.malla-filtro {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: #fff; color: #555;
  font-size: 0.73rem; font-weight: 700;
  cursor: pointer; letter-spacing: 0.01em;
  transition: all 0.18s cubic-bezier(.2,.8,.2,1);
  user-select: none;
}
.malla-filtro:hover { border-color: #999; color: #222; transform: translateY(-1px); }
.malla-filtro-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  transition: transform 0.2s;
}
.malla-filtro.is-active { transform: translateY(-1px); }
.malla-filtro.is-active .malla-filtro-dot { transform: scale(1.3); }
.malla-filtro.is-active[data-tipo="todos"]        { background: #1a1918; color: #fff; border-color: #1a1918; }
.malla-filtro.is-active[data-tipo="sello"]        { background: var(--malla-sello-bg); color: var(--malla-sello); border-color: var(--malla-sello); }
.malla-filtro.is-active[data-tipo="generica"]     { background: var(--malla-generica-bg); color: var(--malla-generica); border-color: var(--malla-generica); }
.malla-filtro.is-active[data-tipo="especialidad"] { background: var(--malla-especialidad-bg); color: var(--malla-especialidad); border-color: var(--malla-especialidad); }
.malla-filtro.is-active[data-tipo="practica"]     { background: var(--malla-practica-bg); color: var(--malla-practica); border-color: var(--malla-practica); }

.malla-btn-pdf {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  background: #fff; color: #333;
  border: 1.5px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  font-size: 0.73rem; font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.malla-btn-pdf:hover { background: #1a1918; color: #fff; border-color: #1a1918; transform: translateY(-1px); }
.malla-btn-pdf svg { transition: transform 0.2s; }
.malla-btn-pdf:hover svg { transform: translateY(1px); }

/* ── Scroll wrapper ─────────────────────────────────────────────── */
.malla-scroll {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(26,25,24,0.09), 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.06);
  cursor: grab;
}
.malla-scroll:active { cursor: grabbing; }
.malla-scroll::-webkit-scrollbar { height: 5px; }
.malla-scroll::-webkit-scrollbar-track { background: transparent; }
.malla-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 999px; }

/* ── Grid ───────────────────────────────────────────────────────── */
.malla-grid {
  display: grid;
  min-width: 740px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}

/* Cabeceras año */
.malla-anio {
  background: #1a1918;
  color: #fff; text-align: center;
  padding: 0.7rem 1rem;
  font-size: 0.66rem; font-weight: 900;
  letter-spacing: 0.22em; text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.malla-anio:last-child { border-right: none; }

/* Cabeceras semestre */
.malla-sem-head {
  background: var(--cft-red);
  color: #fff; text-align: center;
  padding: 0.62rem 0.6rem;
  font-size: 0.62rem; font-weight: 900;
  letter-spacing: 0.14em; text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.14);
}
.malla-sem-head:last-child { border-right: none; }

/* ── Celdas de módulo ───────────────────────────────────────────── */
.malla-modulo {
  position: relative;
  padding: 0.8rem 0.8rem 0.7rem 1.1rem;
  border-right: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
  min-height: 88px;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1),
              box-shadow 0.2s cubic-bezier(.2,.8,.2,1),
              opacity 0.18s, background 0.15s;
  outline: none;
}
.malla-modulo::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  transition: width 0.2s;
}
.malla-modulo:hover { transform: scale(1.03); box-shadow: 0 10px 30px rgba(0,0,0,0.14); z-index: 3; }
.malla-modulo:hover::before { width: 6px; }
.malla-modulo:focus-visible { outline: 2px solid var(--cft-red); outline-offset: -2px; }

/* Resaltado al filtrar (los que coinciden) */
.malla-modulo.is-highlight { box-shadow: inset 0 0 0 1.5px currentColor; }
.malla-modulo.is-highlight[data-tipo="sello"]        { color: var(--malla-sello); }
.malla-modulo.is-highlight[data-tipo="generica"]     { color: var(--malla-generica); }
.malla-modulo.is-highlight[data-tipo="especialidad"] { color: var(--malla-especialidad); }
.malla-modulo.is-highlight[data-tipo="practica"]     { color: var(--malla-practica); }

/* Seleccionado */
.malla-modulo.is-selected {
  transform: scale(1.03);
  box-shadow: 0 12px 34px rgba(0,0,0,0.17);
  z-index: 4;
}
.malla-modulo.is-selected[data-tipo="sello"]        { color: var(--malla-sello); }
.malla-modulo.is-selected[data-tipo="generica"]     { color: var(--malla-generica); }
.malla-modulo.is-selected[data-tipo="especialidad"] { color: var(--malla-especialidad); }
.malla-modulo.is-selected[data-tipo="practica"]     { color: var(--malla-practica); }
.malla-modulo.is-selected::after {
  content: "";
  position: absolute; inset: 0;
  border: 2px solid currentColor;
  pointer-events: none;
  opacity: 0.55;
}

/* Dimmed */
.malla-modulo.is-dimmed {
  opacity: 0.28;
  filter: saturate(0.4);
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

/* Tipos: fondo con tinte suave */
.malla-modulo[data-tipo="sello"]        { background: var(--malla-sello-bg); }
.malla-modulo[data-tipo="generica"]     { background: var(--malla-generica-bg); }
.malla-modulo[data-tipo="especialidad"] { background: var(--malla-especialidad-bg); }
.malla-modulo[data-tipo="practica"]     { background: var(--malla-practica-bg); }

.malla-modulo[data-tipo="sello"]        { --acento: var(--malla-sello); }
.malla-modulo[data-tipo="generica"]     { --acento: var(--malla-generica); }
.malla-modulo[data-tipo="especialidad"] { --acento: var(--malla-especialidad); }
.malla-modulo[data-tipo="practica"]     { --acento: var(--malla-practica); }
.malla-modulo::before { background: var(--acento); }

/* Etiqueta de categoría por celda (pequeña, sobre el acento) */
.malla-modulo .malla-nombre {
  font-size: 0.8rem; font-weight: 700; line-height: 1.4;
  color: var(--malla-texto);
  letter-spacing: -0.01em;
}

/* ── Tooltip (posicionado via JS como fixed para evitar overflow:hidden) ── */
.malla-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 220px;
  background: #1a1918;
  color: #f0f0ee;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.73rem; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  pointer-events: none;
  transition: opacity 0.12s;
}
.malla-tooltip.is-visible { display: block; }
.malla-tooltip::after {
  content: "";
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1918;
}
.malla-tooltip.tip-below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1a1918;
}
.malla-tooltip .tip-tipo {
  display: block; font-size: 0.6rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.12em;
  opacity: 0.55; margin-bottom: 0.3rem;
}
.malla-tooltip strong { display: block; font-size: 0.75rem; margin-bottom: 0.3rem; color: #fff; }

.malla-badges {
  display: flex; flex-wrap: wrap; gap: 0.2rem;
  padding-left: 0.2rem; margin-top: auto;
}
.malla-badge {
  font-size: 0.55rem; font-weight: 800;
  padding: 0.1rem 0.3rem; border-radius: 3px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.malla-badge--valora { background: #e3f5ea; color: #1a6e35; border: 1px solid #b3ddc1; }
.malla-badge--emtp   { background: #fff3e0; color: #7d4800; border: 1px solid #f5c87a; }

.malla-vacia {
  background: #fafafa;
  border-right: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ── Panel de detalle ───────────────────────────────────────────── */
.malla-detalle {
  margin-top: 0.75rem;
  background: #fff;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.1);
  padding: 1.1rem 1.25rem;
  animation: malla-slide-in 0.22s cubic-bezier(.2,.8,.2,1);
}
.malla-detalle[hidden] { display: none; }
.malla-detalle.is-visible { display: block; }
@keyframes malla-slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.malla-detalle-inner {
  display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}
.malla-detalle-tipo {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.65rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.22rem 0.6rem; border-radius: 4px;
  margin-bottom: 0.5rem; flex-shrink: 0;
}
.malla-detalle-tipo[data-tipo="sello"]        { background: var(--malla-sello-bg); color: var(--malla-sello); }
.malla-detalle-tipo[data-tipo="generica"]     { background: var(--malla-generica-bg); color: var(--malla-generica); }
.malla-detalle-tipo[data-tipo="especialidad"] { background: var(--malla-especialidad-bg); color: var(--malla-especialidad); }
.malla-detalle-tipo[data-tipo="practica"]     { background: var(--malla-practica-bg); color: var(--malla-practica); }
.malla-detalle-dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.malla-detalle h4 { font-size: 1rem; font-weight: 800; margin: 0 0 0.4rem; letter-spacing: -0.02em; }
.malla-detalle p  { font-size: 0.85rem; color: #555; line-height: 1.6; margin: 0; }
.malla-detalle-close {
  margin-left: auto; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--cft-gray-bg); color: #666;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  border: none; transition: background 0.15s;
}
.malla-detalle-close:hover { background: #e0e0de; color: #222; }

/* ── Certificaciones intermedias ────────────────────────────────── */
.malla-certs { margin-top: 1.5rem; }
.malla-certs-titulo {
  font-size: 0.65rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: #999; text-align: center;
  margin-bottom: 0.85rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.malla-certs-titulo::before,
.malla-certs-titulo::after { content: ""; flex: 1; height: 1px; background: #ddd; }
.malla-certs-grid { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; }
.malla-cert {
  display: inline-flex; align-items: flex-start; gap: 0.65rem;
  background: #fff; border: 1.5px solid var(--cft-red);
  border-radius: 12px; padding: 0.7rem 1rem;
  max-width: 290px;
  transition: box-shadow 0.2s;
}
.malla-cert:hover { box-shadow: 0 4px 16px rgba(168,48,48,0.12); }
.malla-cert-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: #fdf1f1; color: var(--cft-red);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.malla-cert-body { font-size: 0.78rem; }
.malla-cert-body strong { display: block; color: #1a1918; font-weight: 800; line-height: 1.3; margin-bottom: 0.15rem; }
.malla-cert-body span { color: #888; font-size: 0.69rem; }

/* ── Leyenda ────────────────────────────────────────────────────── */
.malla-leyenda {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  margin-top: 1.25rem; padding: 0.85rem 1.1rem;
  background: #fff; border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08);
}
.malla-leyenda-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.69rem; font-weight: 700; color: #555;
}
.malla-leyenda-dot {
  width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0;
}
.malla-leyenda-dot--sello        { background: var(--malla-sello); }
.malla-leyenda-dot--generica     { background: var(--malla-generica); }
.malla-leyenda-dot--especialidad { background: var(--malla-especialidad); }
.malla-leyenda-dot--practica     { background: var(--malla-practica); }
.malla-leyenda-badge {
  font-size: 0.55rem; font-weight: 800; padding: 0.1rem 0.3rem;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════════
   VERSIÓN IMPRIMIBLE (PDF)
   ══════════════════════════════════════════════════════════════════ */
.malla-print { display: none; }

@media print {
  body > *:not(.malla-print-wrapper) { display: none !important; }
  .malla-print-wrapper { display: block !important; }
  .malla-print { display: block; }

  .malla-print-page {
    width: 297mm; min-height: 210mm;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #fff; color: #1a1918;
    padding: 0; margin: 0;
    page-break-after: always;
  }

  /* Header del PDF */
  .mp-header {
    background: #A83030;
    color: #fff;
    padding: 18mm 20mm 14mm;
    position: relative;
    overflow: hidden;
  }
  .mp-header::after {
    content: "";
    position: absolute; right: 0; top: 0; bottom: 0; width: 120px;
    background: rgba(255,255,255,0.05);
  }
  .mp-header-sub {
    font-size: 7.5pt; font-weight: 700; letter-spacing: 0.18em;
    text-transform: uppercase; opacity: 0.85; margin-bottom: 4px;
  }
  .mp-header h1 {
    font-size: 26pt; font-weight: 900; letter-spacing: -0.02em;
    line-height: 1; margin: 0 0 10px;
  }
  .mp-header-meta {
    display: flex; gap: 20px; font-size: 7pt; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8;
  }
  .mp-logo {
    position: absolute; right: 20mm; bottom: 12mm;
    height: 28mm; width: auto;
  }

  /* Grid del PDF */
  .mp-body { padding: 8mm 12mm; }
  .mp-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6mm;
  }
  .mp-anio {
    background: #1a1918; color: #fff;
    text-align: center; padding: 4px;
    font-size: 7pt; font-weight: 900; letter-spacing: 0.2em;
    text-transform: uppercase;
    border-right: 1px solid rgba(255,255,255,0.1);
  }
  .mp-anio:last-child { border-right: none; }
  .mp-sem {
    background: #A83030; color: #fff; text-align: center;
    padding: 4px; font-size: 6pt; font-weight: 900;
    letter-spacing: 0.15em; text-transform: uppercase;
    border-right: 1px solid rgba(255,255,255,0.15);
  }
  .mp-sem:last-child { border-right: none; }
  .mp-cell {
    padding: 5px 7px 5px 10px; min-height: 20mm;
    font-size: 7pt; font-weight: 700; line-height: 1.3;
    border-right: 1px solid rgba(0,0,0,0.07);
    border-bottom: 1px solid rgba(0,0,0,0.07);
    position: relative;
  }
  .mp-cell::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  }
  .mp-cell--sello        { background: #fdf1f1; color: #A83030; }
  .mp-cell--sello::before { background: #A83030; }
  .mp-cell--generica     { background: #f4f5f7; color: #4a5568; }
  .mp-cell--generica::before { background: #4a5568; }
  .mp-cell--especialidad { background: #f0f7f6; color: #0f766e; }
  .mp-cell--especialidad::before { background: #0f766e; }
  .mp-cell--practica     { background: #fdf6ec; color: #b45309; }
  .mp-cell--practica::before { background: #b45309; }
  .mp-cell--vacia        { background: #f9f9f8; }
  .mp-badge {
    display: inline-block; font-size: 5.5pt; font-weight: 900;
    padding: 1px 3px; border-radius: 2px;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-top: 3px;
  }
  .mp-badge--valora { background: #e3f5ea; color: #1a6e35; }
  .mp-badge--emtp   { background: #fff3e0; color: #7d4800; }

  /* Certs + leyenda del PDF */
  .mp-certs-row {
    display: flex; gap: 8px; margin-bottom: 5mm;
  }
  .mp-cert {
    flex: 1; border: 1.5px solid #A83030; border-radius: 5px;
    padding: 5px 8px; font-size: 7pt; font-weight: 700;
    color: #A83030;
  }
  .mp-cert-label { font-size: 6pt; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; color: #888; display: block; margin-bottom: 2px; }
  .mp-certs-title {
    font-size: 6.5pt; font-weight: 900; letter-spacing: 0.16em;
    text-transform: uppercase; color: #aaa; text-align: center; margin-bottom: 4px;
  }
  .mp-leyenda {
    display: flex; gap: 16px; flex-wrap: wrap;
    border-top: 1px solid #eee; padding-top: 4mm;
    align-items: center;
  }
  .mp-leyenda-title {
    font-size: 6pt; font-weight: 900; letter-spacing: 0.15em;
    text-transform: uppercase; color: #888; margin-right: 4px;
  }
  .mp-ley-item { display: flex; align-items: center; gap: 4px; font-size: 6.5pt; font-weight: 700; }
  .mp-ley-dot {
    width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0;
  }
  .mp-footer-logo { height: 14mm; width: auto; }
}

/* Responsive */
@media (max-width: 680px) {
  .malla-nombre { font-size: 0.67rem; }
  .malla-modulo { min-height: 64px; padding: 0.55rem 0.6rem 0.55rem 0.8rem; }
}

/* ── Tabs modalidad ─────────────────────────────────────────────── */
.malla-modalidad-tabs {
  display: flex; gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: #e8e8e6; border-radius: 999px;
  padding: 0.25rem; width: fit-content;
}
.malla-mod-tab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700;
  border: none; background: transparent; color: #666;
  cursor: pointer; transition: all 0.18s;
}
.malla-mod-tab.is-active {
  background: #fff; color: #1a1918;
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.malla-mod-tab:hover:not(.is-active) { color: #333; }

.malla-semi-aviso {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: #fff; border: 1.5px solid rgba(168,48,48,0.2);
  border-radius: 10px; padding: 1rem 1.25rem;
  margin-bottom: 1.25rem; color: #555; font-size: 0.875rem; line-height: 1.6;
}
.malla-semi-aviso svg { flex-shrink: 0; color: #A83030; margin-top: 0.1em; }
.malla-semi-aviso p { margin: 0; }

[hidden] { display: none !important; }

/* === MOBILE === */
@media (max-width: 480px) {
  /* Tabs: área de tap ≥ 44px */
  .malla-mod-tab {
    padding: 0.65rem 1rem;
    min-height: 44px;
    font-size: 0.8rem;
  }
  .malla-modalidad-tabs {
    width: 100%;
    justify-content: stretch;
  }
  .malla-mod-tab { flex: 1; justify-content: center; }

  /* Toolbar: apilar filtros y botón PDF */
  .malla-toolbar { flex-direction: column; align-items: flex-start; }
  .malla-filtros { gap: 0.25rem; }
  .malla-filtro { padding: 0.42rem 0.75rem; font-size: 0.7rem; min-height: 36px; }

  /* Header: apilar */
  .malla-header { flex-direction: column; align-items: flex-start; }
  .malla-stats { gap: 0.35rem; }

  /* Scroll hint visual */
  .malla-scroll {
    /* mask para indicar scroll horizontal */
    -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
    mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  }

  /* Certs: apilar */
  .malla-certs-grid { flex-direction: column; align-items: center; }
  .malla-cert { max-width: 100%; width: 100%; }
}
