.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Tarjetas */
.card {
  position: relative;
  border: 1px solid #bbb;
  border-radius: 10px;
  padding: 14px;
  padding-bottom: 38px;
  background-color: var(--card-color);
  transition: .2s;
}

/* Franja degradada de fondo */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 45px; /* franja superior */
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: var(--card-color, linear-gradient(135deg, #2b6e83 0%, #1a4350 100%));
  opacity: 0.6; /* suave, no tapa contenido */
  z-index: 0;
}

/* Contenido por encima */
.card > * {
  position: relative;
  z-index: 1;
}

.card .title {
  display: block;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0, 0, 0, 0.1); /* borde sutil */
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #333;
  overflow-wrap: break-word;
  text-overflow: ellipsis;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

/* Contenido: emoji + descripción */
.card .inner {
    display: flex;
    flex-direction: row;
    gap: 0.7rem;
    align-items: center;
}

.card .inner .icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    width: 70px;
    text-align: center;
    color: #333;
}

.card .content {
    flex: 1;
}

.card .content p {
    margin: 0;
    line-height: 1.4;
}


/* Descripción */
.card .content {
    flex: 1;
}

.card .content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    text-align: justify;
}

/* Prompt y footer */
.prompt {
  max-height: 8.4em;
  overflow: hidden;
  mask-image: linear-gradient(#000 70%, transparent);
  transition: max-height .25s ease;
}

.prompt.expand {
  max-height: none;
  mask-image: none;
}

.card-footer {
  position: absolute;
  bottom: 8px;
  left: 12px;
}

.vermas {
  color: #3d4449;
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.vermas:hover {
  color: #3d4449;
}

.card.selected {
  background-color: rgba(25, 0, 220, 0.15); /* un poco más intenso */
  box-shadow: 0 0 8px rgba(25,0,220,0.4);   /* leve resplandor */
  border-radius: 5px;                        /* suaviza los bordes */
}

@keyframes flash {
  0%, 100% { box-shadow: 0 0 8px rgba(43, 110, 131, 0.35); }
  50%      { box-shadow: 0 0 14px rgba(43, 110, 131, 0.55); }
}

.card.selected.flash {
  animation: flash 1.5s ease-in-out 2;
}

.cards-group-title {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0 12px 0;       
    width: 100%;
    border: 1px solid transparent;
    border-left-width: 6px;
    background-color: #ffffff; /* fondo sólido */
    height: 50px; /* altura fija para centrar verticalmente */
}

/* Capa de texto */
.cards-group-title .text-layer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;       /* centrado vertical */
    font-weight: 600;
    font-size: 0.9rem;
    color: #1900DC;            /* color de texto sólido */
    text-align: left;
    padding: 0 16px 0 16px;    /* padding horizontal */
    height: 100%;
    gap: 8px;                   /* espacio entre el SVG y el texto */
}

/* h2 dentro de text-layer */
.cards-group-title .text-layer h2 {
    display: flex;
    align-items: center;
    gap: 8px;                   /* espacio entre icono y texto */
    margin: 0;                  /* elimina margen por defecto */
    color: inherit;             /* toma el color de text-layer */
    font-family: inherit;
}

/* Lucide SVG dentro del h2 */
.cards-group-title .text-layer h2 i svg {
    width: 24px;                /* tamaño más grande del icono */
    height: 24px;
    stroke: #1900DC;            /* color azul del SVG */
}

/* Responsive */
@media (max-width: 600px) {
    .cards-group-title .text-layer {
        font-size: 0.75rem;
        padding: 0 12px;         /* menos padding horizontal en móvil */
        gap: 6px;
    }

    .cards-group-title .text-layer h2 i svg {
        width: 20px;
        height: 20px;
    }
}
